Skip to content

Commit b9f0c18

Browse files
committed
Convert BigIntegerCastNode to DSL inlinable
1 parent 044cdfb commit b9f0c18

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/main/java/org/truffleruby/core/cast/BigIntegerCastNode.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
package org.truffleruby.core.cast;
1111

1212
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
13+
import com.oracle.truffle.api.dsl.GenerateCached;
14+
import com.oracle.truffle.api.dsl.GenerateInline;
1315
import com.oracle.truffle.api.dsl.Specialization;
16+
import com.oracle.truffle.api.nodes.Node;
1417
import org.truffleruby.core.exception.RubyException;
1518
import org.truffleruby.core.numeric.BigIntegerOps;
1619
import org.truffleruby.core.numeric.RubyBignum;
@@ -20,9 +23,11 @@
2023
import java.math.BigInteger;
2124

2225
/** Casts a value into a BigInteger. */
26+
@GenerateCached(false)
27+
@GenerateInline
2328
public abstract class BigIntegerCastNode extends RubyBaseNode {
2429

25-
public abstract BigInteger execute(Object value);
30+
public abstract BigInteger execute(Node node, Object value);
2631

2732
@Specialization
2833
BigInteger doInt(int value) {

src/main/java/org/truffleruby/core/numeric/IntegerNodes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,9 +1941,9 @@ Object doModPow(Object baseObject, Object exponentObject, Object moduloObject,
19411941
@Cached BigIntegerCastNode exponentCastNode,
19421942
@Cached BigIntegerCastNode moduloCastNode,
19431943
@Cached ModPowNode modPowNode) {
1944-
final var base = baseCastNode.execute(baseObject);
1945-
final var exponent = exponentCastNode.execute(exponentObject);
1946-
final var modulo = moduloCastNode.execute(moduloObject);
1944+
final var base = baseCastNode.execute(this, baseObject);
1945+
final var exponent = exponentCastNode.execute(this, exponentObject);
1946+
final var modulo = moduloCastNode.execute(this, moduloObject);
19471947
return modPowNode.execute(this, base, exponent, modulo);
19481948
}
19491949
}

0 commit comments

Comments
 (0)