mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibJS/Bytecode: Extract code to generate a super reference to a helper
This code is already repeated twice, and would be repeated a third time for the `delete` operator.
This commit is contained in:
parent
d5ca51b461
commit
0d50e5eeee
Notes:
sideshowbarker
2024-07-17 09:49:33 +09:00
Author: https://github.com/trflynn89
Commit: 0d50e5eeee
Pull-request: https://github.com/SerenityOS/serenity/pull/19857
2 changed files with 56 additions and 61 deletions
|
@ -83,6 +83,13 @@ public:
|
|||
CodeGenerationErrorOr<void> emit_store_to_reference(JS::ASTNode const&);
|
||||
CodeGenerationErrorOr<void> emit_delete_reference(JS::ASTNode const&);
|
||||
|
||||
struct ReferenceRegisters {
|
||||
Register base; // [[Base]]
|
||||
Optional<Bytecode::Register> referenced_name; // [[ReferencedName]]
|
||||
Register this_value; // [[ThisValue]]
|
||||
};
|
||||
CodeGenerationErrorOr<ReferenceRegisters> emit_super_reference(MemberExpression const&);
|
||||
|
||||
void emit_set_variable(JS::Identifier const& identifier, Bytecode::Op::SetVariable::InitializationMode initialization_mode = Bytecode::Op::SetVariable::InitializationMode::Set, Bytecode::Op::EnvironmentMode mode = Bytecode::Op::EnvironmentMode::Lexical);
|
||||
|
||||
void push_home_object(Register);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue