-
Notifications
You must be signed in to change notification settings - Fork 2
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
[PRO-901] Add DG adoptedPromise
edge
#264
base: master
Are you sure you want to change the base?
[PRO-901] Add DG adoptedPromise
edge
#264
Conversation
Domiii
commented
Nov 19, 2024
•
edited
Loading
edited
- https://linear.app/replay/issue/PRO-901/add-nested-persistent-id-to-promisesettled-nodes
- paired w/
- DEPS (v8) chromium#1311
nested_persistent_id
adoptedPromise
edge
if (RecordReplayShouldCallOnPromiseHook() && reason->IsJSReceiver()) { | ||
AddPromiseDependencyGraphAdoption(isolate, Handle<Object>::cast(promise), reason); | ||
} |
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.
Is this needed? I'm not sure if my initial conclusion that it would be holds true 😅
@@ -4261,6 +4261,17 @@ GetOrCreatePromiseDependencyGraphData(Isolate* isolate, Handle<Object> promise) | |||
return iter->second; | |||
} | |||
|
|||
void AddPromiseDependencyGraphAdoption(Isolate* isolate, Handle<Object> promise, Handle<Object> adopted) { | |||
PromiseDependencyGraphData& data = GetOrCreatePromiseDependencyGraphData(isolate, promise); | |||
PromiseDependencyGraphData& adopted_data = GetOrCreatePromiseDependencyGraphData(isolate, adopted); |
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 it might, slightly, dilute what GetOrCreatePromiseDependencyGraphData
is about. By reading this code I'd think it would contain only promise IDs but that's not quite true as other objects could potentially be "registered" in it, right?
I also wonder if this whole thing can now generate a sensible graph when thenables are involved
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 agree with these concerns, GetOrCreatePromiseDependencyGraphData should only be used with promises. Things won't break if it's used with other objects, but the edges being created here seem fairly meaningless. I'd like a more detailed explanation of how this PR helps to be able to review it.
@@ -4261,6 +4261,17 @@ GetOrCreatePromiseDependencyGraphData(Isolate* isolate, Handle<Object> promise) | |||
return iter->second; | |||
} | |||
|
|||
void AddPromiseDependencyGraphAdoption(Isolate* isolate, Handle<Object> promise, Handle<Object> adopted) { | |||
PromiseDependencyGraphData& data = GetOrCreatePromiseDependencyGraphData(isolate, promise); | |||
PromiseDependencyGraphData& adopted_data = GetOrCreatePromiseDependencyGraphData(isolate, adopted); |
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 agree with these concerns, GetOrCreatePromiseDependencyGraphData should only be used with promises. Things won't break if it's used with other objects, but the edges being created here seem fairly meaningless. I'd like a more detailed explanation of how this PR helps to be able to review it.
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.
Ah sorry, I didn't see the more detailed explanation in the linear issue and discord.