< prev index next >

src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp

BarrierSetC1_v3

BarrierSetC1_v2

*** 25,97 **** #include "precompiled.hpp" #include "gc/shared/c1/modRefBarrierSetC1.hpp" #include "utilities/macros.hpp" #ifdef ASSERT ! #define __ lir_generator->lir(__FILE__, __LINE__)-> #else ! #define __ lir_generator->lir()-> #endif ! void ModRefBarrierSetC1::store_at_resolved(LIRGenerator *lir_generator, DecoratorSet decorators, BasicType type, ! LIR_Opr addr, LIRItem& base, LIR_Opr offset, LIR_Opr value, ! CodeEmitInfo* patch_info, CodeEmitInfo* store_emit_info) { ! bool is_oop = type == T_OBJECT || type == T_ARRAY; bool on_array = (decorators & IN_HEAP_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; ! if (is_oop) { ! pre_barrier(lir_generator, decorators, addr, LIR_OprFact::illegalOpr /* pre_val */, patch_info); } ! BarrierSetC1::store_at_resolved(lir_generator, decorators, type, addr, base, offset, value, patch_info, store_emit_info); ! if (is_oop) { bool precise = on_array || on_anonymous; ! LIR_Opr post_addr = precise ? addr : base.result(); ! post_barrier(lir_generator, decorators, post_addr, value); } } ! LIR_Opr ModRefBarrierSetC1::atomic_cmpxchg_resolved(LIRGenerator *lir_generator, DecoratorSet decorators, BasicType type, ! LIR_Opr addr, LIRItem& base, LIRItem& offset, LIRItem& cmp_value, LIRItem& new_value) { ! bool is_oop = type == T_OBJECT || type == T_ARRAY; ! ! if (is_oop) { ! pre_barrier(lir_generator, decorators, addr, LIR_OprFact::illegalOpr /* pre_val */, NULL); } ! LIR_Opr result = BarrierSetC1::atomic_cmpxchg_resolved(lir_generator, decorators, type, addr, base, offset, cmp_value, new_value); ! if (is_oop) { ! post_barrier(lir_generator, decorators, addr, new_value.result()); } return result; } ! LIR_Opr ModRefBarrierSetC1::atomic_xchg_resolved(LIRGenerator* lir_generator, DecoratorSet decorators, BasicType type, ! LIR_Opr addr, LIRItem& base, LIRItem& offset, LIRItem& value) { ! bool is_oop = type == T_OBJECT || type == T_ARRAY; ! ! if (is_oop) { ! pre_barrier(lir_generator, decorators, addr, LIR_OprFact::illegalOpr /* pre_val */, NULL); } ! LIR_Opr result = BarrierSetC1::atomic_xchg_resolved(lir_generator, decorators, type, addr, base, offset, value); ! if (is_oop) { ! post_barrier(lir_generator, decorators, addr, value.result()); } return result; } ! // This overrides the default to resolve the address into a register, assuming it will be used by a write barrier ! void ModRefBarrierSetC1::store_at(LIRGenerator *lir_generator, DecoratorSet decorators, BasicType type, ! LIRItem& base, LIR_Opr offset, LIR_Opr value, ! CodeEmitInfo* patch_info, CodeEmitInfo* store_emit_info) { ! bool is_oop = type == T_OBJECT || type == T_ARRAY; bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; ! LIR_Opr addr = resolve_address(lir_generator, decorators, type, base, offset, !needs_patching && is_oop); ! store_at_resolved(lir_generator, decorators, type, addr, base, offset, value, patch_info, store_emit_info); } --- 25,91 ---- #include "precompiled.hpp" #include "gc/shared/c1/modRefBarrierSetC1.hpp" #include "utilities/macros.hpp" #ifdef ASSERT ! #define __ gen->lir(__FILE__, __LINE__)-> #else ! #define __ gen->lir()-> #endif ! void ModRefBarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) { ! DecoratorSet decorators = access.decorators(); bool on_array = (decorators & IN_HEAP_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; ! if (access.is_oop()) { ! pre_barrier(access, access.resolved_addr(), ! LIR_OprFact::illegalOpr /* pre_val */, access.patch_info()); } ! BarrierSetC1::store_at_resolved(access, value); ! if (access.is_oop()) { bool precise = on_array || on_anonymous; ! LIR_Opr post_addr = precise ? access.resolved_addr() : access.base().opr(); ! post_barrier(access, post_addr, value); } } ! LIR_Opr ModRefBarrierSetC1::atomic_cmpxchg_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value) { ! if (access.is_oop()) { ! pre_barrier(access, access.resolved_addr(), ! LIR_OprFact::illegalOpr /* pre_val */, NULL); } ! LIR_Opr result = BarrierSetC1::atomic_cmpxchg_resolved(access, cmp_value, new_value); ! if (access.is_oop()) { ! post_barrier(access, access.resolved_addr(), new_value.result()); } return result; } ! LIR_Opr ModRefBarrierSetC1::atomic_xchg_resolved(LIRAccess& access, LIRItem& value) { ! if (access.is_oop()) { ! pre_barrier(access, access.resolved_addr(), ! LIR_OprFact::illegalOpr /* pre_val */, NULL); } ! LIR_Opr result = BarrierSetC1::atomic_xchg_resolved(access, value); ! if (access.is_oop()) { ! post_barrier(access, access.resolved_addr(), value.result()); } return result; } ! // This overrides the default to resolve the address into a register, ! // assuming it will be used by a write barrier anyway. ! LIR_Opr ModRefBarrierSetC1::resolve_address(LIRAccess& access, bool resolve_in_register) { ! DecoratorSet decorators = access.decorators(); bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; ! resolve_in_register |= !needs_patching && access.is_oop(); ! return BarrierSetC1::resolve_address(access, resolve_in_register); }
< prev index next >