File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/util Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 47
47
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
48
48
import com .oracle .graal .python .nodes .truffle .PythonArithmeticTypes ;
49
49
import com .oracle .truffle .api .CompilerDirectives ;
50
+ import com .oracle .truffle .api .dsl .Cached ;
50
51
import com .oracle .truffle .api .dsl .ImportStatic ;
51
52
import com .oracle .truffle .api .dsl .Specialization ;
52
53
import com .oracle .truffle .api .dsl .TypeSystemReference ;
53
54
import com .oracle .truffle .api .frame .VirtualFrame ;
55
+ import com .oracle .truffle .api .profiles .ConditionProfile ;
54
56
55
57
import static com .oracle .graal .python .nodes .SpecialMethodNames .__COMPLEX__ ;
56
58
import static com .oracle .graal .python .runtime .exception .PythonErrorType .TypeError ;
@@ -78,8 +80,8 @@ PComplex toComplex(double x) {
78
80
}
79
81
80
82
@ Specialization
81
- PComplex toComplex (VirtualFrame frame , Object x ) {
82
- if (x instanceof PComplex ) {
83
+ PComplex toComplex (VirtualFrame frame , Object x , @ Cached ( "createBinaryProfile" ) ConditionProfile complexProfile ) {
84
+ if (complexProfile . profile ( x instanceof PComplex ) ) {
83
85
return (PComplex ) x ;
84
86
}
85
87
// TODO taken from BuiltinConstructors, should probably be refactored somehow
You can’t perform that action at this time.
0 commit comments