-
Notifications
You must be signed in to change notification settings - Fork 308
WIP: new Wasmi bytecode #1148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: new Wasmi bytecode #1148
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1148 +/- ##
==========================================
- Coverage 79.73% 78.02% -1.72%
==========================================
Files 296 304 +8
Lines 25433 26121 +688
==========================================
+ Hits 20280 20380 +100
- Misses 5153 5741 +588 ☔ View full report in Codecov by Sentry. |
b716285
to
1b92892
Compare
23a5865
to
eeb535a
Compare
6594e55
to
505f6ba
Compare
This allows to add proper encoding size checks to OpEncoder::patch and also may allow for future OpEncoder::get_mut API.
The constant is unnecessary because it always should be equal to size_of<Self> anways and now this is better communicated in the code.
Superseeded by #1152. We probably need a new attempt at this more involved Wasmi bytecode attempt at a later point in time. Fortunately, #1152 turned out to be pretty simple and should still be able to deliver the possibility to implement new dispatching routines (and more) on top of it. Closed. |
This PR adds the
wasmi_ir
crate to the Wasmi workspace which defines the new Wasmi bytecode, its encoding and decoding as well as utility definitions.This does not yet use the new Wasmi bytecode in the Wasmi crate.
This is the first step towards #1101.
ToDo
CheckedOpDecoder::visit
UncheckedOpDecoder::visit
OpEncoder::{visit, pop_visit}
UncheckedOpDecoder::dispatch
UncheckedOpVariantDecoder::decode
OpEncoder::patch
OpEncoder::iter
yieldingOp
.OpEncoder::iter_mut
yieldingOpMut
.br.table
equivalent Wasmi bytecode operator and efficient encoding.EncodeSize
and traitFixedEncodeSize
and impls.OpEncoder::patch
.OpEncoder::get_mut
API to quickly and easily mutate encodedOp
.i32
variants: saving 2 bytes per operator.i64
variants: saving 6 bytes per operator.f64
-operator variants with 32-bit encoded immediate values.Follow-Ups
i32.{and,or,xor}+i32.eqz
fused operators as they exist in the current Wasmi bytecode.{copy, return}.span
andcopy.span.non-overlapping
.