src/share/vm/opto/parse3.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/parse3.cpp	Tue Apr 30 19:32:24 2013
--- new/src/share/vm/opto/parse3.cpp	Tue Apr 30 19:32:23 2013

*** 148,157 **** --- 148,174 ---- // Does this field have a constant value? If so, just push the value. if (field->is_constant()) { // final field if (field->is_static()) { // final static field + if (C->eliminate_autobox()) { + // The pointers in the autobox arrays are always non-null. + ciSymbol* klass_name = field->holder()->name(); + if (field->name() == ciSymbol::cache_field_name() && + field->holder()->uses_default_loader() && + (klass_name == ciSymbol::java_lang_Character_CharacterCache() || + klass_name == ciSymbol::java_lang_Byte_ByteCache() || + klass_name == ciSymbol::java_lang_Short_ShortCache() || + klass_name == ciSymbol::java_lang_Integer_IntegerCache() || + klass_name == ciSymbol::java_lang_Long_LongCache())) { + bool require_const = true; + bool autobox_cache = true; + if (push_constant(field->constant_value(), require_const, autobox_cache)) { + return; + } + } + } if (push_constant(field->constant_value())) return; } else { // final non-static field
*** 302,316 **** --- 319,340 ---- // Note the presence of writes to final non-static fields, so that we // can insert a memory barrier later on to keep the writes from floating // out of the constructor. if (is_field && field->is_final()) { set_wrote_final(true); + // Preserve allocation ptr to create precedent edge to it in membar + // generated on exit from constructor. + if (C->eliminate_autobox() && + adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && + AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { + set_alloc_with_final(obj); + } } } ! bool Parse::push_constant(ciConstant constant, bool require_constant, bool is_autobox_cache) { switch (constant.basic_type()) { case T_BOOLEAN: push( intcon(constant.as_boolean()) ); break; case T_INT: push( intcon(constant.as_int()) ); break; case T_CHAR: push( intcon(constant.as_char()) ); break; case T_BYTE: push( intcon(constant.as_byte()) ); break;
*** 327,337 **** --- 351,361 ---- ciObject* oop_constant = constant.as_object(); if (oop_constant->is_null_object()) { push( zerocon(T_OBJECT) ); break; } else if (require_constant || oop_constant->should_be_constant()) { ! push( makecon(TypeOopPtr::make_from_constant(oop_constant, require_constant, is_autobox_cache)) ); break; } else { // we cannot inline the oop, but we can use it later to narrow a type return false; }

src/share/vm/opto/parse3.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File