mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:07:36 +00:00
LibJS/JIT: Compile the JumpUndefined instruction
This commit is contained in:
parent
a16082c6a5
commit
fd059d4e4a
2 changed files with 18 additions and 0 deletions
|
@ -212,6 +212,23 @@ void Compiler::compile_jump_nullish(Bytecode::Op::JumpNullish const& op)
|
||||||
m_assembler.jump(label_for(op.false_target()->block()));
|
m_assembler.jump(label_for(op.false_target()->block()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Compiler::compile_jump_undefined(Bytecode::Op::JumpUndefined const& op)
|
||||||
|
{
|
||||||
|
load_vm_register(GPR0, Bytecode::Register::accumulator());
|
||||||
|
|
||||||
|
m_assembler.shift_right(
|
||||||
|
Assembler::Operand::Register(GPR0),
|
||||||
|
Assembler::Operand::Imm(48));
|
||||||
|
|
||||||
|
m_assembler.jump_if(
|
||||||
|
Assembler::Operand::Register(GPR0),
|
||||||
|
Assembler::Condition::EqualTo,
|
||||||
|
Assembler::Operand::Imm(UNDEFINED_TAG),
|
||||||
|
label_for(op.true_target()->block()));
|
||||||
|
|
||||||
|
m_assembler.jump(label_for(op.false_target()->block()));
|
||||||
|
}
|
||||||
|
|
||||||
[[maybe_unused]] static Value cxx_increment(VM& vm, Value value)
|
[[maybe_unused]] static Value cxx_increment(VM& vm, Value value)
|
||||||
{
|
{
|
||||||
auto old_value = TRY_OR_SET_EXCEPTION(value.to_numeric(vm));
|
auto old_value = TRY_OR_SET_EXCEPTION(value.to_numeric(vm));
|
||||||
|
|
|
@ -74,6 +74,7 @@ private:
|
||||||
O(Jump, jump) \
|
O(Jump, jump) \
|
||||||
O(JumpConditional, jump_conditional) \
|
O(JumpConditional, jump_conditional) \
|
||||||
O(JumpNullish, jump_nullish) \
|
O(JumpNullish, jump_nullish) \
|
||||||
|
O(JumpUndefined, jump_undefined) \
|
||||||
O(Increment, increment) \
|
O(Increment, increment) \
|
||||||
O(Decrement, decrement) \
|
O(Decrement, decrement) \
|
||||||
O(EnterUnwindContext, enter_unwind_context) \
|
O(EnterUnwindContext, enter_unwind_context) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue