1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

LibJS/Bytecode: Add Bytecode::Operand

An Operand is either a register, a local, or a constant (index into the
executable's constant table)
This commit is contained in:
Andreas Kling 2024-02-02 10:19:17 +01:00
parent c0ec924dc9
commit 3466771492
6 changed files with 85 additions and 1 deletions

View file

@ -42,4 +42,10 @@ RefPtr<SourceCode> InstructionStreamIterator::source_code() const
return m_executable ? m_executable->source_code.ptr() : nullptr;
}
Operand::Operand(Register reg)
: m_type(Type::Register)
, m_index(reg.index())
{
}
}