-
Notifications
You must be signed in to change notification settings - Fork 425
Make explicit which path conditions apply to a Generator #2224
Conversation
@@ -43,7 +43,8 @@ function joinGenerators( | |||
generator1: Generator, | |||
generator2: Generator | |||
): Generator { | |||
let result = new Generator(realm, "joined"); | |||
// TODO #2222: Check if `realm.pathConditions` is correct here. |
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.
It is correct. The path conditions are restored when evaluateNodeForEffects returns, so the path would be whatever it was when the fork (that is now being joined) has occurred.
src/methods/widen.js
Outdated
@@ -97,7 +97,8 @@ export class WidenImplementation { | |||
e2.createdObjects | |||
); | |||
let createdObjects = new Set(); // Top, since the empty set knows nothing. There is no other choice for widen. | |||
let generator = new Generator(realm, "widen"); // code subject to widening will be generated somewhere else | |||
// TODO #2222: Check if `realm.pathConditions` is correct here. |
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.
It is correct here for the same reason as above.
src/realm.js
Outdated
@@ -195,7 +195,14 @@ export function construct_empty_effects( | |||
realm: Realm, | |||
c: Completion = new SimpleNormalCompletion(realm.intrinsics.empty) | |||
): Effects { | |||
return new Effects(c, new Generator(realm, "construct_empty_effects"), new Map(), new Map(), new Set()); | |||
// TODO #2222: Check if `realm.pathConditions` is always correct here. Consider making it a required parameter. |
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.
The path conditions here should probably be empty. Picking up the current path conditions from the Realm might be the reason why composition does not work.
Release notes: None It used to be a case that the Generator constructor simply harvested whatever was currently set in the realm as the current path condition. This makes it explicit, and fixes some places where likely the wrong path condition was picked up. At least one place caused an issue in InstantRender that is now fixed (but I couldn't extract a small repro). Leaving behind a number of `TODO #2222`s in the code to review once more.
Still leaving behind some #2222 TODOs for further investigation.
c946d93
to
b16f7b8
Compare
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.
@NTillmann is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Release notes: None
It used to be a case that the Generator constructor simply
harvested whatever was currently set in the realm as the current
path condition.
This makes it explicit, and fixes some places where likely the wrong
path condition was picked up. At least one place caused an issue in
InstantRender that is now fixed (but I couldn't extract a small repro).
Leaving behind a number of
TODO #2222
s in the code to review once more.