mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 05:38:19 +00:00
singlepass: Align loop headers to 16 bytes.
This commit is contained in:
@@ -5586,6 +5586,15 @@ impl<'a> FuncGen<'a> {
|
||||
self.control_stack.push(frame);
|
||||
}
|
||||
Operator::Loop { ty } => {
|
||||
// Pad with NOPs to the next 16-byte boundary.
|
||||
match self.assembler.get_offset().0 % 16 {
|
||||
0 => {}
|
||||
x => {
|
||||
self.assembler.emit_nop_n(16 - x);
|
||||
}
|
||||
}
|
||||
assert_eq!(self.assembler.get_offset().0 % 16, 0);
|
||||
|
||||
let label = self.assembler.get_label();
|
||||
let state_diff_id = self.get_state_diff();
|
||||
let _activate_offset = self.assembler.get_offset().0;
|
||||
|
||||
Reference in New Issue
Block a user