File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 231
231
import com .oracle .graal .python .builtins .objects .function .PKeyword ;
232
232
import com .oracle .graal .python .builtins .objects .function .Signature ;
233
233
import com .oracle .graal .python .builtins .objects .getsetdescriptor .GetSetDescriptor ;
234
- import com .oracle .graal .python .builtins .objects .ints .IntBuiltins .GtNode ;
235
- import com .oracle .graal .python .builtins .objects .ints .IntBuiltins .LtNode ;
236
234
import com .oracle .graal .python .builtins .objects .ints .IntBuiltins .NegNode ;
237
235
import com .oracle .graal .python .builtins .objects .ints .PInt ;
238
236
import com .oracle .graal .python .builtins .objects .iterator .PSequenceIterator ;
@@ -2284,19 +2282,17 @@ int signFalse(boolean b) {
2284
2282
}
2285
2283
2286
2284
@ Specialization
2287
- int sign (VirtualFrame frame , PInt n ,
2288
- @ Cached LtNode ltNode ,
2289
- @ Cached GtNode gtNode ,
2290
- @ Cached BranchProfile gtProfile ,
2291
- @ Cached BranchProfile ltProfile ) {
2292
- if ((boolean ) gtNode .execute (frame , n , 0 )) {
2293
- gtProfile .enter ();
2294
- return 1 ;
2295
- } else if ((boolean ) ltNode .execute (frame , n , 0 )) {
2296
- ltProfile .enter ();
2285
+ int sign (PInt n ,
2286
+ @ Cached BranchProfile zeroProfile ,
2287
+ @ Cached BranchProfile negProfile ) {
2288
+ if (n .isNegative ()) {
2289
+ negProfile .enter ();
2297
2290
return -1 ;
2298
- } else {
2291
+ } else if (n .isZero ()) {
2292
+ zeroProfile .enter ();
2299
2293
return 0 ;
2294
+ } else {
2295
+ return 1 ;
2300
2296
}
2301
2297
}
2302
2298
You can’t perform that action at this time.
0 commit comments