Skip to content

Commit 7ff6d1b

Browse files
committed
CallNode: getUncached().execute -> CallNode.executeUncached, execute without a frame arg -> 'executeWithoutFrame'
1 parent ce79a38 commit 7ff6d1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+102
-94
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/AsyncioModuleBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -249,7 +249,7 @@ public void postInitialize(Python3Core core) {
249249
self.setAttribute(CURRENT_TASKS_ATTR, factory.createDict());
250250
Object weakref = AbstractImportNode.importModule(WEAKREF);
251251
Object weakSetCls = PyObjectGetAttr.executeUncached(weakref, WEAKSET);
252-
Object weakSet = CallNode.getUncached().execute(weakSetCls);
252+
Object weakSet = CallNode.executeUncached(weakSetCls);
253253
self.setAttribute(ALL_TASKS_ATTR, weakSet);
254254
}
255255
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2487,7 +2487,7 @@ private static Object buildJavaClass(Object namespace, TruffleString name, Objec
24872487
// uncached PythonContext get, since this code path is slow in any case
24882488
Object module = PythonContext.get(null).lookupBuiltinModule(T___GRAALPYTHON__);
24892489
Object buildFunction = PyObjectLookupAttr.executeUncached(module, T_BUILD_JAVA_CLASS);
2490-
return CallNode.getUncached().execute(buildFunction, namespace, name, base);
2490+
return CallNode.executeUncached(buildFunction, namespace, name, base);
24912491
}
24922492

24932493
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/CodecsModuleBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void handle(Node inliningTarget, TruffleEncoder encoder, TruffleString er
248248
if (!fixed) {
249249
int start = encoder.getInputPosition();
250250
int end = start + encoder.getErrorLength();
251-
Object exception = lazyCallNode.execute(UnicodeEncodeError, encoder.getEncodingName(), inputObject, start, end, encoder.getErrorReason());
251+
Object exception = lazyCallNode.executeWithoutFrame(UnicodeEncodeError, encoder.getEncodingName(), inputObject, start, end, encoder.getErrorReason());
252252
if (exception instanceof PBaseException) {
253253
throw raiseNode.get(inliningTarget).raiseExceptionObject((PBaseException) exception);
254254
} else {
@@ -370,7 +370,7 @@ static Object doRaise(Node inliningTarget, TruffleDecoder decoder, Object inputO
370370
@Cached PRaiseNode.Lazy raiseNode) {
371371
int start = decoder.getInputPosition();
372372
int end = start + decoder.getErrorLength();
373-
Object exception = callNode.execute(UnicodeDecodeError, decoder.getEncodingName(), inputObject, start, end, decoder.getErrorReason());
373+
Object exception = callNode.executeWithoutFrame(UnicodeDecodeError, decoder.getEncodingName(), inputObject, start, end, decoder.getErrorReason());
374374
if (justMakeExcept) {
375375
return exception;
376376
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/FaulthandlerModuleBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -95,7 +95,7 @@ private static void dumpTraceback(Object callable, Object file) {
9595
f = PNone.NONE;
9696
}
9797
try {
98-
CallNode.getUncached().execute(null, callable, PNone.NONE, PNone.NONE, f);
98+
CallNode.executeUncached(callable, PNone.NONE, PNone.NONE, f);
9999
} catch (RuntimeException e) {
100100
ExceptionUtils.printPythonLikeStackTrace(e);
101101
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GraalPythonModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ private static boolean getImporter(PythonModule sysModule, TruffleString inputFi
370370
int numHooks = storage.length();
371371
for (int i = 0; i < numHooks; i++) {
372372
try {
373-
importer = CallNode.getUncached().execute(hooks[i], inputFilePath);
373+
importer = CallNode.executeUncached(hooks[i], inputFilePath);
374374
break;
375375
} catch (PException e) {
376376
if (!IsSubtypeNode.getUncached().execute(GetClassNode.executeUncached(e.getUnreifiedException()), ImportError)) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SREModuleBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ private RuntimeException handleCompilationError(RuntimeException e, InteropLibra
420420
int position = sourceSection.getCharIndex();
421421
PythonModule module = context.lookupBuiltinModule(BuiltinNames.T__SRE);
422422
Object errorConstructor = PyObjectLookupAttr.executeUncached(module, T_ERROR);
423-
PBaseException exception = (PBaseException) CallNode.getUncached().execute(errorConstructor, reason, originalPattern, position);
423+
PBaseException exception = (PBaseException) CallNode.executeUncached(errorConstructor, reason, originalPattern, position);
424424
return PRaiseNode.getUncached().raiseExceptionObject(exception);
425425
}
426426
}
@@ -673,8 +673,8 @@ protected Object doCached(VirtualFrame frame, PythonObject pattern, Object input
673673
reCheckInputTypeNode.execute(frame, input, tRegexCache.isBinary());
674674

675675
if (fallbackProfile.profile(inliningTarget, libCompiledRegex.isNull(compiledRegex))) {
676-
Object fallbackRegex = getCallFallbackCompileNode().execute(getGetFallbackCompileNode().executeObject(frame, pattern));
677-
return getCallFallbackMethodNode().execute(getFallbackMethodNode.executeObject(frame, fallbackRegex), input, pos, endPos);
676+
Object fallbackRegex = getCallFallbackCompileNode().executeWithoutFrame(getGetFallbackCompileNode().executeObject(frame, pattern));
677+
return getCallFallbackMethodNode().executeWithoutFrame(getFallbackMethodNode.executeObject(frame, fallbackRegex), input, pos, endPos);
678678
}
679679

680680
Object truncatedInput = input;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/WarningsModuleBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@ private static void callShowWarning(PythonContext context, Object category, Obje
752752

753753
assert message != null && category != null && filename != null && source != null;
754754
assert message != PNone.NO_VALUE && category != PNone.NO_VALUE && source != PNone.NO_VALUE;
755-
Object msg = CallNode.getUncached().execute(warnmsgCls, message, category, filename, lineno, PNone.NONE, PNone.NONE, source);
756-
CallNode.getUncached().execute(showFn, msg);
755+
Object msg = CallNode.executeUncached(warnmsgCls, message, category, filename, lineno, PNone.NONE, PNone.NONE, source);
756+
CallNode.executeUncached(showFn, msg);
757757
}
758758

759759
/**
@@ -1182,7 +1182,7 @@ private void executeImpl(Object source, Object category, TruffleString format, i
11821182
} catch (IllegalFormatException e) {
11831183
throw CompilerDirectives.shouldNotReachHere("error while formatting \"" + format + "\"", e);
11841184
}
1185-
CallNode.getUncached().execute(warn, message, category, stackLevel, source);
1185+
CallNode.executeUncached(warn, message, category, stackLevel, source);
11861186
}
11871187
}
11881188
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ast/Obj2SstBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ <T> T[] lookupAndConvertSequence(Object obj, TruffleString attrName, TruffleStri
181181

182182
static boolean isInstanceOf(Object o, PythonAbstractClass cls) {
183183
Object check = lookupAttr(cls, SpecialMethodNames.T___INSTANCECHECK__);
184-
Object result = CallNode.getUncached().execute(check, o);
184+
Object result = CallNode.executeUncached(check, o);
185185
return CastToJavaBooleanNode.executeUncached(result);
186186
}
187187

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextAbstractBuiltins.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static Object getSlice(Object obj, long iLow, long iHigh,
522522
@Cached PySliceNew sliceNode,
523523
@Cached CallNode callNode) {
524524
Object getItemCallable = lookupAttrNode.execute(null, inliningTarget, obj, T___GETITEM__);
525-
return callNode.execute(getItemCallable, sliceNode.execute(inliningTarget, iLow, iHigh, PNone.NONE));
525+
return callNode.executeWithoutFrame(getItemCallable, sliceNode.execute(inliningTarget, iLow, iHigh, PNone.NONE));
526526
}
527527

528528
@Specialization(guards = "!checkNode.execute(inliningTarget, obj)", limit = "1")
@@ -580,7 +580,7 @@ static Object repeat(Object obj, long n,
580580
@SuppressWarnings("unused") @Exclusive @Cached PySequenceCheckNode checkNode) {
581581
Object imulCallable = lookupNode.execute(null, inliningTarget, obj, T___IMUL__);
582582
if (imulCallable != PNone.NO_VALUE) {
583-
Object ret = callNode.execute(imulCallable, n);
583+
Object ret = callNode.executeWithoutFrame(imulCallable, n);
584584
return ret;
585585
}
586586
return mulNode.executeObject(null, obj, n);
@@ -635,7 +635,7 @@ static Object concat(Object s1, Object s2,
635635
@SuppressWarnings("unused") @Exclusive @Cached PySequenceCheckNode checkNode) {
636636
Object iaddCallable = lookupNode.execute(null, inliningTarget, s1, T___IADD__);
637637
if (iaddCallable != PNone.NO_VALUE) {
638-
return callNode.execute(iaddCallable, s2);
638+
return callNode.executeWithoutFrame(iaddCallable, s2);
639639
}
640640
return addNode.executeObject(null, s1, s2);
641641
}
@@ -824,7 +824,7 @@ static Object items(Object obj,
824824
@Cached CallNode callNode,
825825
@Shared @Cached ConstructListNode listNode) {
826826
Object attr = getAttrNode.execute(inliningTarget, obj, T_ITEMS);
827-
return listNode.execute(null, callNode.execute(attr));
827+
return listNode.execute(null, callNode.executeWithoutFrame(attr));
828828
}
829829
}
830830

@@ -846,7 +846,7 @@ static Object values(Object obj,
846846
@Cached PRaiseNode.Lazy raiseNode) {
847847
checkNonNullArg(inliningTarget, obj, raiseNode);
848848
Object attr = getAttrNode.execute(inliningTarget, obj, T_VALUES);
849-
return listNode.execute(null, callNode.execute(attr));
849+
return listNode.execute(null, callNode.executeWithoutFrame(attr));
850850
}
851851
}
852852

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextCodeBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static Object codeNew(int argcount, int posonlyargcount, int kwonlyargcou
9090
firstlineno, lnotab, exceptionTable,
9191
freevars, cellvars
9292
};
93-
return callNode.execute(PythonBuiltinClassType.PCode, args);
93+
return callNode.executeWithoutFrame(PythonBuiltinClassType.PCode, args);
9494
}
9595
}
9696

0 commit comments

Comments
 (0)