hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
changeset 12949 e125ba4c16bd
parent 12947 ba8ba6c2dd83
child 12950 ab4f4afb3988
equal deleted inserted replaced
12948:51a31186c84f 12949:e125ba4c16bd
   451     LongConstant* c = x->argument_at(0)->type()->as_LongConstant();
   451     LongConstant* c = x->argument_at(0)->type()->as_LongConstant();
   452     if (c != NULL) {
   452     if (c != NULL) {
   453       JavaValue v;
   453       JavaValue v;
   454       v.set_jlong(c->value());
   454       v.set_jlong(c->value());
   455       set_constant(v.get_jdouble());
   455       set_constant(v.get_jdouble());
       
   456     }
       
   457     break;
       
   458   }
       
   459   case vmIntrinsics::_isInstance          : {
       
   460     assert(x->number_of_arguments() == 2, "wrong type");
       
   461 
       
   462     InstanceConstant* c = x->argument_at(0)->type()->as_InstanceConstant();
       
   463     if (c != NULL && !c->value()->is_null_object()) {
       
   464       // ciInstance::java_mirror_type() returns non-NULL only for Java mirrors
       
   465       ciType* t = c->value()->as_instance()->java_mirror_type();
       
   466       if (t->is_klass()) {
       
   467         // substitute cls.isInstance(obj) of a constant Class into
       
   468         // an InstantOf instruction
       
   469         InstanceOf* i = new InstanceOf(t->as_klass(), x->argument_at(1), x->state());
       
   470         set_canonical(i);
       
   471         // and try to canonicalize even further
       
   472         do_InstanceOf(i);
       
   473       } else {
       
   474         assert(t->is_primitive_type(), "should be a primitive type");
       
   475         // cls.isInstance(obj) always returns false for primitive classes
       
   476         set_constant(0);
       
   477       }
   456     }
   478     }
   457     break;
   479     break;
   458   }
   480   }
   459   }
   481   }
   460 }
   482 }