Skip to content

Commit 3a584db

Browse files
committed
[GR-19560] Don't transfer to the interpreter while generating module names.
PullRequest: truffleruby/1146
2 parents 1c7911f + 47b76af commit 3a584db

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/java/org/truffleruby/core/module/ModuleFields.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.truffleruby.language.objects.shared.SharedObjects;
3838

3939
import com.oracle.truffle.api.Assumption;
40-
import com.oracle.truffle.api.CompilerDirectives;
4140
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
4241
import com.oracle.truffle.api.Truffle;
4342
import com.oracle.truffle.api.nodes.Node;
@@ -544,14 +543,18 @@ public String getName() {
544543
final String name = this.name;
545544
if (name == null) {
546545
// Lazily compute the anonymous name because it is expensive
547-
CompilerDirectives.transferToInterpreterAndInvalidate();
548-
final String anonymousName = createAnonymousName();
549-
this.name = anonymousName;
550-
return anonymousName;
546+
return getAnonymousName();
551547
}
552548
return name;
553549
}
554550

551+
@TruffleBoundary
552+
private String getAnonymousName() {
553+
final String anonymousName = createAnonymousName();
554+
this.name = anonymousName;
555+
return anonymousName;
556+
}
557+
555558
public void setFullName(String name) {
556559
assert name != null;
557560
hasFullName = true;

0 commit comments

Comments
 (0)