From 8a02acbab636f6cf426029e5124d72143c8097b6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 31 Oct 2025 21:30:34 +0100 Subject: [PATCH] LibJS: Make ExecutionContext::identifier_table a raw pointer We were already skipping the bounds checks on this thing anyway, so might as well shrink ExecutionContext by 8 bytes by doing this. --- Libraries/LibJS/Bytecode/Interpreter.cpp | 4 ++-- Libraries/LibJS/Runtime/ExecutionContext.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibJS/Bytecode/Interpreter.cpp b/Libraries/LibJS/Bytecode/Interpreter.cpp index df1d861029..1d0a684b86 100644 --- a/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -702,7 +702,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point) Utf16FlyString const& Interpreter::get_identifier(IdentifierTableIndex index) const { - return m_running_execution_context->identifier_table.data()[index.value]; + return m_running_execution_context->identifier_table[index.value]; } ThrowCompletionOr Interpreter::run_executable(ExecutionContext& context, Executable& executable, Optional entry_point) @@ -715,7 +715,7 @@ ThrowCompletionOr Interpreter::run_executable(ExecutionContext& context, context.executable = executable; context.global_object = realm().global_object(); context.global_declarative_environment = realm().global_environment().declarative_record(); - context.identifier_table = executable.identifier_table->identifiers(); + context.identifier_table = executable.identifier_table->identifiers().data(); ASSERT(executable.registers_and_constants_and_locals_count <= context.registers_and_constants_and_locals_and_arguments_span().size()); diff --git a/Libraries/LibJS/Runtime/ExecutionContext.h b/Libraries/LibJS/Runtime/ExecutionContext.h index 9abc4e0577..f42c4d2a33 100644 --- a/Libraries/LibJS/Runtime/ExecutionContext.h +++ b/Libraries/LibJS/Runtime/ExecutionContext.h @@ -84,7 +84,7 @@ public: Optional scheduled_jump; GC::Ptr global_object; GC::Ptr global_declarative_environment; - ReadonlySpan identifier_table; + Utf16FlyString const* identifier_table { nullptr }; u32 program_counter { 0 };