mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibJS: Always inline the bytecode instruction iterator's operator++
This commit is contained in:
parent
a97d75bb63
commit
d203a86900
3 changed files with 32 additions and 31 deletions
|
@ -13,31 +13,6 @@
|
|||
|
||||
namespace JS::Bytecode {
|
||||
|
||||
class InstructionStreamIterator {
|
||||
public:
|
||||
explicit InstructionStreamIterator(ReadonlyBytes bytes)
|
||||
: m_bytes(bytes)
|
||||
{
|
||||
}
|
||||
|
||||
size_t offset() const { return m_offset; }
|
||||
bool at_end() const { return m_offset >= m_bytes.size(); }
|
||||
void jump(size_t offset)
|
||||
{
|
||||
VERIFY(offset <= m_bytes.size());
|
||||
m_offset = offset;
|
||||
}
|
||||
|
||||
Instruction const& operator*() const { return dereference(); }
|
||||
void operator++();
|
||||
|
||||
private:
|
||||
Instruction const& dereference() const { return *reinterpret_cast<Instruction const*>(m_bytes.data() + offset()); }
|
||||
|
||||
ReadonlyBytes m_bytes;
|
||||
size_t m_offset { 0 };
|
||||
};
|
||||
|
||||
struct UnwindInfo {
|
||||
Executable const* executable;
|
||||
BasicBlock const* handler;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue