Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d7cb4f702e95b491efe09e06dc12d8e93cb984e7
https://github.com/WebKit/WebKit/commit/d7cb4f702e95b491efe09e06dc12d8e93cb984e7
Author: Yusuke Suzuki <[email protected]>
Date: 2024-07-26 (Fri, 26 Jul 2024)
Changed paths:
M Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
M Source/JavaScriptCore/runtime/JSGlobalProxy.cpp
M Source/JavaScriptCore/runtime/Structure.cpp
M Source/JavaScriptCore/runtime/Structure.h
M Source/WebCore/bindings/js/JSWindowProxy.cpp
M Source/WebCore/workers/WorkerOrWorkletScriptController.cpp
Log Message:
-----------
[JSC] Fold UnwrapGlobalProxy
https://bugs.webkit.org/show_bug.cgi?id=277157
rdar://132588487
Reviewed by Yijia Huang.
This patch explicitly performs structure transition when
JSGlobalProxy::setTarget is executed to set the new JSGlobalObject to the
transitioned Structure's JSGlobalObject.
As a result, we can ensure that structure's JSGlobalObject is one-on-one (when
it changes, we do Structure transition).
1. This simplifies JSWindowProxy's implementation, avoiding setGlobalObject in
setWindow. Previously, we need some of these special code since it was JSProxy
and it can take
random JSObject. But now it is JSGlobalProxy and it only takes
JSGlobalObject. So we can just do transition in JSGlobalProxy::setTarget.
2. By using this one-on-one correspondence, we can do constnat folding in DFG
AI. When the given value's Structure is finite, we can retrieve JSGlobalObject
of the proxy.
ToT Patched
global-this-access-get 147.7507+-0.2280 ^ 143.6204+-3.0872
^ definitely 1.0288x faster
global-this-access-put 181.2328+-0.2776 ^ 177.8888+-0.3244
^ definitely 1.0188x faster
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* Source/JavaScriptCore/runtime/JSGlobalProxy.cpp:
(JSC::JSGlobalProxy::setTarget):
* Source/JavaScriptCore/runtime/Structure.cpp:
(JSC::Structure::changeGlobalProxyTargetTransition):
* Source/JavaScriptCore/runtime/Structure.h:
* Source/WebCore/bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::setWindow):
Canonical link: https://commits.webkit.org/281433@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes