7123910: Some CTW tests crash VM: is_loaded() && that->is_loaded()
authorroland
Thu, 26 Jan 2012 09:38:28 +0100
changeset 11570 25f3e9348905
parent 11569 7b68349ab1f4
child 11571 23f825a42a85
7123910: Some CTW tests crash VM: is_loaded() && that->is_loaded() Summary: handle not loaded array klass in Parse::do_checkcast(). Reviewed-by: kvn, never
hotspot/src/share/vm/opto/parseHelper.cpp
--- a/hotspot/src/share/vm/opto/parseHelper.cpp	Wed Jan 25 08:10:04 2012 -0800
+++ b/hotspot/src/share/vm/opto/parseHelper.cpp	Thu Jan 26 09:38:28 2012 +0100
@@ -71,14 +71,14 @@
   // Throw uncommon trap if class is not loaded or the value we are casting
   // _from_ is not loaded, and value is not null.  If the value _is_ NULL,
   // then the checkcast does nothing.
-  const TypeInstPtr *tp = _gvn.type(obj)->isa_instptr();
-  if (!will_link || (tp && !tp->is_loaded())) {
+  const TypeOopPtr *tp = _gvn.type(obj)->isa_oopptr();
+  if (!will_link || (tp && tp->klass() && !tp->klass()->is_loaded())) {
     if (C->log() != NULL) {
       if (!will_link) {
         C->log()->elem("assert_null reason='checkcast' klass='%d'",
                        C->log()->identify(klass));
       }
-      if (tp && !tp->is_loaded()) {
+      if (tp && tp->klass() && !tp->klass()->is_loaded()) {
         // %%% Cannot happen?
         C->log()->elem("assert_null reason='checkcast source' klass='%d'",
                        C->log()->identify(tp->klass()));