Skip to content

Commit d40ecdb

Browse files
committed
Added TruffleBoundary annotations
1 parent 7cdcbca commit d40ecdb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.oracle.graal.python.runtime.PythonCore;
2323
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
2424
import com.oracle.truffle.api.CompilerDirectives;
25+
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
2526
import com.oracle.truffle.api.dsl.Cached;
2627
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
2728
import com.oracle.truffle.api.dsl.ImportStatic;
@@ -111,6 +112,7 @@ enum SpecialType {
111112
PINF, // 5, positive infinity
112113
NAN; // 6, Not a Number
113114

115+
@TruffleBoundary
114116
static SpecialType ofDouble(double d) {
115117
if (Double.isFinite(d)) {
116118
if (d != 0) {
@@ -335,6 +337,7 @@ PComplex doGeneral(Object r, Object phi,
335337
return rect(rLib.asJavaDouble(r), phiLib.asJavaDouble(phi));
336338
}
337339

340+
@TruffleBoundary
338341
private PComplex rect(double r, double phi) {
339342
// deal with special values
340343
if (!Double.isFinite(r) || !Double.isFinite(phi)) {
@@ -423,6 +426,7 @@ private PComplex log(PComplex z) {
423426
return factory().createComplex(real, imag);
424427
}
425428

429+
@TruffleBoundary
426430
private double computeRealPart(double real, double imag) {
427431
double ax = Math.abs(real);
428432
double ay = Math.abs(imag);

0 commit comments

Comments
 (0)