Skip to content

Commit 6bd4b27

Browse files
committed
[Truffle] Need to transfer because expensive construction of exceptions in Float#to_i.
1 parent 97b1532 commit 6bd4b27

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/main/java/org/jruby/truffle/nodes/core/FloatNodes.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,12 @@ public ToINode(ToINode prev) {
628628
@Specialization
629629
public Object toI(double value) {
630630
if (Double.isInfinite(value)) {
631+
CompilerDirectives.transferToInterpreter();
631632
throw new RaiseException(getContext().getCoreLibrary().floatDomainError("Infinity", this));
632633
}
633634

634635
if (Double.isNaN(value)) {
636+
CompilerDirectives.transferToInterpreter();
635637
throw new RaiseException(getContext().getCoreLibrary().floatDomainError("NaN", this));
636638
}
637639

0 commit comments

Comments
 (0)