mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS: Remove effectively unused value span from ExecutionContext
Instead of using this span, we can just use the getter that calculates the base of the register/constant/local/argument array based on the ExecutionContext's own address.
This commit is contained in:
parent
e1344afff3
commit
75d49c4b55
Notes:
github-actions[bot]
2025-11-01 07:42:03 +00:00
Author: https://github.com/awesomekling
Commit: 75d49c4b55
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6657
3 changed files with 4 additions and 7 deletions
|
|
@ -167,12 +167,12 @@ Interpreter::~Interpreter()
|
||||||
|
|
||||||
ALWAYS_INLINE Value Interpreter::get(Operand op) const
|
ALWAYS_INLINE Value Interpreter::get(Operand op) const
|
||||||
{
|
{
|
||||||
return m_running_execution_context->registers_and_constants_and_locals_arguments.data()[op.index()];
|
return m_running_execution_context->registers_and_constants_and_locals_and_arguments()[op.index()];
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE void Interpreter::set(Operand op, Value value)
|
ALWAYS_INLINE void Interpreter::set(Operand op, Value value)
|
||||||
{
|
{
|
||||||
m_running_execution_context->registers_and_constants_and_locals_arguments.data()[op.index()] = value;
|
m_running_execution_context->registers_and_constants_and_locals_and_arguments()[op.index()] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE Value Interpreter::do_yield(Value value, Optional<Label> continuation)
|
ALWAYS_INLINE Value Interpreter::do_yield(Value value, Optional<Label> continuation)
|
||||||
|
|
@ -716,8 +716,6 @@ ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context,
|
||||||
|
|
||||||
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());
|
||||||
|
|
||||||
context.registers_and_constants_and_locals_arguments = context.registers_and_constants_and_locals_and_arguments_span();
|
|
||||||
|
|
||||||
reg(Register::accumulator()) = initial_accumulator_value;
|
reg(Register::accumulator()) = initial_accumulator_value;
|
||||||
|
|
||||||
// NOTE: We only copy the `this` value from ExecutionContext if it's not already set.
|
// NOTE: We only copy the `this` value from ExecutionContext if it's not already set.
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,11 @@ public:
|
||||||
ALWAYS_INLINE Value& saved_return_value() { return reg(Register::saved_return_value()); }
|
ALWAYS_INLINE Value& saved_return_value() { return reg(Register::saved_return_value()); }
|
||||||
Value& reg(Register const& r)
|
Value& reg(Register const& r)
|
||||||
{
|
{
|
||||||
return m_running_execution_context->registers_and_constants_and_locals_arguments.data()[r.index()];
|
return m_running_execution_context->registers_and_constants_and_locals_and_arguments()[r.index()];
|
||||||
}
|
}
|
||||||
Value reg(Register const& r) const
|
Value reg(Register const& r) const
|
||||||
{
|
{
|
||||||
return m_running_execution_context->registers_and_constants_and_locals_arguments.data()[r.index()];
|
return m_running_execution_context->registers_and_constants_and_locals_and_arguments()[r.index()];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Value get(Operand) const;
|
[[nodiscard]] Value get(Operand) const;
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ 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;
|
||||||
Span<Value> registers_and_constants_and_locals_arguments;
|
|
||||||
ReadonlySpan<Utf16FlyString> identifier_table;
|
ReadonlySpan<Utf16FlyString> identifier_table;
|
||||||
|
|
||||||
u32 program_counter { 0 };
|
u32 program_counter { 0 };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue