comparison src/share/vm/opto/parseHelper.cpp @ 4823:9a28ddfc1f4a

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
author roland
date Thu, 26 Jan 2012 09:38:28 +0100
parents 22cee0ee8927
children da91efe96a93
comparison
equal deleted inserted replaced
4822:94f0ce74d48e 4823:9a28ddfc1f4a
69 Node *obj = peek(); 69 Node *obj = peek();
70 70
71 // Throw uncommon trap if class is not loaded or the value we are casting 71 // Throw uncommon trap if class is not loaded or the value we are casting
72 // _from_ is not loaded, and value is not null. If the value _is_ NULL, 72 // _from_ is not loaded, and value is not null. If the value _is_ NULL,
73 // then the checkcast does nothing. 73 // then the checkcast does nothing.
74 const TypeInstPtr *tp = _gvn.type(obj)->isa_instptr(); 74 const TypeOopPtr *tp = _gvn.type(obj)->isa_oopptr();
75 if (!will_link || (tp && !tp->is_loaded())) { 75 if (!will_link || (tp && tp->klass() && !tp->klass()->is_loaded())) {
76 if (C->log() != NULL) { 76 if (C->log() != NULL) {
77 if (!will_link) { 77 if (!will_link) {
78 C->log()->elem("assert_null reason='checkcast' klass='%d'", 78 C->log()->elem("assert_null reason='checkcast' klass='%d'",
79 C->log()->identify(klass)); 79 C->log()->identify(klass));
80 } 80 }
81 if (tp && !tp->is_loaded()) { 81 if (tp && tp->klass() && !tp->klass()->is_loaded()) {
82 // %%% Cannot happen? 82 // %%% Cannot happen?
83 C->log()->elem("assert_null reason='checkcast source' klass='%d'", 83 C->log()->elem("assert_null reason='checkcast source' klass='%d'",
84 C->log()->identify(tp->klass())); 84 C->log()->identify(tp->klass()));
85 } 85 }
86 } 86 }