fitzgen opened PR #8826 from fitzgen:cranelift-bitset
to bytecodealliance:main
:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested abrown for a review on PR #8826.
fitzgen requested wasmtime-compiler-reviewers for a review on PR #8826.
fitzgen requested wasmtime-core-reviewers for a review on PR #8826.
fitzgen requested elliottt for a review on PR #8826.
fitzgen requested wasmtime-default-reviewers for a review on PR #8826.
fitzgen updated PR #8826.
fitzgen updated PR #8826.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Given the perf-sensitive nature of bitsets should this be
debug_assert!
?
alexcrichton created PR review comment:
I think this might also need some parens to get the calculation you're shooting for
alexcrichton created PR review comment:
I think this might need
(...)
to disambiguate?
alexcrichton created PR review comment:
You can probably skip this due to the
?
onlast_mut()
alexcrichton created PR review comment:
This is notably quite different from
Vec::reserve
where it's initializing the reserved space, is that desired here?
alexcrichton created PR review comment:
(if it is desired I think this should probably get a different name)
alexcrichton created PR review comment:
I think this needs to update
self.len
?
alexcrichton created PR review comment:
Could this perhaps be combined with a
match
onlast.pop()
?
fitzgen updated PR #8826.
fitzgen submitted PR review.
fitzgen created PR review comment:
I was thinking that originally, but figured we might as well do the more-correct thing by default and add
unchecked
versions later if profiling shows that these asserts actually matter.I kind of expect LLVM to clean them all up, at least when they are called via
CompoundBitSet
methods, since it should be able to determine the ranges of values flowing into these methods based on the modulo operation inCompoundBitSet::word_and_bit
.
fitzgen submitted PR review.
fitzgen created PR review comment:
Whoops!
fitzgen updated PR #8826.
fitzgen updated PR #8826.
fitzgen commented on PR #8826:
@alexcrichton this should be ready for a second round of review now.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I might recommend renaming this method to
resize
or some variant thereof. TheVec::reserve
method reserves space for extra capacity which isn't what this is doing so I'd be hesitant to create confusion between the two. AlsoVec::reserve
is mostly about preallocating uninitialized memory where this is specifically initializing the memory as well.
alexcrichton submitted PR review.
fitzgen updated PR #8826.
fitzgen has enabled auto merge for PR #8826.
fitzgen merged PR #8826.
Last updated: Nov 22 2024 at 17:03 UTC