-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[JSC] Fix GetButterfly handling in DFG array allocation sinking #47364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
EWS run on previous version of this PR (hash d98d524) |
EWS run on previous version of this PR (hash f0be5a6) |
https://bugs.webkit.org/show_bug.cgi?id=295191 rdar://154419571 Reviewed by NOBODY (OOPS!). When arrays are sunk and later materialized in DFG object allocation sinking, GetButterfly nodes that depend on those arrays were not properly updated to reference the materialized arrays, causing incorrect butterfly references. The fix tracks GetButterfly nodes as dependencies of array allocations and creates materialized GetButterfly nodes that reference the materialized arrays when arrays escape and need to be materialized.
EWS run on current version of this PR (hash 2c43384) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed offline with Yijia, and we think that we can make it simpler by introducing PhantomGetButterfly.
@@ -1030,14 +1030,17 @@ class ObjectAllocationSinkingPhase : public Phase { | |||
Node* base = node->child1().node(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's separate GetBufferfly
and GetArrayLength
handling, which makes code cleaner.
case GetButterfly {
...
break;
}
case GetArrayLength: {
...
break;
}
case GetButterfly: | ||
// GetButterfly nodes will be removed during DCE since they become unused | ||
// after materialization replacement. | ||
break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using PhantomGetButterfly
would be simpler. Then, without a special handling of dependency, we can just keep it in the phantom tree of creation.
if (escapee->op() != GetButterfly) | ||
populateMaterialization(block, materialization, escapee); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have PhantomGetButterfly
, you do not need to have this.
2c43384
2c43384