summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Interpreter.cpp2
-rw-r--r--Userland/Libraries/LibJS/Interpreter.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/VM.h5
3 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
index 94c3e1e512..eb63d3f895 100644
--- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
@@ -141,6 +141,8 @@ Value Interpreter::run(Executable const& executable, BasicBlock const* entry_poi
if (vm().call_stack().size() == 1)
vm().pop_call_frame();
+ vm().finish_execution_generation();
+
return return_value;
}
diff --git a/Userland/Libraries/LibJS/Interpreter.cpp b/Userland/Libraries/LibJS/Interpreter.cpp
index 1c6ef8f73a..63acef125c 100644
--- a/Userland/Libraries/LibJS/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Interpreter.cpp
@@ -63,6 +63,8 @@ void Interpreter::run(GlobalObject& global_object, const Program& program)
// At this point we may have already run any queued promise jobs via on_call_stack_emptied,
// in which case this is a no-op.
vm.run_queued_promise_jobs();
+
+ vm.finish_execution_generation();
}
GlobalObject& Interpreter::global_object()
diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h
index 66e5544793..6f9f5de524 100644
--- a/Userland/Libraries/LibJS/Runtime/VM.h
+++ b/Userland/Libraries/LibJS/Runtime/VM.h
@@ -166,6 +166,9 @@ public:
bool underscore_is_last_value() const { return m_underscore_is_last_value; }
void set_underscore_is_last_value(bool b) { m_underscore_is_last_value = b; }
+ u32 execution_generation() const { return m_execution_generation; }
+ void finish_execution_generation() { ++m_execution_generation; }
+
void unwind(ScopeType type, FlyString label = {})
{
m_unwind_until = type;
@@ -279,6 +282,8 @@ private:
Shape* m_scope_object_shape { nullptr };
bool m_underscore_is_last_value { false };
+
+ u32 m_execution_generation { 0 };
};
template<>