Skip to content

Commit cd320c4

Browse files
committed
Do not access any Java annotation property on the fast path.
1 parent 3a3602c commit cd320c4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/function/BuiltinFunctionRootNode.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
public final class BuiltinFunctionRootNode extends PRootNode {
5252
private final Signature signature;
5353
private final Builtin builtin;
54+
private final String name;
5455
private final NodeFactory<? extends PythonBuiltinBaseNode> factory;
5556
private final boolean declaresExplicitSelf;
5657

@@ -145,8 +146,10 @@ public Object execute(VirtualFrame frame) {
145146

146147
public BuiltinFunctionRootNode(PythonLanguage language, Builtin builtin, NodeFactory<? extends PythonBuiltinBaseNode> factory, boolean declaresExplicitSelf) {
147148
super(language);
149+
CompilerAsserts.neverPartOfCompilation();
148150
this.signature = createSignature(factory, builtin, declaresExplicitSelf);
149151
this.builtin = builtin;
152+
this.name = builtin.name();
150153
this.factory = factory;
151154
this.declaresExplicitSelf = declaresExplicitSelf;
152155
if (builtin.alwaysNeedsCallerFrame()) {
@@ -207,6 +210,7 @@ private static Signature createSignature(NodeFactory<? extends PythonBuiltinBase
207210
*/
208211
private static ReadArgumentNode[] createArgumentsList(Builtin builtin, boolean needsExplicitSelf) {
209212
ArrayList<ReadArgumentNode> args = new ArrayList<>();
213+
210214
String[] parameterNames = builtin.parameterNames();
211215
int maxNumPosArgs = Math.max(builtin.minNumOfPositionalArgs(), parameterNames.length);
212216

@@ -305,7 +309,7 @@ public Object execute(VirtualFrame frame) {
305309
}
306310

307311
public String getFunctionName() {
308-
return builtin.name();
312+
return name;
309313
}
310314

311315
public NodeFactory<? extends PythonBuiltinBaseNode> getFactory() {
@@ -315,12 +319,12 @@ public NodeFactory<? extends PythonBuiltinBaseNode> getFactory() {
315319
@Override
316320
public String toString() {
317321
CompilerAsserts.neverPartOfCompilation();
318-
return "<builtin function " + builtin.name() + " at " + Integer.toHexString(hashCode()) + ">";
322+
return "<builtin function " + name + " at " + Integer.toHexString(hashCode()) + ">";
319323
}
320324

321325
@Override
322326
public String getName() {
323-
return builtin.name();
327+
return name;
324328
}
325329

326330
public boolean declaresExplicitSelf() {

0 commit comments

Comments
 (0)