summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Bytecode
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-08-21 19:24:32 +0100
committerLinus Groh <mail@linusgroh.de>2022-08-23 13:58:30 +0100
commit25849f8a6daf6c73e11851e94aa3edeb00190d01 (patch)
treecb7e78ca5e0153a9695792ee54e976462e93bdc6 /Userland/Libraries/LibJS/Bytecode
parent7856886ed5953e35a210c2b95cb9fdc8d3bb0c60 (diff)
downloadserenity-25849f8a6daf6c73e11851e94aa3edeb00190d01.zip
LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp
index 566b7ef1aa..2a41865bc0 100644
--- a/Userland/Libraries/LibJS/Bytecode/Op.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp
@@ -492,27 +492,29 @@ ThrowCompletionOr<void> JumpUndefined::execute_impl(Bytecode::Interpreter& inter
ThrowCompletionOr<void> Call::execute_impl(Bytecode::Interpreter& interpreter) const
{
+ auto& vm = interpreter.vm();
+
auto callee = interpreter.reg(m_callee);
if (m_type == CallType::Call && !callee.is_function())
- return interpreter.vm().throw_completion<TypeError>(ErrorType::IsNotA, callee.to_string_without_side_effects(), "function"sv);
+ return vm.throw_completion<TypeError>(ErrorType::IsNotA, callee.to_string_without_side_effects(), "function"sv);
if (m_type == CallType::Construct && !callee.is_constructor())
- return interpreter.vm().throw_completion<TypeError>(ErrorType::IsNotA, callee.to_string_without_side_effects(), "constructor"sv);
+ return vm.throw_completion<TypeError>(ErrorType::IsNotA, callee.to_string_without_side_effects(), "constructor"sv);
auto& function = callee.as_function();
auto this_value = interpreter.reg(m_this_value);
- MarkedVector<Value> argument_values { interpreter.vm().heap() };
+ MarkedVector<Value> argument_values { vm.heap() };
for (size_t i = 0; i < m_argument_count; ++i)
argument_values.append(interpreter.reg(m_arguments[i]));
Value return_value;
if (m_type == CallType::Call)
- return_value = TRY(call(interpreter.global_object(), function, this_value, move(argument_values)));
+ return_value = TRY(call(vm, function, this_value, move(argument_values)));
else
- return_value = TRY(construct(interpreter.global_object(), function, move(argument_values)));
+ return_value = TRY(construct(vm, function, move(argument_values)));
interpreter.accumulator() = return_value;
return {};