1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:08:11 +00:00

LibJS: Implement the NewClass opcode

This commit is contained in:
Ali Mohammad Pur 2022-02-11 22:38:21 +03:30 committed by Linus Groh
parent 8b27917603
commit d7c207beb9
4 changed files with 23 additions and 4 deletions

View file

@ -10,6 +10,7 @@
#include <LibJS/Bytecode/Instruction.h>
#include <LibJS/Bytecode/Interpreter.h>
#include <LibJS/Bytecode/Op.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/GlobalEnvironment.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Realm.h>
@ -193,6 +194,14 @@ ThrowCompletionOr<void> Interpreter::continue_pending_unwind(Label const& resume
return {};
}
VM::InterpreterExecutionScope Interpreter::ast_interpreter_scope()
{
if (!m_ast_interpreter)
m_ast_interpreter = JS::Interpreter::create_with_existing_realm(m_realm);
return { *m_ast_interpreter };
}
AK::Array<OwnPtr<PassManager>, static_cast<UnderlyingType<Interpreter::OptimizationLevel>>(Interpreter::OptimizationLevel::__Count)> Interpreter::s_optimization_pipelines {};
Bytecode::PassManager& Interpreter::optimization_pipeline(Interpreter::OptimizationLevel level)