< prev index next >

src/share/vm/opto/parse3.cpp

Print this page

        

*** 200,209 **** --- 200,219 ---- bool is_vol = field->is_volatile(); // Compute address and memory type. int offset = field->offset_in_bytes(); const TypePtr* adr_type = C->alias_type(field)->adr_type(); + + // Insert read barrier for Shenandoah. + if ((ShenandoahOptimizeStaticFinals && field->is_static() && field->is_final()) || + (ShenandoahOptimizeInstanceFinals && !field->is_static() && field->is_final()) || + (ShenandoahOptimizeStableFinals && field->is_stable())) { + // Skip the barrier for special fields + } else { + obj = shenandoah_read_barrier(obj); + } + Node *adr = basic_plus_adr(obj, obj, offset); BasicType bt = field->layout_type(); // Build the resultant type of the load const Type *type;
*** 233,242 **** --- 243,262 ---- // Build the load. // MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol); + // Only enabled for Shenandoah. Can this be useful in general? + if (UseShenandoahGC && ShenandoahOptimizeStableFinals && UseImplicitStableValues) { + if (field->holder()->name() == ciSymbol::java_lang_String() && + field->offset() == java_lang_String::value_offset_in_bytes()) { + const TypeAryPtr* value_type = TypeAryPtr::make(TypePtr::NotNull, + TypeAry::make(TypeInt::CHAR, TypeInt::POS), + ciTypeArrayKlass::make(T_CHAR), true, 0); + ld = cast_array_to_stable(ld, value_type); + } + } // Adjust Java stack if (type2size[bt] == 1) push(ld); else push_pair(ld);
*** 281,290 **** --- 301,313 ---- // If reference is volatile, prevent following memory ops from // floating down past the volatile write. Also prevents commoning // another volatile read. if (is_vol) insert_mem_bar(Op_MemBarRelease); + // Insert write barrier for Shenandoah. + obj = shenandoah_write_barrier(obj); + // Compute address and memory type. int offset = field->offset_in_bytes(); const TypePtr* adr_type = C->alias_type(field)->adr_type(); Node* adr = basic_plus_adr(obj, obj, offset); BasicType bt = field->layout_type();
*** 310,319 **** --- 333,345 ---- if (!field->type()->is_loaded()) { field_type = TypeInstPtr::BOTTOM; } else { field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); } + + val = shenandoah_read_barrier_storeval(val); + store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); } else { store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol); }
< prev index next >