mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
LibJS: Optimize reading known-to-be-initialized var
bindings
`var` bindings are never in the temporal dead zone (TDZ), and so we know accessing them will not throw. We now take advantage of this by having a specialized environment binding value getter that doesn't check for exceptional cases. 1.08x speedup on JetStream.
This commit is contained in:
parent
ad7c1e147f
commit
bf1b754e91
Notes:
github-actions[bot]
2025-05-04 00:32:11 +00:00
Author: https://github.com/awesomekling
Commit: bf1b754e91
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4588
8 changed files with 90 additions and 15 deletions
|
@ -59,6 +59,7 @@ public:
|
|||
ThrowCompletionOr<void> initialize_binding_direct(VM&, size_t index, Value, InitializeBindingHint);
|
||||
ThrowCompletionOr<void> set_mutable_binding_direct(VM&, size_t index, Value, bool strict);
|
||||
ThrowCompletionOr<Value> get_binding_value_direct(VM&, size_t index) const;
|
||||
Value get_initialized_binding_value_direct(size_t index) const { return m_bindings[index].value; }
|
||||
|
||||
void shrink_to_fit();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue