diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode/Instruction.h')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/Instruction.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Instruction.h b/Userland/Libraries/LibJS/Bytecode/Instruction.h index b38ed0b804..1b7286eea8 100644 --- a/Userland/Libraries/LibJS/Bytecode/Instruction.h +++ b/Userland/Libraries/LibJS/Bytecode/Instruction.h @@ -7,7 +7,6 @@ #pragma once #include <AK/Forward.h> -#include <LibJS/Bytecode/Block.h> #include <LibJS/Forward.h> #define ENUMERATE_BYTECODE_OPS(O) \ @@ -84,45 +83,4 @@ private: Type m_type {}; }; -template<typename OpType> -class InstructionHandle { -public: - InstructionHandle() = default; - - InstructionHandle(size_t offset, Block* block) - : m_offset(offset) - , m_block(block) - { - } - - OpType* operator->() const - { - VERIFY(m_block); - return reinterpret_cast<OpType*>(m_block->buffer().data() + m_offset); - } - - OpType& operator*() const - { - VERIFY(m_block); - return *reinterpret_cast<OpType*>(m_block->buffer().data() + m_offset); - } - - template<typename T> - InstructionHandle<OpType>& operator=(InstructionHandle<T> const& other) requires(IsBaseOf<OpType, T>) - { - m_offset = other.offset(); - m_block = other.block(); - return *this; - } - - size_t offset() const { return m_offset; } - Block* block() const { return m_block; } - -private: - friend class Block; - - size_t m_offset { 0 }; - Block* m_block { nullptr }; -}; - } |