46
46
import com .oracle .graal .python .builtins .objects .frame .PFrame .Reference ;
47
47
import com .oracle .graal .python .builtins .objects .function .PArguments ;
48
48
import com .oracle .graal .python .nodes .IndirectCallNode ;
49
- import com .oracle .graal .python .nodes .PNodeWithRaiseAndIndirectCall ;
50
49
import com .oracle .graal .python .nodes .PRootNode ;
51
50
import com .oracle .graal .python .nodes .control .TopLevelExceptionHandler ;
52
51
import com .oracle .graal .python .nodes .frame .MaterializeFrameNode ;
@@ -355,7 +354,7 @@ public static Object enter(VirtualFrame frame, PythonLanguage language, PythonCo
355
354
return enter (frame , pythonThreadState , needsCallerFrame , needsExceptionState , callNode );
356
355
}
357
356
358
- public static Object enter (VirtualFrame frame , PNodeWithRaiseAndIndirectCall indirectCallNode ) {
357
+ public static < T extends Node & IndirectCallNode > Object enter (VirtualFrame frame , T indirectCallNode ) {
359
358
if (frame == null || indirectCallNode == null ) {
360
359
return null ;
361
360
}
@@ -365,7 +364,7 @@ public static Object enter(VirtualFrame frame, PNodeWithRaiseAndIndirectCall ind
365
364
return null ;
366
365
}
367
366
368
- PythonThreadState pythonThreadState = indirectCallNode . getContext ( ).getThreadState (indirectCallNode . getLanguage ( ));
367
+ PythonThreadState pythonThreadState = PythonContext . get ( indirectCallNode ).getThreadState (PythonLanguage . get ( indirectCallNode ));
369
368
return enter (frame , pythonThreadState , needsCallerFrame , needsExceptionState , indirectCallNode );
370
369
}
371
370
@@ -414,11 +413,11 @@ public static void exit(VirtualFrame frame, PythonLanguage language, PythonConte
414
413
assert savedState == null : "tried to exit an indirect call with state, but without frame/context" ;
415
414
}
416
415
417
- public static void exit (VirtualFrame frame , PNodeWithRaiseAndIndirectCall indirectCallNode , Object savedState ) {
416
+ public static < T extends Node & IndirectCallNode > void exit (VirtualFrame frame , T indirectCallNode , Object savedState ) {
418
417
if (savedState != null && frame != null ) {
419
- PythonContext context = indirectCallNode . getContext ( );
418
+ PythonContext context = PythonContext . get ( indirectCallNode );
420
419
if (context != null ) {
421
- PythonLanguage language = indirectCallNode . getLanguage ( );
420
+ PythonLanguage language = PythonLanguage . get ( indirectCallNode );
422
421
exit (frame , context .getThreadState (language ), savedState );
423
422
return ;
424
423
}
0 commit comments