1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:17:35 +00:00

LibJIT: Emit 8-bit PUSH imm when possible

This commit is contained in:
Andreas Kling 2023-10-28 14:38:40 +02:00
parent fff82c5ffe
commit bbde64e0b6

View file

@ -499,9 +499,15 @@ struct Assembler {
emit8(0x49);
emit8(0x50 | encode_reg(op.reg));
} else if (op.type == Operand::Type::Imm) {
VERIFY(op.fits_in_i32());
emit8(0x68);
emit32(op.offset_or_immediate);
if (op.fits_in_i8()) {
emit8(0x6a);
emit8(op.offset_or_immediate);
} else if (op.fits_in_i32()) {
emit8(0x68);
emit32(op.offset_or_immediate);
} else {
VERIFY_NOT_REACHED();
}
} else {
VERIFY_NOT_REACHED();
}