Skip to content

Commit efc1259

Browse files
committed
Put qualname into bytecode root toString
1 parent e744d36 commit efc1259

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ public final class PBytecodeRootNode extends PRootNode implements BytecodeOSRNod
540540
private static final byte TRACE_AND_PROFILE_FUN = TRACE_FUN | PROFILE_FUN;
541541

542542
private final Signature signature;
543-
private final TruffleString name;
544543
private final boolean internal;
545544
private boolean pythonInternal;
546545

@@ -704,7 +703,6 @@ private PBytecodeRootNode(PythonLanguage language, FrameDescriptor fd, Signature
704703
this.freevars = co.freevars;
705704
this.cellvars = co.cellvars;
706705
this.cell2arg = co.cell2arg;
707-
this.name = co.name;
708706
this.exceptionHandlerRanges = co.exceptionHandlerRanges;
709707
this.co = co;
710708
assert co.stacksize < Math.pow(2, 12) : "stacksize cannot be larger than 12-bit range";
@@ -749,12 +747,17 @@ protected int computeSize() {
749747

750748
@Override
751749
public String getName() {
752-
return name.toJavaStringUncached();
750+
return co.name.toJavaStringUncached();
751+
}
752+
753+
@Override
754+
public String getQualifiedName() {
755+
return co.qualname.toJavaStringUncached();
753756
}
754757

755758
@Override
756759
public String toString() {
757-
return "<bytecode " + name + " at " + Integer.toHexString(hashCode()) + ">";
760+
return "<bytecode " + co.qualname + " at " + Integer.toHexString(hashCode()) + ">";
758761
}
759762

760763
@Override

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode_dsl/PBytecodeDSLRootNode.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public final void triggerDeferredDeprecationWarnings() {
428428

429429
@Override
430430
public String toString() {
431-
return "<bytecode " + co.name + " at " + Integer.toHexString(hashCode()) + ">";
431+
return "<bytecode " + co.qualname + " at " + Integer.toHexString(hashCode()) + ">";
432432
}
433433

434434
@Prolog(storeBytecodeIndex = false)
@@ -866,6 +866,15 @@ public String getName() {
866866
return co.name.toJavaStringUncached();
867867
}
868868

869+
@Override
870+
public String getQualifiedName() {
871+
if (co == null) {
872+
// getQualifiedName can be called by validation code before the code unit has been set.
873+
return null;
874+
}
875+
return co.qualname.toJavaStringUncached();
876+
}
877+
869878
@Override
870879
public Signature getSignature() {
871880
return signature;

0 commit comments

Comments
 (0)