< prev index next >

src/hotspot/share/c1/c1_Instruction.cpp

Print this page

@@ -112,10 +112,20 @@
     return t->as_klass()->exact_klass();
   }
   return NULL;
 }
 
+ciKlass* Instruction::as_loaded_klass_or_null() const {
+  ciType* type = declared_type();
+  if (type != NULL && type->is_klass()) {
+    ciKlass* klass = type->as_klass();
+    if (klass->is_loaded()) {
+      return klass;
+    }
+  }
+  return NULL;
+}
 
 // FIXME -- this is used by ValueStack::merge_types only. We should remove this function
 // and use a better way for handling phi nodes.
 bool Instruction::is_flattened_array() const {
   if (ValueArrayFlatten) {
< prev index next >