@@ -66,7 +66,7 @@ private void executeBoundary(DynamicObject object, Object value, boolean general
66
66
public void writeExistingField (DynamicObject object , Object value , boolean generalize ,
67
67
@ Cached ("getLocation(object, value)" ) Location location ,
68
68
@ Cached ("object.getShape()" ) Shape cachedShape ,
69
- @ Cached ("createAssumption(cachedShape)" ) Assumption validLocation ,
69
+ @ Cached ("createAssumption(cachedShape, location )" ) Assumption validLocation ,
70
70
@ Cached ("isShared(cachedShape)" ) boolean shared ,
71
71
@ Cached ("createWriteBarrierNode(shared)" ) WriteBarrierNode writeBarrierNode ,
72
72
@ Cached ("createProfile(shared)" ) BranchProfile shapeRaceProfile ) {
@@ -114,7 +114,7 @@ public void writeNewField(DynamicObject object, Object value, boolean generalize
114
114
@ Cached ("object.getShape()" ) Shape oldShape ,
115
115
@ Cached ("defineProperty(oldShape, value, generalize)" ) Shape newShape ,
116
116
@ Cached ("getNewLocation(newShape)" ) Location newLocation ,
117
- @ Cached ("createAssumption(oldShape)" ) Assumption validLocation ,
117
+ @ Cached ("createAssumption(oldShape, newLocation )" ) Assumption validLocation ,
118
118
@ Cached ("isShared(oldShape)" ) boolean shared ,
119
119
@ Cached ("createWriteBarrierNode(shared)" ) WriteBarrierNode writeBarrierNode ,
120
120
@ Cached ("createProfile(shared)" ) BranchProfile shapeRaceProfile ) {
@@ -196,7 +196,9 @@ protected Location getNewLocation(Shape newShape) {
196
196
return newShape .getProperty (name ).getLocation ();
197
197
}
198
198
199
- protected Assumption createAssumption (Shape shape ) {
199
+ // The location is passed here even though it's not used,
200
+ // to make sure the DSL checks this Assumption after all lookups are done in executeAndSpecialize().
201
+ protected Assumption createAssumption (Shape shape , Location location ) {
200
202
if (!shape .isValid ()) {
201
203
return NeverValidAssumption .INSTANCE ;
202
204
}
0 commit comments