hotspot/src/share/vm/ci/ciField.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/hotspot/src/share/vm/ci/ciField.cpp	Wed Sep  4 13:51:28 2013
--- new/hotspot/src/share/vm/ci/ciField.cpp	Wed Sep  4 13:51:28 2013

*** 187,202 **** --- 187,204 ---- _flags = ciFlags(fd->access_flags()); _offset = fd->offset(); _holder = CURRENT_ENV->get_instance_klass(fd->field_holder()); // Check to see if the field is constant. if (_holder->is_initialized() && this->is_final()) { + bool is_final = this->is_final(); + bool is_stable = FoldStableValues && this->is_stable(); + if (_holder->is_initialized() && (is_final || is_stable)) { if (!this->is_static()) { // A field can be constant if it's a final static field or if // it's a final non-static field of a trusted class (classes in // java.lang.invoke and sun.invoke packages and subpackages). ! if (is_stable || trust_final_non_static_fields(_holder)) { _is_constant = true; return; } _is_constant = false; return;
*** 225,235 **** --- 227,236 ---- } } Handle mirror = k->java_mirror(); _is_constant = true; switch(type()->basic_type()) { case T_BYTE: _constant_value = ciConstant(type()->basic_type(), mirror->byte_field(_offset)); break; case T_CHAR:
*** 271,280 **** --- 272,287 ---- _constant_value = ciConstant(type()->basic_type(), CURRENT_ENV->get_object(o)); assert(_constant_value.as_object() == CURRENT_ENV->get_object(o), "check interning"); } } } + if (is_stable && _constant_value.is_null_or_zero()) { + // It is not a constant after all; treat it as uninitialized. + _is_constant = false; + } else { + _is_constant = true; + } } else { _is_constant = false; } }
*** 371,382 **** --- 378,392 ---- tty->print("."); _name->print_symbol(); tty->print(" signature="); _signature->print_symbol(); tty->print(" offset=%d type=", _offset); - if (_type != NULL) _type->print_name(); ! else tty->print("(reference)"); ! _type->print_name(); + else + tty->print("(reference)"); + tty->print(" flags=%04x", flags().as_int()); tty->print(" is_constant=%s", bool_to_str(_is_constant)); if (_is_constant && is_static()) { tty->print(" constant_value="); _constant_value.print(); }

hotspot/src/share/vm/ci/ciField.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File