@@ -145,7 +145,7 @@ static PFrame freshPFrameInClassBody(VirtualFrame frame, Node location, boolean
145
145
*
146
146
* @see PFrame#isIncomplete
147
147
**/
148
- @ Specialization (guards = {"getPFrame(frameToMaterialize) != null" , "!getPFrame(frameToMaterialize).hasFrame ()" })
148
+ @ Specialization (guards = {"getPFrame(frameToMaterialize) != null" , "!getPFrame(frameToMaterialize).isAssociated ()" })
149
149
static PFrame incompleteFrame (VirtualFrame frame , Node location , boolean markAsEscaped , boolean forceSync , Frame frameToMaterialize ,
150
150
@ Shared ("factory" ) @ Cached ("createFactory()" ) PythonObjectFactory factory ,
151
151
@ Shared ("syncValuesNode" ) @ Cached ("createSyncNode()" ) SyncFrameValuesNode syncValuesNode ) {
@@ -154,7 +154,7 @@ static PFrame incompleteFrame(VirtualFrame frame, Node location, boolean markAsE
154
154
return doEscapeFrame (frame , frameToMaterialize , escapedFrame , markAsEscaped , forceSync && !inModuleRoot (location ), syncValuesNode );
155
155
}
156
156
157
- @ Specialization (guards = {"getPFrame(frameToMaterialize) != null" , "getPFrame(frameToMaterialize).hasFrame ()" }, replaces = "freshPFrame" )
157
+ @ Specialization (guards = {"getPFrame(frameToMaterialize) != null" , "getPFrame(frameToMaterialize).isAssociated ()" }, replaces = "freshPFrame" )
158
158
static PFrame alreadyEscapedFrame (VirtualFrame frame , Node location , boolean markAsEscaped , boolean forceSync , Frame frameToMaterialize ,
159
159
@ Shared ("syncValuesNode" ) @ Cached ("createSyncNode()" ) SyncFrameValuesNode syncValuesNode ,
160
160
@ Cached ("createBinaryProfile()" ) ConditionProfile syncProfile ) {
@@ -170,16 +170,23 @@ static PFrame alreadyEscapedFrame(VirtualFrame frame, Node location, boolean mar
170
170
return pyFrame ;
171
171
}
172
172
173
- @ Specialization (replaces = {"freshPFrame" , "alreadyEscapedFrame" })
174
- static PFrame notInClassBody (VirtualFrame frame , Node location , boolean markAsEscaped , boolean forceSync , Frame frameToMaterialize ,
173
+ @ Specialization (replaces = {"freshPFrame" , "alreadyEscapedFrame" , "incompleteFrame" })
174
+ static PFrame generic (VirtualFrame frame , Node location , boolean markAsEscaped , boolean forceSync , Frame frameToMaterialize ,
175
175
@ Shared ("factory" ) @ Cached ("createFactory()" ) PythonObjectFactory factory ,
176
176
@ Shared ("syncValuesNode" ) @ Cached ("createSyncNode()" ) SyncFrameValuesNode syncValuesNode ,
177
177
@ Cached ("createBinaryProfile()" ) ConditionProfile syncProfile ) {
178
- if (getPFrame (frameToMaterialize ) != null ) {
179
- return alreadyEscapedFrame (frame , location , markAsEscaped , forceSync , frameToMaterialize , syncValuesNode , syncProfile );
178
+ PFrame pyFrame = getPFrame (frameToMaterialize );
179
+ if (pyFrame != null ) {
180
+ if (pyFrame .isAssociated ()) {
181
+ return alreadyEscapedFrame (frame , location , markAsEscaped , forceSync , frameToMaterialize , syncValuesNode , syncProfile );
182
+ } else {
183
+ return incompleteFrame (frame , location , markAsEscaped , forceSync , frameToMaterialize , factory , syncValuesNode );
184
+ }
180
185
} else {
181
186
if (inClassBody (frameToMaterialize )) {
182
187
return freshPFrameInClassBody (frame , location , markAsEscaped , forceSync , frameToMaterialize , factory , syncValuesNode );
188
+ } else if (isGeneratorFrame (frameToMaterialize )) {
189
+ return freshPFrameForGenerator (location , markAsEscaped , forceSync , frameToMaterialize , factory );
183
190
} else {
184
191
return freshPFrame (frame , location , markAsEscaped , forceSync , frameToMaterialize , factory , syncValuesNode );
185
192
}
0 commit comments