|
128 | 128 | import com.oracle.graal.python.nodes.subscript.DeleteItemNode;
|
129 | 129 | import com.oracle.graal.python.nodes.subscript.GetItemNode;
|
130 | 130 | import com.oracle.graal.python.nodes.util.CastToJavaIntExactNode;
|
| 131 | +import com.oracle.graal.python.nodes.util.ExceptionStateNodes; |
131 | 132 | import com.oracle.graal.python.parser.GeneratorInfo;
|
132 | 133 | import com.oracle.graal.python.runtime.ExecutionContext.CalleeContext;
|
133 | 134 | import com.oracle.graal.python.runtime.PythonContext;
|
@@ -382,6 +383,7 @@ public final class PBytecodeRootNode extends PRootNode implements BytecodeOSRNod
|
382 | 383 | @Children private final Node[] adoptedNodes;
|
383 | 384 | @Child private CalleeContext calleeContext = CalleeContext.create();
|
384 | 385 | @Child private PythonObjectFactory factory = PythonObjectFactory.create();
|
| 386 | + @Child private ExceptionStateNodes.GetCaughtExceptionNode getCaughtExceptionNode; |
385 | 387 | @CompilationFinal private LoopConditionProfile exceptionChainProfile1 = LoopConditionProfile.createCountingProfile();
|
386 | 388 | @CompilationFinal private LoopConditionProfile exceptionChainProfile2 = LoopConditionProfile.createCountingProfile();
|
387 | 389 | @CompilationFinal private Object osrMetadata;
|
@@ -1373,7 +1375,11 @@ Object executeFromBci(VirtualFrame virtualFrame, Frame localFrame, Frame stackFr
|
1373 | 1375 | }
|
1374 | 1376 | long newTarget = findHandler(bci);
|
1375 | 1377 | CompilerAsserts.partialEvaluationConstant(newTarget);
|
1376 |
| - PException exceptionState = PArguments.getException(virtualFrame); |
| 1378 | + if (getCaughtExceptionNode == null) { |
| 1379 | + CompilerDirectives.transferToInterpreterAndInvalidate(); |
| 1380 | + getCaughtExceptionNode = ExceptionStateNodes.GetCaughtExceptionNode.create(); |
| 1381 | + } |
| 1382 | + PException exceptionState = getCaughtExceptionNode.execute(virtualFrame); |
1377 | 1383 | if (exceptionState != null) {
|
1378 | 1384 | ExceptionHandlingStatementNode.chainExceptions(pe.getUnreifiedException(), exceptionState, exceptionChainProfile1, exceptionChainProfile2);
|
1379 | 1385 | }
|
|
0 commit comments