Skip to content

Commit e427508

Browse files
committed
Move BigInteger.abs() call outside TruffleBoundary
1 parent d84af24 commit e427508

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,16 @@ protected String bigToString(BigInteger x) {
279279
return x.toString(2);
280280
}
281281

282+
@TruffleBoundary
283+
protected BigInteger bigAbs(BigInteger x) {
284+
return x.abs();
285+
}
286+
282287
@Specialization
283288
String doL(long x,
284289
@Cached ConditionProfile isMinLong) {
285290
if (isMinLong.profile(x == Long.MIN_VALUE)) {
286-
return buildString(true, bigToString(PInt.longToBigInteger(x).abs()));
291+
return buildString(true, bigToString(bigAbs(PInt.longToBigInteger(x))));
287292
}
288293
return buildString(x < 0, longToString(Math.abs(x)));
289294
}

0 commit comments

Comments
 (0)