mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Let invokers (callers) of [[Call]] allocate ExecutionContext
Instead of letting every [[Call]] implementation allocate an ExecutionContext, we now make that a responsibility of the caller. The main point of this exercise is to allow the Call instruction to write function arguments directly into the callee ExecutionContext instead of copying them later. This makes function calls significantly faster: - 10-20% faster on micro-benchmarks (depending on argument count) - 4% speedup on Kraken - 2% speedup on Octane - 5% speedup on JetStream
This commit is contained in:
committed by
Andreas Kling
parent
93788f8057
commit
a05be67e4a
Notes:
github-actions[bot]
2025-04-27 23:24:56 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/a05be67e4ae Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4497 Reviewed-by: https://github.com/Hendiadyoin1
@@ -92,7 +92,7 @@ static JS::ThrowCompletionOr<JS::Value> execute_a_function_body(HTML::BrowsingCo
|
||||
// 9. Let completion be Function.[[Call]](window, parameters) with function as the this value.
|
||||
// NOTE: This is not entirely clear, but I don't think they mean actually passing `function` as
|
||||
// the this value argument, but using it as the object [[Call]] is executed on.
|
||||
auto completion = function->internal_call(window, parameters);
|
||||
auto completion = JS::call(realm.vm(), *function, window, parameters);
|
||||
|
||||
// 10. Clean up after running a callback with environment settings.
|
||||
HTML::clean_up_after_running_callback(realm);
|
||||
|
||||
Reference in New Issue
Block a user