@@ -349,22 +349,30 @@ public abstract static class TrueDivNode extends BinaryArithmeticRaiseNode {
349
349
public static final Supplier <NotImplementedHandler > NOT_IMPLEMENTED = createHandler ("/" );
350
350
351
351
@ Specialization
352
- public static double doII (int x , int y , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
352
+ public static double doII (int x , int y ,
353
+ @ Bind ("this" ) Node inliningTarget ,
354
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
353
355
return doDD (x , y , inliningTarget , raiseNode );
354
356
}
355
357
356
358
@ Specialization
357
- public static double doLD (long x , double y , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
359
+ public static double doLD (long x , double y ,
360
+ @ Bind ("this" ) Node inliningTarget ,
361
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
358
362
return doDD (x , y , inliningTarget , raiseNode );
359
363
}
360
364
361
365
@ Specialization
362
- public static double doDL (double x , long y , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
366
+ public static double doDL (double x , long y ,
367
+ @ Bind ("this" ) Node inliningTarget ,
368
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
363
369
return doDD (x , y , inliningTarget , raiseNode );
364
370
}
365
371
366
372
@ Specialization
367
- public static double doDD (double x , double y , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
373
+ public static double doDD (double x , double y ,
374
+ @ Bind ("this" ) Node inliningTarget ,
375
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
368
376
raiseDivisionByZero (y == 0.0 , inliningTarget , raiseNode );
369
377
return x / y ;
370
378
}
@@ -382,13 +390,17 @@ public abstract static class FloorDivNode extends BinaryArithmeticRaiseNode {
382
390
public static final Supplier <NotImplementedHandler > NOT_IMPLEMENTED = createHandler ("//" );
383
391
384
392
@ Specialization
385
- public static int doII (int left , int right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
393
+ public static int doII (int left , int right ,
394
+ @ Bind ("this" ) Node inliningTarget ,
395
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
386
396
raiseIntDivisionByZero (right == 0 , inliningTarget , raiseNode );
387
397
return Math .floorDiv (left , right );
388
398
}
389
399
390
400
@ Specialization (rewriteOn = OverflowException .class )
391
- public static long doLL (long left , long right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) throws OverflowException {
401
+ public static long doLL (long left , long right ,
402
+ @ Bind ("this" ) Node inliningTarget ,
403
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) throws OverflowException {
392
404
if (left == Long .MIN_VALUE && right == -1 ) {
393
405
throw OverflowException .INSTANCE ;
394
406
}
@@ -397,19 +409,25 @@ public static long doLL(long left, long right, @Bind("this") Node inliningTarget
397
409
}
398
410
399
411
@ Specialization
400
- public static double doDL (double left , long right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
412
+ public static double doDL (double left , long right ,
413
+ @ Bind ("this" ) Node inliningTarget ,
414
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
401
415
raiseDivisionByZero (right == 0 , inliningTarget , raiseNode );
402
416
return Math .floor (left / right );
403
417
}
404
418
405
419
@ Specialization
406
- public static double doDD (double left , double right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
420
+ public static double doDD (double left , double right ,
421
+ @ Bind ("this" ) Node inliningTarget ,
422
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
407
423
raiseDivisionByZero (right == 0.0 , inliningTarget , raiseNode );
408
424
return Math .floor (left / right );
409
425
}
410
426
411
427
@ Specialization
412
- public static double doLD (long left , double right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
428
+ public static double doLD (long left , double right ,
429
+ @ Bind ("this" ) Node inliningTarget ,
430
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
413
431
raiseDivisionByZero (right == 0.0 , inliningTarget , raiseNode );
414
432
return Math .floor (left / right );
415
433
}
@@ -427,31 +445,41 @@ public abstract static class ModNode extends BinaryArithmeticRaiseNode {
427
445
public static final Supplier <NotImplementedHandler > NOT_IMPLEMENTED = createHandler ("%" );
428
446
429
447
@ Specialization
430
- public static int doII (int left , int right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
448
+ public static int doII (int left , int right ,
449
+ @ Bind ("this" ) Node inliningTarget ,
450
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
431
451
raiseIntDivisionByZero (right == 0 , inliningTarget , raiseNode );
432
452
return Math .floorMod (left , right );
433
453
}
434
454
435
455
@ Specialization
436
- public static long doLL (long left , long right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
456
+ public static long doLL (long left , long right ,
457
+ @ Bind ("this" ) Node inliningTarget ,
458
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
437
459
raiseIntDivisionByZero (right == 0 , inliningTarget , raiseNode );
438
460
return Math .floorMod (left , right );
439
461
}
440
462
441
463
@ Specialization
442
- public static double doDL (double left , long right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
464
+ public static double doDL (double left , long right ,
465
+ @ Bind ("this" ) Node inliningTarget ,
466
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
443
467
raiseDivisionByZero (right == 0 , inliningTarget , raiseNode );
444
468
return FloatBuiltins .ModNode .mod (left , right );
445
469
}
446
470
447
471
@ Specialization
448
- public static double doDD (double left , double right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
472
+ public static double doDD (double left , double right ,
473
+ @ Bind ("this" ) Node inliningTarget ,
474
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
449
475
raiseDivisionByZero (right == 0.0 , inliningTarget , raiseNode );
450
476
return FloatBuiltins .ModNode .mod (left , right );
451
477
}
452
478
453
479
@ Specialization
454
- public static double doLD (long left , double right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
480
+ public static double doLD (long left , double right ,
481
+ @ Bind ("this" ) Node inliningTarget ,
482
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ) {
455
483
raiseDivisionByZero (right == 0.0 , inliningTarget , raiseNode );
456
484
return FloatBuiltins .ModNode .mod (left , right );
457
485
}
@@ -612,35 +640,45 @@ public abstract static class DivModNode extends BinaryArithmeticRaiseNode {
612
640
public static final Supplier <NotImplementedHandler > NOT_IMPLEMENTED = createHandler ("divmod" );
613
641
614
642
@ Specialization
615
- public static PTuple doLL (int left , int right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
643
+ public static PTuple doLL (int left , int right ,
644
+ @ Bind ("this" ) Node inliningTarget ,
645
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
616
646
@ Shared ("factory" ) @ Cached PythonObjectFactory factory ) {
617
647
raiseIntDivisionByZero (right == 0 , inliningTarget , raiseNode );
618
648
return factory .createTuple (new Object []{Math .floorDiv (left , right ), Math .floorMod (left , right )});
619
649
}
620
650
621
651
@ Specialization
622
- public static PTuple doLL (long left , long right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
652
+ public static PTuple doLL (long left , long right ,
653
+ @ Bind ("this" ) Node inliningTarget ,
654
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
623
655
@ Shared ("factory" ) @ Cached PythonObjectFactory factory ) {
624
656
raiseIntDivisionByZero (right == 0 , inliningTarget , raiseNode );
625
657
return factory .createTuple (new Object []{Math .floorDiv (left , right ), Math .floorMod (left , right )});
626
658
}
627
659
628
660
@ Specialization
629
- public static PTuple doDL (double left , long right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
661
+ public static PTuple doDL (double left , long right ,
662
+ @ Bind ("this" ) Node inliningTarget ,
663
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
630
664
@ Shared ("factory" ) @ Cached PythonObjectFactory factory ) {
631
665
raiseDivisionByZero (right == 0 , inliningTarget , raiseNode );
632
666
return factory .createTuple (new Object []{Math .floor (left / right ), FloatBuiltins .ModNode .mod (left , right )});
633
667
}
634
668
635
669
@ Specialization
636
- public static PTuple doDD (double left , double right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
670
+ public static PTuple doDD (double left , double right ,
671
+ @ Bind ("this" ) Node inliningTarget ,
672
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
637
673
@ Shared ("factory" ) @ Cached PythonObjectFactory factory ) {
638
674
raiseDivisionByZero (right == 0.0 , inliningTarget , raiseNode );
639
675
return factory .createTuple (new Object []{Math .floor (left / right ), FloatBuiltins .ModNode .mod (left , right )});
640
676
}
641
677
642
678
@ Specialization
643
- public static PTuple doLD (long left , double right , @ Bind ("this" ) Node inliningTarget , @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
679
+ public static PTuple doLD (long left , double right ,
680
+ @ Bind ("this" ) Node inliningTarget ,
681
+ @ Shared ("raiseNode" ) @ Cached PRaiseNode .Lazy raiseNode ,
644
682
@ Shared ("factory" ) @ Cached PythonObjectFactory factory ) {
645
683
raiseDivisionByZero (right == 0.0 , inliningTarget , raiseNode );
646
684
return factory .createTuple (new Object []{Math .floor (left / right ), FloatBuiltins .ModNode .mod (left , right )});
0 commit comments