Fri, 23 Jul 2010 10:07:46 -0700
6969569: assert(is_static() && is_constant()) failed: illegal call to constant_value()
Summary: Add missing is_static guard.
Reviewed-by: twisti
src/share/vm/ci/ciField.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/macro.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/ci/ciField.cpp Thu Jul 22 15:29:22 2010 -0700 1.2 +++ b/src/share/vm/ci/ciField.cpp Fri Jul 23 10:07:46 2010 -0700 1.3 @@ -339,7 +339,7 @@ 1.4 if (_type != NULL) _type->print_name(); 1.5 else tty->print("(reference)"); 1.6 tty->print(" is_constant=%s", bool_to_str(_is_constant)); 1.7 - if (_is_constant) { 1.8 + if (_is_constant && is_static()) { 1.9 tty->print(" constant_value="); 1.10 _constant_value.print(); 1.11 }
2.1 --- a/src/share/vm/opto/macro.cpp Thu Jul 22 15:29:22 2010 -0700 2.2 +++ b/src/share/vm/opto/macro.cpp Fri Jul 23 10:07:46 2010 -0700 2.3 @@ -720,7 +720,7 @@ 2.4 if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) { 2.5 if (!elem_type->is_loaded()) { 2.6 field_type = TypeInstPtr::BOTTOM; 2.7 - } else if (field != NULL && field->is_constant()) { 2.8 + } else if (field != NULL && field->is_constant() && field->is_static()) { 2.9 // This can happen if the constant oop is non-perm. 2.10 ciObject* con = field->constant_value().as_object(); 2.11 // Do not "join" in the previous type; it doesn't add value,