Skip to content

Commit

Permalink
[Truffle] Transfer on RubyModule.getName() for complex cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jun 18, 2015
1 parent dcac69d commit 4ccd5ae
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,15 @@ public RubyContext getContext() {
public String getName() {
if (name != null) {
return name;
} else if (givenBaseName != null) {
return lexicalParent.getName() + "::" + givenBaseName;
} else if (getLogicalClass() == this) { // For the case of class Class during initialization
return "#<cyclic>";
} else {
return "#<" + getLogicalClass().getName() + ":0x" + Long.toHexString(verySlowGetObjectID()) + ">";
CompilerDirectives.transferToInterpreter();
if (givenBaseName != null) {
return lexicalParent.getName() + "::" + givenBaseName;
} else if (getLogicalClass() == this) { // For the case of class Class during initialization
return "#<cyclic>";
} else {
return "#<" + getLogicalClass().getName() + ":0x" + Long.toHexString(verySlowGetObjectID()) + ">";
}
}
}

Expand Down

0 comments on commit 4ccd5ae

Please sign in to comment.