@@ -311,8 +311,8 @@ NEVER_INLINE Interpreter::HandleExceptionResponse Interpreter::handle_exception(
311311 auto & handler = handlers->handler_offset ;
312312 auto & finalizer = handlers->finalizer_offset ;
313313
314- VERIFY (! running_execution_context ().unwind_contexts . is_empty ()) ;
315- auto & unwind_context = running_execution_context (). unwind_contexts .last ();
314+ auto & unwind_contexts = running_execution_context ().ensure_rare_data ()-> unwind_contexts ;
315+ auto & unwind_context = unwind_contexts.last ();
316316 VERIFY (unwind_context.executable == ¤t_executable ());
317317
318318 if (handler.has_value ()) {
@@ -485,8 +485,8 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
485485 do_return (saved_return_value ());
486486 if (auto handlers = executable.exception_handlers_for_offset (program_counter); handlers.has_value ()) {
487487 if (auto finalizer = handlers.value ().finalizer_offset ; finalizer.has_value ()) {
488- VERIFY (! running_execution_context.unwind_contexts . is_empty ()) ;
489- auto & unwind_context = running_execution_context. unwind_contexts .last ();
488+ auto & unwind_contexts = running_execution_context.ensure_rare_data ()-> unwind_contexts ;
489+ auto & unwind_context = unwind_contexts.last ();
490490 VERIFY (unwind_context.executable == ¤t_executable ());
491491 reg (Register::saved_return_value ()) = reg (Register::return_value ());
492492 reg (Register::return_value ()) = js_special_empty_value ();
@@ -497,7 +497,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
497497 }
498498 return ;
499499 }
500- auto const old_scheduled_jump = running_execution_context.previously_scheduled_jumps .take_last ();
500+ auto const old_scheduled_jump = running_execution_context.ensure_rare_data ()-> previously_scheduled_jumps .take_last ();
501501 if (m_running_execution_context->scheduled_jump .has_value ()) {
502502 program_counter = m_running_execution_context->scheduled_jump .value ();
503503 m_running_execution_context->scheduled_jump = {};
@@ -762,23 +762,23 @@ ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context,
762762
763763void Interpreter::enter_unwind_context ()
764764{
765- running_execution_context ().unwind_contexts .empend (
765+ running_execution_context ().ensure_rare_data ()-> unwind_contexts .empend (
766766 current_executable (),
767767 running_execution_context ().lexical_environment );
768- running_execution_context ().previously_scheduled_jumps .append (m_running_execution_context->scheduled_jump );
768+ running_execution_context ().rare_data ()-> previously_scheduled_jumps .append (m_running_execution_context->scheduled_jump );
769769 m_running_execution_context->scheduled_jump = {};
770770}
771771
772772void Interpreter::leave_unwind_context ()
773773{
774- running_execution_context ().unwind_contexts .take_last ();
774+ running_execution_context ().rare_data ()-> unwind_contexts .take_last ();
775775}
776776
777777void Interpreter::catch_exception (Operand dst)
778778{
779779 set (dst, reg (Register::exception ()));
780780 reg (Register::exception ()) = js_special_empty_value ();
781- auto & context = running_execution_context ().unwind_contexts .last ();
781+ auto & context = running_execution_context ().rare_data ()-> unwind_contexts .last ();
782782 VERIFY (!context.handler_called );
783783 VERIFY (context.executable == ¤t_executable ());
784784 context.handler_called = true ;
@@ -787,19 +787,19 @@ void Interpreter::catch_exception(Operand dst)
787787
788788void Interpreter::restore_scheduled_jump ()
789789{
790- m_running_execution_context->scheduled_jump = running_execution_context ().previously_scheduled_jumps .take_last ();
790+ m_running_execution_context->scheduled_jump = running_execution_context ().rare_data ()-> previously_scheduled_jumps .take_last ();
791791}
792792
793793void Interpreter::leave_finally ()
794794{
795795 reg (Register::exception ()) = js_special_empty_value ();
796- m_running_execution_context->scheduled_jump = running_execution_context ().previously_scheduled_jumps .take_last ();
796+ m_running_execution_context->scheduled_jump = running_execution_context ().rare_data ()-> previously_scheduled_jumps .take_last ();
797797}
798798
799799void Interpreter::enter_object_environment (Object& object)
800800{
801801 auto & old_environment = running_execution_context ().lexical_environment ;
802- running_execution_context ().saved_lexical_environments .append (old_environment);
802+ running_execution_context ().ensure_rare_data ()-> saved_lexical_environments .append (old_environment);
803803 running_execution_context ().lexical_environment = new_object_environment (object, true , old_environment);
804804}
805805
@@ -1593,7 +1593,7 @@ inline ThrowCompletionOr<ECMAScriptFunctionObject*> new_class(VM& vm, Value supe
15931593
15941594 // NOTE: NewClass expects classEnv to be active lexical environment
15951595 auto * class_environment = vm.lexical_environment ();
1596- vm.running_execution_context ().lexical_environment = vm.running_execution_context ().saved_lexical_environments .take_last ();
1596+ vm.running_execution_context ().lexical_environment = vm.running_execution_context ().rare_data ()-> saved_lexical_environments .take_last ();
15971597
15981598 Optional<Utf16FlyString> binding_name;
15991599 Utf16FlyString class_name;
@@ -2416,7 +2416,7 @@ void CreateLexicalEnvironment::execute_impl(Bytecode::Interpreter& interpreter)
24162416 return environment;
24172417 };
24182418 auto & running_execution_context = interpreter.running_execution_context ();
2419- running_execution_context.saved_lexical_environments .append (make_and_swap_envs (running_execution_context.lexical_environment ));
2419+ running_execution_context.ensure_rare_data ()-> saved_lexical_environments .append (make_and_swap_envs (running_execution_context.lexical_environment ));
24202420 if (m_dst.has_value ())
24212421 interpreter.set (*m_dst, running_execution_context.lexical_environment );
24222422}
@@ -3161,7 +3161,7 @@ ThrowCompletionOr<void> ThrowIfTDZ::execute_impl(Bytecode::Interpreter& interpre
31613161void LeaveLexicalEnvironment::execute_impl (Bytecode::Interpreter& interpreter) const
31623162{
31633163 auto & running_execution_context = interpreter.running_execution_context ();
3164- running_execution_context.lexical_environment = running_execution_context.saved_lexical_environments .take_last ();
3164+ running_execution_context.lexical_environment = running_execution_context.rare_data ()-> saved_lexical_environments .take_last ();
31653165}
31663166
31673167void LeavePrivateEnvironment::execute_impl (Bytecode::Interpreter& interpreter) const
0 commit comments