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.
This commit is contained in:
Andreas Kling 2025-10-31 21:30:34 +01:00 committed by Andreas Kling
parent 5b9469786e
commit 8a02acbab6
2 changed files with 3 additions and 3 deletions

View File

@ -702,7 +702,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
Utf16FlyString const& Interpreter::get_identifier(IdentifierTableIndex index) const 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<Value> Interpreter::run_executable(ExecutionContext& context, Executable& executable, Optional<size_t> entry_point) ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context, Executable& executable, Optional<size_t> entry_point)
@ -715,7 +715,7 @@ ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context,
context.executable = executable; context.executable = executable;
context.global_object = realm().global_object(); context.global_object = realm().global_object();
context.global_declarative_environment = realm().global_environment().declarative_record(); 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()); ASSERT(executable.registers_and_constants_and_locals_count <= context.registers_and_constants_and_locals_and_arguments_span().size());

View File

@ -84,7 +84,7 @@ public:
Optional<size_t> scheduled_jump; Optional<size_t> scheduled_jump;
GC::Ptr<Object> global_object; GC::Ptr<Object> global_object;
GC::Ptr<DeclarativeEnvironment> global_declarative_environment; GC::Ptr<DeclarativeEnvironment> global_declarative_environment;
ReadonlySpan<Utf16FlyString> identifier_table; Utf16FlyString const* identifier_table { nullptr };
u32 program_counter { 0 }; u32 program_counter { 0 };