diff --git a/Userland/Libraries/LibJS/Bytecode/Instruction.cpp b/Userland/Libraries/LibJS/Bytecode/Instruction.cpp index acbe0d7632..c67fe61d68 100644 --- a/Userland/Libraries/LibJS/Bytecode/Instruction.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Instruction.cpp @@ -25,22 +25,4 @@ void Instruction::destroy(Instruction& instruction) #undef __BYTECODE_OP } -size_t Instruction::length() const -{ - if (type() == Type::Call) - return static_cast(*this).length(); - else if (type() == Type::NewArray) - return static_cast(*this).length(); - -#define __BYTECODE_OP(op) \ - case Type::op: \ - return sizeof(Op::op); - - switch (type()) { - ENUMERATE_BYTECODE_OPS(__BYTECODE_OP) - default: - VERIFY_NOT_REACHED(); - } -} - } diff --git a/Userland/Libraries/LibJS/Bytecode/Op.h b/Userland/Libraries/LibJS/Bytecode/Op.h index bd7e82e5c6..a431d823bb 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.h +++ b/Userland/Libraries/LibJS/Bytecode/Op.h @@ -392,4 +392,23 @@ ALWAYS_INLINE void Instruction::execute(Bytecode::Interpreter& interpreter) cons #undef __BYTECODE_OP } +ALWAYS_INLINE size_t Instruction::length() const +{ + if (type() == Type::Call) + return static_cast(*this).length(); + else if (type() == Type::NewArray) + return static_cast(*this).length(); + +#define __BYTECODE_OP(op) \ + case Type::op: \ + return sizeof(Op::op); + + switch (type()) { + ENUMERATE_BYTECODE_OPS(__BYTECODE_OP) + default: + VERIFY_NOT_REACHED(); + } +#undef __BYTECODE_OP +} + }