mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
LibJS: Add new operand type for function arguments
This allows us to directly access passed arguments instead of copying them to register/local first using GetArgument instruction.
This commit is contained in:
parent
81a3bfd492
commit
3f04d18ef7
Notes:
github-actions[bot]
2025-04-26 09:03:30 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 3f04d18ef7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4481
7 changed files with 27 additions and 93 deletions
|
@ -49,11 +49,11 @@ public:
|
|||
ALWAYS_INLINE Value& saved_return_value() { return reg(Register::saved_return_value()); }
|
||||
Value& reg(Register const& r)
|
||||
{
|
||||
return m_registers_and_constants_and_locals.data()[r.index()];
|
||||
return m_registers_and_constants_and_locals_arguments.data()[r.index()];
|
||||
}
|
||||
Value reg(Register const& r) const
|
||||
{
|
||||
return m_registers_and_constants_and_locals.data()[r.index()];
|
||||
return m_registers_and_constants_and_locals_arguments.data()[r.index()];
|
||||
}
|
||||
|
||||
[[nodiscard]] Value get(Operand) const;
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
GC::Ptr<Object> m_global_object { nullptr };
|
||||
GC::Ptr<DeclarativeEnvironment> m_global_declarative_environment { nullptr };
|
||||
Optional<size_t&> m_program_counter;
|
||||
Span<Value> m_registers_and_constants_and_locals;
|
||||
Span<Value> m_registers_and_constants_and_locals_arguments;
|
||||
Vector<Value> m_argument_values_buffer;
|
||||
ExecutionContext* m_running_execution_context { nullptr };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue