8203353: Fixup inferred decorators in the interpreter

Reviewed-by: rkennke, coleenp
This commit is contained in:
Erik Österlund 2018-06-07 15:10:06 +02:00
parent 66f8951e15
commit 9f39d8c408
9 changed files with 34 additions and 17 deletions

@ -37,6 +37,7 @@
#include "compiler/disassembler.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_aarch64.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.hpp"
@ -2127,7 +2128,7 @@ void MacroAssembler::resolve_jobject(Register value, Register thread, Register t
bind(not_weak);
// Resolve (untagged) jobject.
bs->load_at(this, IN_ROOT | IN_CONCURRENT_ROOT, T_OBJECT,
bs->load_at(this, IN_CONCURRENT_ROOT, T_OBJECT,
value, Address(value, 0), tmp, thread);
verify_oop(value);
bind(done);
@ -3664,7 +3665,7 @@ void MacroAssembler::load_klass(Register dst, Register src) {
void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
// OopHandle::resolve is an indirection.
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->load_at(this, IN_ROOT | IN_CONCURRENT_ROOT, T_OBJECT,
bs->load_at(this, IN_CONCURRENT_ROOT, T_OBJECT,
result, Address(result, 0), tmp, rthread);
}
@ -3983,6 +3984,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
Register dst, Address src,
Register tmp1, Register thread_tmp) {
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
@ -3995,6 +3997,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
Address dst, Register src,
Register tmp1, Register thread_tmp) {
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, src, tmp1, thread_tmp);

@ -813,7 +813,7 @@ void TemplateTable::aaload()
do_oop_load(_masm,
Address(r1, arrayOopDesc::base_offset_in_bytes(T_OBJECT)),
r0,
IN_HEAP | IN_HEAP_ARRAY);
IN_HEAP_ARRAY);
}
void TemplateTable::baload()
@ -1141,7 +1141,7 @@ void TemplateTable::aastore() {
// Get the value we will store
__ ldr(r0, at_tos());
// Now store using the appropriate barrier
do_oop_store(_masm, element_address, r0, IN_HEAP | IN_HEAP_ARRAY);
do_oop_store(_masm, element_address, r0, IN_HEAP_ARRAY);
__ b(done);
// Have a NULL in r0, r3=array, r2=index. Store NULL at ary[idx]
@ -1149,7 +1149,7 @@ void TemplateTable::aastore() {
__ profile_null_seen(r2);
// Store a NULL
do_oop_store(_masm, element_address, noreg, IN_HEAP | IN_HEAP_ARRAY);
do_oop_store(_masm, element_address, noreg, IN_HEAP_ARRAY);
// Pop stack arguments
__ bind(done);

@ -36,6 +36,7 @@
#include "gc/shared/collectedHeap.inline.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/klass.inline.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/biasedLocking.hpp"
@ -2133,7 +2134,7 @@ void MacroAssembler::resolve_jobject(Register value,
b(done);
bind(not_weak);
// Resolve (untagged) jobject.
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
Address(value, 0), value, tmp1, tmp2, noreg);
verify_oop(value);
bind(done);
@ -2700,6 +2701,7 @@ void MacroAssembler::store_heap_oop_null(Address obj, Register new_val, Register
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
Address src, Register dst, Register tmp1, Register tmp2, Register tmp3) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, tmp2, tmp3);
@ -2711,6 +2713,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);

@ -32,6 +32,7 @@
#include "code/codeCache.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "oops/accessDecorators.hpp"
#include "runtime/safepointMechanism.hpp"
inline bool MacroAssembler::is_ld_largeoffset(address a) {
@ -332,6 +333,7 @@ inline void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorat
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bool as_raw = (decorators & AS_RAW) != 0;
decorators = AccessInternal::decorator_fixup(decorators);
if (as_raw) {
bs->BarrierSetAssembler::store_at(this, decorators, type,
base, ind_or_offs, val,
@ -349,6 +351,7 @@ inline void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorato
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::load_at(this, decorators, type,

@ -688,7 +688,7 @@ void TemplateTable::aaload() {
Rtemp2 = R31;
__ index_check(Rarray, R17_tos /* index */, UseCompressedOops ? 2 : LogBytesPerWord, Rtemp, Rload_addr);
do_oop_load(_masm, Rload_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos, Rtemp, Rtemp2,
IN_HEAP | IN_HEAP_ARRAY);
IN_HEAP_ARRAY);
__ verify_oop(R17_tos);
//__ dcbt(R17_tos); // prefetch
}
@ -1015,14 +1015,14 @@ void TemplateTable::aastore() {
__ bind(Lis_null);
do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), noreg /* 0 */,
Rscratch, Rscratch2, Rscratch3, IN_HEAP | IN_HEAP_ARRAY);
Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY);
__ profile_null_seen(Rscratch, Rscratch2);
__ b(Ldone);
// Store is OK.
__ bind(Lstore_ok);
do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos /* value */,
Rscratch, Rscratch2, Rscratch3, IN_HEAP | IN_HEAP_ARRAY | OOP_NOT_NULL);
Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY | OOP_NOT_NULL);
__ bind(Ldone);
// Adjust sp (pops array, index and value).

@ -34,6 +34,7 @@
#include "gc/shared/cardTableBarrierSet.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#include "opto/compile.hpp"
@ -4053,6 +4054,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::store_at(this, decorators, type,
@ -4071,6 +4073,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::load_at(this, decorators, type,

@ -853,7 +853,7 @@ void TemplateTable::aaload() {
index_check(Z_tmp_1, index, shift);
// Now load array element.
do_oop_load(_masm, Address(Z_tmp_1, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), Z_tos,
Z_tmp_2, Z_tmp_3, IN_HEAP | IN_HEAP_ARRAY);
Z_tmp_2, Z_tmp_3, IN_HEAP_ARRAY);
__ verify_oop(Z_tos);
}
@ -1197,7 +1197,7 @@ void TemplateTable::aastore() {
// Store a NULL.
do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), noreg,
tmp3, tmp2, tmp1, IN_HEAP | IN_HEAP_ARRAY);
tmp3, tmp2, tmp1, IN_HEAP_ARRAY);
__ z_bru(done);
// Come here on success.
@ -1205,7 +1205,7 @@ void TemplateTable::aastore() {
// Now store using the appropriate barrier.
do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), Rvalue,
tmp3, tmp2, tmp1, IN_HEAP | IN_HEAP_ARRAY | OOP_NOT_NULL);
tmp3, tmp2, tmp1, IN_HEAP_ARRAY | OOP_NOT_NULL);
// Pop stack arguments.
__ bind(done);

@ -32,6 +32,7 @@
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/klass.inline.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/biasedLocking.hpp"
@ -181,7 +182,7 @@ void MacroAssembler::resolve_jobject(Register value, Register tmp) {
br (Assembler::always, true, Assembler::pt, done);
delayed()->nop();
bind(not_weak);
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
Address(value, 0), value, tmp);
verify_oop(value);
bind(done);
@ -3401,7 +3402,7 @@ void MacroAssembler::reserved_stack_check() {
// ((OopHandle)result).resolve();
void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
// OopHandle::resolve is an indirection.
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
Address(result, 0), result, tmp);
}
@ -3446,6 +3447,7 @@ void MacroAssembler::store_klass_gap(Register s, Register d) {
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
Register src, Address dst, Register tmp) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::store_at(this, decorators, type, src, dst, tmp);
@ -3457,6 +3459,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
Address src, Register dst, Register tmp) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::load_at(this, decorators, type, src, dst, tmp);

@ -33,7 +33,7 @@
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/access.hpp"
#include "oops/accessDecorators.hpp"
#include "oops/klass.inline.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/biasedLocking.hpp"
@ -5259,7 +5259,7 @@ void MacroAssembler::resolve_jobject(Register value,
jmp(done);
bind(not_weak);
// Resolve (untagged) jobject.
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
value, Address(value, 0), tmp, thread);
verify_oop(value);
bind(done);
@ -6281,7 +6281,7 @@ void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
// Only 64 bit platforms support GCs that require a tmp register
// Only IN_HEAP loads require a thread_tmp register
// OopHandle::resolve is an indirection like jobject.
access_load_at(T_OBJECT, IN_ROOT | IN_CONCURRENT_ROOT,
access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
result, Address(result, 0), tmp, /*tmp_thread*/noreg);
}
@ -6323,6 +6323,7 @@ void MacroAssembler::store_klass(Register dst, Register src) {
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
Register tmp1, Register thread_tmp) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::load_at(this, decorators, type, dst, src, tmp1, thread_tmp);
@ -6334,6 +6335,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Reg
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
Register tmp1, Register tmp2) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
decorators = AccessInternal::decorator_fixup(decorators);
bool as_raw = (decorators & AS_RAW) != 0;
if (as_raw) {
bs->BarrierSetAssembler::store_at(this, decorators, type, dst, src, tmp1, tmp2);