diff src/share/vm/ci/ciKlass.cpp @ 1604:b918d354830a

6960865: ldc of unloaded class throws an assert in ciTypeFlow Summary: Support java_mirror for unloaded klasses, arrays as well as instances. Simplify ciTypeFlow by removing unused path. Reviewed-by: kvn
author jrose
date Sat, 12 Jun 2010 22:53:43 -0700
parents c18cbe5936b8
children f95d63e2154a
line wrap: on
line diff
--- a/src/share/vm/ci/ciKlass.cpp	Thu Jun 10 13:04:20 2010 -0700
+++ b/src/share/vm/ci/ciKlass.cpp	Sat Jun 12 22:53:43 2010 -0700
@@ -192,8 +192,14 @@
 
 // ------------------------------------------------------------------
 // ciKlass::java_mirror
+//
+// Get the instance of java.lang.Class corresponding to this klass.
+// If it is an unloaded instance or array klass, return an unloaded
+// mirror object of type Class.
 ciInstance* ciKlass::java_mirror() {
   GUARDED_VM_ENTRY(
+    if (!is_loaded())
+      return ciEnv::current()->get_unloaded_klass_mirror(this);
     oop java_mirror = get_Klass()->java_mirror();
     return CURRENT_ENV->get_object(java_mirror)->as_instance();
   )