Skip to content

Commit e1f8ac7

Browse files
committed
Avoid capturing frame in annonymous class in GetItemNode
1 parent a0e3a13 commit e1f8ac7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/LookupAndCallBinaryNode.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
public abstract class LookupAndCallBinaryNode extends Node {
7979

8080
public abstract static class NotImplementedHandler extends PNodeWithContext {
81-
public abstract Object execute(Object arg, Object arg2);
81+
public abstract Object execute(VirtualFrame frame, Object arg, Object arg2);
8282
}
8383

8484
protected final String name;
@@ -367,7 +367,7 @@ Object callObject(VirtualFrame frame, Object left, Object right,
367367
Object leftCallable = getattr.execute(frame, leftClass, leftValue);
368368
if (leftCallable == PNone.NO_VALUE) {
369369
if (handlerFactory != null) {
370-
return runErrorHandler(leftValue, right);
370+
return runErrorHandler(frame, leftValue, right);
371371
} else {
372372
return PNotImplemented.NOT_IMPLEMENTED;
373373
}
@@ -428,7 +428,7 @@ Object callObjectR(VirtualFrame frame, Object left, Object right,
428428
result = ensureReverseDispatch().executeObject(frame, rightCallable, rightValue, leftValue);
429429
}
430430
if (handlerFactory != null && result == PNotImplemented.NOT_IMPLEMENTED) {
431-
return runErrorHandler(leftValue, rightValue);
431+
return runErrorHandler(frame, leftValue, rightValue);
432432
}
433433
return result;
434434
}
@@ -445,12 +445,12 @@ Object callObjectRUncached(VirtualFrame frame, Object left, Object right,
445445
return callObjectR(frame, left, right, getattr, getattrR, libLeft, libRight, isSameTypeNode, isSubtype, notImplementedBranch);
446446
}
447447

448-
private Object runErrorHandler(Object left, Object right) {
448+
private Object runErrorHandler(VirtualFrame frame, Object left, Object right) {
449449
if (handler == null) {
450450
CompilerDirectives.transferToInterpreterAndInvalidate();
451451
handler = insert(handlerFactory.get());
452452
}
453-
return handler.execute(left, right);
453+
return handler.execute(frame, left, right);
454454
}
455455

456456
public String getName() {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/expression/BinaryArithmetic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public enum BinaryArithmetic {
7979
this.operator = operator;
8080
this.notImplementedHandler = () -> new NotImplementedHandler() {
8181
@Override
82-
public Object execute(Object arg, Object arg2) {
82+
public Object execute(VirtualFrame frame, Object arg, Object arg2) {
8383
throw PRaiseNode.getUncached().raise(TypeError, ErrorMessages.UNSUPPORTED_OPERAND_TYPES_FOR_S_P_AND_P, operator, arg, arg2);
8484
}
8585
};

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/subscript/DeleteItemNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public DeleteItemNode() {
7676
@Child private PRaiseNode raiseNode = PRaiseNode.create();
7777

7878
@Override
79-
public Object execute(Object arg, Object arg2) {
79+
public Object execute(VirtualFrame frame, Object arg, Object arg2) {
8080
throw raiseNode.raise(TypeError, ErrorMessages.OBJ_DOESNT_SUPPORT_DELETION, arg);
8181
}
8282
};

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/subscript/GetItemNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Object doAnyObject(VirtualFrame frame, Object primary, Object index) {
134134
@Child private GetAttributeNode getClassGetItemNode;
135135

136136
@Override
137-
public Object execute(Object arg, Object arg2) {
137+
public Object execute(VirtualFrame frame, Object arg, Object arg2) {
138138
if (PGuards.isPythonClass(arg)) {
139139
if (getClassGetItemNode == null) {
140140
CompilerDirectives.transferToInterpreterAndInvalidate();

0 commit comments

Comments
 (0)