LibJS: Always inline the bytecode instruction iterator's operator++

This commit is contained in:
Andreas Kling 2021-10-25 13:37:02 +02:00
commit d203a86900
Notes: sideshowbarker 2024-07-18 01:53:34 +09:00
3 changed files with 32 additions and 31 deletions

View file

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