singlepass: Align loop headers to 16 bytes.

This commit is contained in:
losfair
2020-06-02 01:58:05 +08:00
parent fcfa378ace
commit fe2b979f0e
2 changed files with 49 additions and 0 deletions

View File

@@ -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;