1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

LibJS: Rename InterpreterScope => InterpreterExecutionScope

To make it a little clearer what this is for. (This is an RAII helper
class for adding and removing an Interpreter to a VM's list of the
currently active (executing code) Interpreters.)
This commit is contained in:
Andreas Kling 2020-09-21 13:36:32 +02:00
parent b7ce0680dd
commit df3ff76815
7 changed files with 11 additions and 11 deletions

View file

@ -60,7 +60,7 @@ Interpreter::~Interpreter()
Value Interpreter::run(GlobalObject& global_object, const Program& program)
{
VM::InterpreterScope scope(*this);
VM::InterpreterExecutionScope scope(*this);
ASSERT(!exception());
@ -253,7 +253,7 @@ Value Interpreter::call_internal(Function& function, Value this_value, Optional<
{
ASSERT(!exception());
VM::InterpreterScope scope(*this);
VM::InterpreterExecutionScope scope(*this);
auto& call_frame = push_call_frame();
call_frame.function_name = function.name();

View file

@ -81,7 +81,7 @@ public:
{
DeferGC defer_gc(vm.heap());
auto interpreter = adopt_own(*new Interpreter(vm));
VM::InterpreterScope scope(*interpreter);
VM::InterpreterExecutionScope scope(*interpreter);
interpreter->m_global_object = make_handle(static_cast<Object*>(interpreter->heap().allocate_without_global_object<GlobalObjectType>(forward<Args>(args)...)));
static_cast<GlobalObjectType*>(interpreter->m_global_object.cell())->initialize();
return interpreter;

View file

@ -71,13 +71,13 @@ void VM::pop_interpreter(Interpreter& interpreter)
ASSERT(popped_interpreter == &interpreter);
}
VM::InterpreterScope::InterpreterScope(Interpreter& interpreter)
VM::InterpreterExecutionScope::InterpreterExecutionScope(Interpreter& interpreter)
: m_interpreter(interpreter)
{
m_interpreter.vm().push_interpreter(m_interpreter);
}
VM::InterpreterScope::~InterpreterScope()
VM::InterpreterExecutionScope::~InterpreterExecutionScope()
{
m_interpreter.vm().pop_interpreter(m_interpreter);
}

View file

@ -45,10 +45,10 @@ public:
void push_interpreter(Interpreter&);
void pop_interpreter(Interpreter&);
class InterpreterScope {
class InterpreterExecutionScope {
public:
InterpreterScope(Interpreter&);
~InterpreterScope();
InterpreterExecutionScope(Interpreter&);
~InterpreterExecutionScope();
private:
Interpreter& m_interpreter;
};