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

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

This commit is contained in:
Andreas Kling 2021-10-25 13:37:02 +02:00
parent a97d75bb63
commit d203a86900
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;