|
83 | 83 | import com.oracle.graal.python.nodes.util.CastToIndexNode;
|
84 | 84 | import com.oracle.graal.python.runtime.exception.PythonErrorType;
|
85 | 85 | import com.oracle.truffle.api.CompilerDirectives;
|
86 |
| -import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; |
87 | 86 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
88 | 87 | import com.oracle.truffle.api.dsl.Cached;
|
89 | 88 | import com.oracle.truffle.api.dsl.Fallback;
|
@@ -614,7 +613,6 @@ PNotImplemented doGeneric(Object left, Object right) {
|
614 | 613 | @GenerateNodeFactory
|
615 | 614 | @TypeSystemReference(PythonArithmeticTypes.class)
|
616 | 615 | abstract static class MulNode extends PythonBinaryBuiltinNode {
|
617 |
| - @CompilationFinal private ConditionProfile isBigIntPowerOfTwo = ConditionProfile.createBinaryProfile(); |
618 | 616 |
|
619 | 617 | @Specialization(rewriteOn = ArithmeticException.class)
|
620 | 618 | int doII(int x, int y) throws ArithmeticException {
|
@@ -655,8 +653,9 @@ PInt doPIntPInt(PInt left, PInt right) {
|
655 | 653 | return factory().createInt(mul(left.getValue(), right.getValue()));
|
656 | 654 | }
|
657 | 655 |
|
| 656 | + @TruffleBoundary |
658 | 657 | BigInteger mul(BigInteger a, BigInteger b) {
|
659 |
| - if (isBigIntPowerOfTwo.profile(b.and(b.subtract(BigInteger.ONE)).equals(BigInteger.ZERO))) { |
| 658 | + if (b.and(b.subtract(BigInteger.ONE)).equals(BigInteger.ZERO)) { |
660 | 659 | return bigIntegerShift(a, b.getLowestSetBit());
|
661 | 660 | } else {
|
662 | 661 | return bigIntegerMul(a, b);
|
|
0 commit comments