Skip to content

Commit 8a02acb

Browse files
committed
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.
1 parent 5b94697 commit 8a02acb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Libraries/LibJS/Bytecode/Interpreter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
702702

703703
Utf16FlyString const& Interpreter::get_identifier(IdentifierTableIndex index) const
704704
{
705-
return m_running_execution_context->identifier_table.data()[index.value];
705+
return m_running_execution_context->identifier_table[index.value];
706706
}
707707

708708
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,
715715
context.executable = executable;
716716
context.global_object = realm().global_object();
717717
context.global_declarative_environment = realm().global_environment().declarative_record();
718-
context.identifier_table = executable.identifier_table->identifiers();
718+
context.identifier_table = executable.identifier_table->identifiers().data();
719719

720720
ASSERT(executable.registers_and_constants_and_locals_count <= context.registers_and_constants_and_locals_and_arguments_span().size());
721721

Libraries/LibJS/Runtime/ExecutionContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct JS_API ExecutionContext {
8484
Optional<size_t> scheduled_jump;
8585
GC::Ptr<Object> global_object;
8686
GC::Ptr<DeclarativeEnvironment> global_declarative_environment;
87-
ReadonlySpan<Utf16FlyString> identifier_table;
87+
Utf16FlyString const* identifier_table { nullptr };
8888

8989
u32 program_counter { 0 };
9090

0 commit comments

Comments
 (0)