< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

BarrierSetC1_v3

BarrierSetC1_v2

*** 32,45 **** #include "c1/c1_ValueStack.hpp" #include "ci/ciArrayKlass.hpp" #include "ci/ciInstance.hpp" #include "ci/ciObjArray.hpp" #include "ci/ciUtilities.hpp" ! #include "gc/shared/cardTable.hpp" ! #include "gc/shared/c1/cardTableBarrierSetC1.hpp" #include "gc/shared/c1/barrierSetC1.hpp" - #include "gc/shared/c1/modRefBarrierSetC1.hpp" #include "runtime/arguments.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" --- 32,43 ---- #include "c1/c1_ValueStack.hpp" #include "ci/ciArrayKlass.hpp" #include "ci/ciInstance.hpp" #include "ci/ciObjArray.hpp" #include "ci/ciUtilities.hpp" ! #include "gc/shared/barrierSet.hpp" #include "gc/shared/c1/barrierSetC1.hpp" #include "runtime/arguments.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" ***************
*** 1237,1248 **** info = state_for(x); } LIR_Opr result = rlock_result(x, T_OBJECT); access_load_at(IN_HEAP | ON_WEAK_OOP_REF, T_OBJECT, ! reference, LIR_OprFact::intConst(referent_offset), result, ! NULL, NULL); } // Example: clazz.isInstance(object) void LIRGenerator::do_isInstance(Intrinsic* x) { assert(x->number_of_arguments() == 2, "wrong type"); --- 1235,1245 ---- info = state_for(x); } LIR_Opr result = rlock_result(x, T_OBJECT); access_load_at(IN_HEAP | ON_WEAK_OOP_REF, T_OBJECT, ! reference, LIR_OprFact::intConst(referent_offset), result); } // Example: clazz.isInstance(object) void LIRGenerator::do_isInstance(Intrinsic* x) { assert(x->number_of_arguments() == 2, "wrong type"); ***************
*** 1451,1462 **** // assert(offset.type()->tag() == intTag, "invalid type"); assert(cmp.type()->tag() == type->tag(), "invalid type"); assert(val.type()->tag() == type->tag(), "invalid type"); ! DecoratorSet decorators = IN_HEAP | MO_SEQ_CST; ! LIR_Opr result = access_atomic_cmpxchg_at(decorators, as_BasicType(type), obj, offset, cmp, val); set_result(x, result); } // Comment copied form templateTable_i486.cpp --- 1448,1458 ---- // assert(offset.type()->tag() == intTag, "invalid type"); assert(cmp.type()->tag() == type->tag(), "invalid type"); assert(val.type()->tag() == type->tag(), "invalid type"); ! LIR_Opr result = access_atomic_cmpxchg_at(IN_HEAP, as_BasicType(type), obj, offset, cmp, val); set_result(x, result); } // Comment copied form templateTable_i486.cpp ***************
*** 1548,1558 **** } if (needs_patching) { decorators |= C1_NEEDS_PATCHING; } ! access_store_at(decorators, field_type, object, LIR_OprFact::intConst(x->offset()), value.result(), info ? new CodeEmitInfo(info) : NULL, info); } void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { assert(x->is_pinned(),""); bool needs_range_check = x->compute_needs_range_check(); --- 1544,1555 ---- } if (needs_patching) { decorators |= C1_NEEDS_PATCHING; } ! access_store_at(decorators, field_type, object, LIR_OprFact::intConst(x->offset()), ! value.result(), info != NULL ? new CodeEmitInfo(info) : NULL, info); } void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { assert(x->is_pinned(),""); bool needs_range_check = x->compute_needs_range_check(); ***************
*** 1611,1687 **** DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; if (x->check_boolean()) { decorators |= C1_MASK_BOOLEAN; } ! access_store_at(decorators, x->elt_type(), array, index.result(), value.result(), NULL, null_check_info); } void LIRGenerator::access_load_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIR_Opr offset, LIR_Opr result, CodeEmitInfo* patch_info, CodeEmitInfo* load_emit_info) { ! BarrierSetC1 *bs = BarrierSet::barrier_set()->barrier_set_c1(); ! bool as_raw = (decorators & AS_RAW) != 0; ! if (as_raw) { ! bs->BarrierSetC1::load_at(this, decorators, type, ! base, offset, result, patch_info, load_emit_info); } else { ! bs->load_at(this, decorators, type, ! base, offset, result, patch_info, load_emit_info); } } void LIRGenerator::access_store_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIR_Opr offset, LIR_Opr value, CodeEmitInfo* patch_info, CodeEmitInfo* store_emit_info) { ! BarrierSetC1 *bs = BarrierSet::barrier_set()->barrier_set_c1(); ! bool as_raw = (decorators & AS_RAW) != 0; ! if (as_raw) { ! bs->BarrierSetC1::store_at(this, decorators, type, ! base, offset, value, patch_info, store_emit_info); } else { ! bs->store_at(this, decorators, type, ! base, offset, value, patch_info, store_emit_info); } } LIR_Opr LIRGenerator::access_atomic_cmpxchg_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIRItem& offset, LIRItem& cmp_value, LIRItem& new_value) { ! BarrierSetC1 *bs = BarrierSet::barrier_set()->barrier_set_c1(); ! bool as_raw = (decorators & AS_RAW) != 0; ! if (as_raw) { ! return bs->BarrierSetC1::atomic_cmpxchg_at(this, decorators, type, ! base, offset, cmp_value, new_value); } else { ! return bs->atomic_cmpxchg_at(this, decorators, type, ! base, offset, cmp_value, new_value); } } LIR_Opr LIRGenerator::access_atomic_xchg_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIRItem& offset, LIRItem& value) { ! BarrierSetC1 *bs = BarrierSet::barrier_set()->barrier_set_c1(); ! bool as_raw = (decorators & AS_RAW) != 0; ! if (as_raw) { ! return bs->BarrierSetC1::atomic_xchg(this, decorators, type, ! base, offset, value); } else { ! return bs->atomic_xchg(this, decorators, type, ! base, offset, value); } } LIR_Opr LIRGenerator::access_atomic_add_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIRItem& offset, LIRItem& value) { ! BarrierSetC1 *bs = BarrierSet::barrier_set()->barrier_set_c1(); ! bool as_raw = (decorators & AS_RAW) != 0; ! if (as_raw) { ! return bs->BarrierSetC1::atomic_add_at(this, decorators, type, ! base, offset, value); } else { ! return bs->atomic_add_at(this, decorators, type, ! base, offset, value); } } void LIRGenerator::do_LoadField(LoadField* x) { bool needs_patching = x->needs_patching(); --- 1608,1676 ---- DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; if (x->check_boolean()) { decorators |= C1_MASK_BOOLEAN; } ! access_store_at(decorators, x->elt_type(), array, index.result(), value.result(), ! NULL, null_check_info); } void LIRGenerator::access_load_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIR_Opr offset, LIR_Opr result, CodeEmitInfo* patch_info, CodeEmitInfo* load_emit_info) { ! LIRAccess access(this, decorators, base, offset, type, patch_info, load_emit_info); ! if (access.is_raw()) { ! _barrier_set->BarrierSetC1::load_at(access, result); } else { ! _barrier_set->load_at(access, result); } } void LIRGenerator::access_store_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIR_Opr offset, LIR_Opr value, CodeEmitInfo* patch_info, CodeEmitInfo* store_emit_info) { ! LIRAccess access(this, decorators, base, offset, type, patch_info, store_emit_info); ! if (access.is_raw()) { ! _barrier_set->BarrierSetC1::store_at(access, value); } else { ! _barrier_set->store_at(access, value); } } LIR_Opr LIRGenerator::access_atomic_cmpxchg_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIRItem& offset, LIRItem& cmp_value, LIRItem& new_value) { ! // Atomic operations are SEQ_CST by default ! decorators |= ((decorators & MO_DECORATOR_MASK) != 0) ? MO_SEQ_CST : 0; ! LIRAccess access(this, decorators, base, offset, type); ! if (access.is_raw()) { ! return _barrier_set->BarrierSetC1::atomic_cmpxchg_at(access, cmp_value, new_value); } else { ! return _barrier_set->atomic_cmpxchg_at(access, cmp_value, new_value); } } LIR_Opr LIRGenerator::access_atomic_xchg_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIRItem& offset, LIRItem& value) { ! // Atomic operations are SEQ_CST by default ! decorators |= ((decorators & MO_DECORATOR_MASK) != 0) ? MO_SEQ_CST : 0; ! LIRAccess access(this, decorators, base, offset, type); ! if (access.is_raw()) { ! return _barrier_set->BarrierSetC1::atomic_xchg(access, value); } else { ! return _barrier_set->atomic_xchg(access, value); } } LIR_Opr LIRGenerator::access_atomic_add_at(DecoratorSet decorators, BasicType type, LIRItem& base, LIRItem& offset, LIRItem& value) { ! // Atomic operations are SEQ_CST by default ! decorators |= ((decorators & MO_DECORATOR_MASK) != 0) ? MO_SEQ_CST : 0; ! LIRAccess access(this, decorators, base, offset, type); ! if (access.is_raw()) { ! return _barrier_set->BarrierSetC1::atomic_add_at(access, value); } else { ! return _barrier_set->atomic_add_at(access, value); } } void LIRGenerator::do_LoadField(LoadField* x) { bool needs_patching = x->needs_patching(); ***************
*** 2156,2167 **** decorators |= ON_UNKNOWN_OOP_REF; } LIR_Opr result = rlock_result(x, type); access_load_at(decorators, type, ! src, off.result(), result, ! NULL, NULL); } void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { BasicType type = x->basic_type(); --- 2145,2155 ---- decorators |= ON_UNKNOWN_OOP_REF; } LIR_Opr result = rlock_result(x, type); access_load_at(decorators, type, ! src, off.result(), result); } void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { BasicType type = x->basic_type(); ***************
*** 2184,2194 **** decorators |= ON_UNKNOWN_OOP_REF; } if (x->is_volatile()) { decorators |= MO_SEQ_CST; } ! access_store_at(decorators, type, src, off.result(), data.result(), NULL, NULL); } void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { BasicType type = x->basic_type(); LIRItem src(x->object(), this); --- 2172,2182 ---- decorators |= ON_UNKNOWN_OOP_REF; } if (x->is_volatile()) { decorators |= MO_SEQ_CST; } ! access_store_at(decorators, type, src, off.result(), data.result()); } void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { BasicType type = x->basic_type(); LIRItem src(x->object(), this);
< prev index next >