mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
LibJS: Remove redundant Store op
If the property for GetByValue in Generator::load_from_reference is a calculated value this would be stored in an allocated register and returned from the function. Not all callers want this information however, so now only give it out when asked for. Reduced the instruction count for Kraken/ai-astar.js function "neighbours" from 214 to 192.
This commit is contained in:
parent
13726fd3b7
commit
bb9230bbcd
3 changed files with 21 additions and 12 deletions
|
@ -98,7 +98,11 @@ public:
|
|||
Register this_value; // [[ThisValue]]
|
||||
};
|
||||
|
||||
CodeGenerationErrorOr<Optional<ReferenceRegisters>> emit_load_from_reference(JS::ASTNode const&);
|
||||
enum class CollectRegisters {
|
||||
Yes,
|
||||
No
|
||||
};
|
||||
CodeGenerationErrorOr<Optional<ReferenceRegisters>> emit_load_from_reference(JS::ASTNode const&, CollectRegisters);
|
||||
CodeGenerationErrorOr<void> emit_store_to_reference(JS::ASTNode const&);
|
||||
CodeGenerationErrorOr<void> emit_store_to_reference(ReferenceRegisters const&);
|
||||
CodeGenerationErrorOr<void> emit_delete_reference(JS::ASTNode const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue