Skip to content

Commit cf0b692

Browse files
committed
[GR-50465] Fix performance regression in micro.try-except-simple
PullRequest: graalpython/3087
2 parents 2868dee + ce02518 commit cf0b692

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/IndirectCallData.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
package com.oracle.graal.python.runtime;
4242

4343
import com.oracle.graal.python.PythonLanguage;
44+
import com.oracle.graal.python.nodes.call.InvokeNode;
4445
import com.oracle.truffle.api.Assumption;
4546
import com.oracle.truffle.api.CompilerDirectives;
4647
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
@@ -103,6 +104,10 @@ public void setCalleeNeedsExceptionState() {
103104
public static boolean setEncapsulatingNeedsToPassCallerFrame(final Node callNode) {
104105
Node pythonCallNode = callNode;
105106
while (pythonCallNode != null) {
107+
if (pythonCallNode instanceof InvokeNode) {
108+
// see GR-50465
109+
return true;
110+
}
106111
IndirectCallData data = PythonLanguage.lookupIndirectCallData(pythonCallNode);
107112
if (data != null) {
108113
data.setCalleeNeedsCallerFrame();
@@ -116,6 +121,10 @@ public static boolean setEncapsulatingNeedsToPassCallerFrame(final Node callNode
116121
public static void setEncapsulatingNeedsToPassExceptionState(Node callNode) {
117122
Node pythonCallNode = callNode;
118123
while (pythonCallNode != null) {
124+
if (pythonCallNode instanceof InvokeNode) {
125+
// see GR-50465
126+
break;
127+
}
119128
IndirectCallData data = PythonLanguage.lookupIndirectCallData(pythonCallNode);
120129
if (data != null) {
121130
data.setCalleeNeedsExceptionState();

0 commit comments

Comments
 (0)