@@ -569,36 +569,12 @@ public int div(@SuppressWarnings("unused") long a, @SuppressWarnings("unused") R
569569 return 0 ;
570570 }
571571
572- @ Specialization (guards = "isRational(arguments[1])" )
573- public Object div (VirtualFrame frame , int a , RubyBasicObject b ) {
574- if (rationalConvertNode == null ) {
575- CompilerDirectives .transferToInterpreter ();
576- rationalConvertNode = insert (DispatchHeadNodeFactory .createMethodCall (getContext (), true ));
577- rationalDivNode = insert (DispatchHeadNodeFactory .createMethodCall (getContext ()));
578- }
579-
580- final Object aRational = rationalConvertNode .call (frame , getContext ().getCoreLibrary ().getRationalClass (), "convert" , null , a , 1 );
581-
582- return rationalDivNode .call (frame , aRational , "/" , null , b );
583- }
584-
585- @ Specialization (guards = "isComplex(arguments[1])" )
586- public Object divComplex (VirtualFrame frame , int a , RubyBasicObject b ) {
587- return ruby (frame , "Complex(a) / b" , "a" , a , "b" , b );
588- }
589-
590- @ Specialization (guards = "isComplex(arguments[1])" )
591- public Object divComplex (VirtualFrame frame , long a , RubyBasicObject b ) {
592- return ruby (frame , "Complex(a) / b" , "a" , a , "b" , b );
593- }
594-
595-
596- @ Specialization (guards = {"!isComplex(arguments[1])" , "!isRational(arguments[1])" , "!isRubyBignum(arguments[1])" })
572+ @ Specialization (guards = {"!isRubyBignum(arguments[1])" })
597573 public Object divFallback (VirtualFrame frame , long a , RubyBasicObject b ) {
598574 return ruby (frame , "redo_coerced :/, o" , "o" , b );
599575 }
600576
601- @ Specialization (guards = {"!isComplex(arguments[1])" , "!isRational(arguments[1])" , "! isRubyBignum(arguments[1])" })
577+ @ Specialization (guards = {"!isRubyBignum(arguments[1])" })
602578 public Object divFallback (VirtualFrame frame , int a , RubyBasicObject b ) {
603579 return ruby (frame , "redo_coerced :/, o" , "o" , b );
604580 }
0 commit comments