hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
changeset 36552 0db9be43cebb
parent 36325 1330e79162ac
child 36604 e9c073b0c19e
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp	Thu Mar 03 09:33:30 2016 -0800
+++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp	Thu Mar 03 22:17:38 2016 +0300
@@ -471,7 +471,7 @@
     InstanceConstant* c = x->argument_at(0)->type()->as_InstanceConstant();
     if (c != NULL && !c->value()->is_null_object()) {
       // ciInstance::java_mirror_type() returns non-NULL only for Java mirrors
-      ciType* t = c->value()->as_instance()->java_mirror_type();
+      ciType* t = c->value()->java_mirror_type();
       if (t->is_klass()) {
         // substitute cls.isInstance(obj) of a constant Class into
         // an InstantOf instruction
@@ -487,6 +487,17 @@
     }
     break;
   }
+  case vmIntrinsics::_isPrimitive        : {
+    assert(x->number_of_arguments() == 1, "wrong type");
+
+    // Class.isPrimitive is known on constant classes:
+    InstanceConstant* c = x->argument_at(0)->type()->as_InstanceConstant();
+    if (c != NULL && !c->value()->is_null_object()) {
+      ciType* t = c->value()->java_mirror_type();
+      set_constant(t->is_primitive_type());
+    }
+    break;
+  }
   }
 }