Skip to content

Commit 085f96c

Browse files
committed
8295258: Add BasicType argument to AccessInternal::decorator_fixup
Reviewed-by: stefank, eosterlund
1 parent 1c2a093 commit 085f96c

File tree

9 files changed

+19
-17
lines changed

9 files changed

+19
-17
lines changed

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4387,7 +4387,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
43874387
Register dst, Address src,
43884388
Register tmp1, Register tmp2) {
43894389
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
4390-
decorators = AccessInternal::decorator_fixup(decorators);
4390+
decorators = AccessInternal::decorator_fixup(decorators, type);
43914391
bool as_raw = (decorators & AS_RAW) != 0;
43924392
if (as_raw) {
43934393
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, tmp2);
@@ -4400,7 +4400,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
44004400
Address dst, Register val,
44014401
Register tmp1, Register tmp2, Register tmp3) {
44024402
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
4403-
decorators = AccessInternal::decorator_fixup(decorators);
4403+
decorators = AccessInternal::decorator_fixup(decorators, type);
44044404
bool as_raw = (decorators & AS_RAW) != 0;
44054405
if (as_raw) {
44064406
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, val, tmp1, tmp2, tmp3);

src/hotspot/cpu/arm/macroAssembler_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ void MacroAssembler::store_heap_oop_null(Address obj, Register new_val, Register
16431643
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
16441644
Address src, Register dst, Register tmp1, Register tmp2, Register tmp3) {
16451645
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1646-
decorators = AccessInternal::decorator_fixup(decorators);
1646+
decorators = AccessInternal::decorator_fixup(decorators, type);
16471647
bool as_raw = (decorators & AS_RAW) != 0;
16481648
if (as_raw) {
16491649
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, tmp2, tmp3);
@@ -1655,7 +1655,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
16551655
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
16561656
Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null) {
16571657
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1658-
decorators = AccessInternal::decorator_fixup(decorators);
1658+
decorators = AccessInternal::decorator_fixup(decorators, type);
16591659
bool as_raw = (decorators & AS_RAW) != 0;
16601660
if (as_raw) {
16611661
bs->BarrierSetAssembler::store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);

src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ inline void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorat
357357
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
358358
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
359359
bool as_raw = (decorators & AS_RAW) != 0;
360-
decorators = AccessInternal::decorator_fixup(decorators);
360+
decorators = AccessInternal::decorator_fixup(decorators, type);
361361
if (as_raw) {
362362
bs->BarrierSetAssembler::store_at(this, decorators, type,
363363
base, ind_or_offs, val,
@@ -377,7 +377,7 @@ inline void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorato
377377
assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL |
378378
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
379379
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
380-
decorators = AccessInternal::decorator_fixup(decorators);
380+
decorators = AccessInternal::decorator_fixup(decorators, type);
381381
bool as_raw = (decorators & AS_RAW) != 0;
382382
if (as_raw) {
383383
bs->BarrierSetAssembler::load_at(this, decorators, type,

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
19931993
Register dst, Address src,
19941994
Register tmp1, Register tmp2) {
19951995
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
1996-
decorators = AccessInternal::decorator_fixup(decorators);
1996+
decorators = AccessInternal::decorator_fixup(decorators, type);
19971997
bool as_raw = (decorators & AS_RAW) != 0;
19981998
if (as_raw) {
19991999
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, tmp2);
@@ -2018,7 +2018,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
20182018
Address dst, Register val,
20192019
Register tmp1, Register tmp2, Register tmp3) {
20202020
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
2021-
decorators = AccessInternal::decorator_fixup(decorators);
2021+
decorators = AccessInternal::decorator_fixup(decorators, type);
20222022
bool as_raw = (decorators & AS_RAW) != 0;
20232023
if (as_raw) {
20242024
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, val, tmp1, tmp2, tmp3);

src/hotspot/cpu/s390/macroAssembler_s390.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3858,7 +3858,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
38583858
assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL |
38593859
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
38603860
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
3861-
decorators = AccessInternal::decorator_fixup(decorators);
3861+
decorators = AccessInternal::decorator_fixup(decorators, type);
38623862
bool as_raw = (decorators & AS_RAW) != 0;
38633863
if (as_raw) {
38643864
bs->BarrierSetAssembler::store_at(this, decorators, type,
@@ -3877,7 +3877,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
38773877
assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL |
38783878
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
38793879
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
3880-
decorators = AccessInternal::decorator_fixup(decorators);
3880+
decorators = AccessInternal::decorator_fixup(decorators, type);
38813881
bool as_raw = (decorators & AS_RAW) != 0;
38823882
if (as_raw) {
38833883
bs->BarrierSetAssembler::load_at(this, decorators, type,

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5108,7 +5108,7 @@ void MacroAssembler::store_klass(Register dst, Register src, Register tmp) {
51085108
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
51095109
Register tmp1, Register thread_tmp) {
51105110
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
5111-
decorators = AccessInternal::decorator_fixup(decorators);
5111+
decorators = AccessInternal::decorator_fixup(decorators, type);
51125112
bool as_raw = (decorators & AS_RAW) != 0;
51135113
if (as_raw) {
51145114
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
@@ -5120,7 +5120,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Reg
51205120
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register val,
51215121
Register tmp1, Register tmp2, Register tmp3) {
51225122
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
5123-
decorators = AccessInternal::decorator_fixup(decorators);
5123+
decorators = AccessInternal::decorator_fixup(decorators, type);
51245124
bool as_raw = (decorators & AS_RAW) != 0;
51255125
if (as_raw) {
51265126
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, val, tmp1, tmp2, tmp3);

src/hotspot/share/gc/shared/c1/barrierSetC1.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class LIRAccess: public StackObj {
7676
LIRAddressOpr base, LIRAddressOpr offset, BasicType type,
7777
CodeEmitInfo* patch_emit_info = NULL, CodeEmitInfo* access_emit_info = NULL) :
7878
_gen(gen),
79-
_decorators(AccessInternal::decorator_fixup(decorators)),
79+
_decorators(AccessInternal::decorator_fixup(decorators, type)),
8080
_base(base),
8181
_offset(offset),
8282
_type(type),

src/hotspot/share/gc/shared/c2/barrierSetC2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void C2Access::fixup_decorators() {
358358
_decorators |= MO_RELAXED; // Force the MO_RELAXED decorator with AlwaysAtomicAccess
359359
}
360360

361-
_decorators = AccessInternal::decorator_fixup(_decorators);
361+
_decorators = AccessInternal::decorator_fixup(_decorators, _type);
362362

363363
if (is_read && !is_write && anonymous) {
364364
// To be valid, unsafe loads may depend on other conditions than

src/hotspot/share/oops/accessDecorators.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,12 @@ namespace AccessInternal {
236236

237237
// This function implements the above DecoratorFixup rules, but without meta
238238
// programming for code generation that does not use templates.
239-
inline DecoratorSet decorator_fixup(DecoratorSet input_decorators) {
239+
inline DecoratorSet decorator_fixup(DecoratorSet input_decorators, BasicType type) {
240+
// Some call-sites don't specify that the access is performed on oops
241+
DecoratorSet with_oop_decorators = input_decorators |= (is_reference_type(type) ? INTERNAL_VALUE_IS_OOP : 0);
240242
// If no reference strength has been picked, then strong will be picked
241-
DecoratorSet ref_strength_default = input_decorators |
242-
(((ON_DECORATOR_MASK & input_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?
243+
DecoratorSet ref_strength_default = with_oop_decorators |
244+
(((ON_DECORATOR_MASK & with_oop_decorators) == 0 && (INTERNAL_VALUE_IS_OOP & input_decorators) != 0) ?
243245
ON_STRONG_OOP_REF : DECORATORS_NONE);
244246
// If no memory ordering has been picked, unordered will be picked
245247
DecoratorSet memory_ordering_default = ref_strength_default |

0 commit comments

Comments
 (0)