8186611: s390: Add missing compiler barriers and fix assembler

Reviewed-by: goetz
This commit is contained in:
Martin Doerr 2017-08-23 10:25:25 +02:00
parent 0c8dc55148
commit 61a9f88ca7
3 changed files with 24 additions and 21 deletions

View File

@ -246,8 +246,8 @@ inline void Assembler::z_mvcle(Register r1, Register r3, int64_t d2, Register b2
inline void Assembler::z_mvhhi( int64_t d1, Register b1, int64_t i2) { emit_48( MVHHI_ZOPC | uimm12( d1, 20, 48) | regz(b1, 16, 48) | simm16(i2, 32, 48)); }
inline void Assembler::z_mvhi ( int64_t d1, Register b1, int64_t i2) { emit_48( MVHI_ZOPC | uimm12( d1, 20, 48) | regz(b1, 16, 48) | simm16(i2, 32, 48)); }
inline void Assembler::z_mvghi( int64_t d1, Register b1, int64_t i2) { emit_48( MVGHI_ZOPC | uimm12( d1, 20, 48) | regz(b1, 16, 48) | simm16(i2, 32, 48)); }
inline void Assembler::z_mvhhi( const Address &d, int64_t i2) { assert(!d.has_index(), " no index reg allowed in MVHHI"); z_mvghi( d.disp(), d.baseOrR0(), i2); }
inline void Assembler::z_mvhi ( const Address &d, int64_t i2) { assert(!d.has_index(), " no index reg allowed in MVHI"); z_mvghi( d.disp(), d.baseOrR0(), i2); }
inline void Assembler::z_mvhhi( const Address &d, int64_t i2) { assert(!d.has_index(), " no index reg allowed in MVHHI"); z_mvhhi( d.disp(), d.baseOrR0(), i2); }
inline void Assembler::z_mvhi ( const Address &d, int64_t i2) { assert(!d.has_index(), " no index reg allowed in MVHI"); z_mvhi( d.disp(), d.baseOrR0(), i2); }
inline void Assembler::z_mvghi( const Address &d, int64_t i2) { assert(!d.has_index(), " no index reg allowed in MVGHI"); z_mvghi( d.disp(), d.baseOrR0(), i2); }
inline void Assembler::z_ex(Register r1, int64_t d2, Register x2, Register b2) { emit_32( EX_ZOPC | regz(r1, 8, 32) | uimm12(d2, 20, 32) | reg(x2, 12, 32) | regz(b2, 16, 32)); }

View File

@ -105,15 +105,18 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub());
NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
#ifdef ASSERT
// A generated lambda form might be deleted from the Lambdaform
// cache in MethodTypeForm. If a jit compiled lambdaform method
// becomes not entrant and the cache access returns null, the new
// resolve will lead to a new generated LambdaForm.
assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee() || callee->is_compiled_lambda_form(),
volatile intptr_t data = method_holder->data();
volatile address destination = jump->jump_destination();
assert(data == 0 || data == (intptr_t)callee() || callee->is_compiled_lambda_form(),
"a) MT-unsafe modification of inline cache");
assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry,
assert(destination == (address)-1 || destination == entry,
"b) MT-unsafe modification of inline cache");
#endif
// Update stub.
method_holder->set_data((intptr_t)callee());

View File

@ -105,7 +105,7 @@ inline jint Atomic::add(jint inc, volatile jint*dest) {
//---< inputs >---
: [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc", "r0", "r2", "r3"
: "cc", "r0", "r2", "r3", "memory"
);
} else {
__asm__ __volatile__ (
@ -120,7 +120,7 @@ inline jint Atomic::add(jint inc, volatile jint*dest) {
//---< inputs >---
: [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc"
: "cc", "memory"
);
}
@ -151,7 +151,7 @@ inline intptr_t Atomic::add_ptr(intptr_t inc, volatile intptr_t* dest) {
//---< inputs >---
: [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc", "r0", "r2", "r3"
: "cc", "r0", "r2", "r3", "memory"
);
} else {
__asm__ __volatile__ (
@ -166,7 +166,7 @@ inline intptr_t Atomic::add_ptr(intptr_t inc, volatile intptr_t* dest) {
//---< inputs >---
: [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc"
: "cc", "memory"
);
}
@ -214,7 +214,7 @@ inline void Atomic::inc(volatile jint* dest) {
:
// : [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc", "r2", "r3"
: "cc", "r2", "r3", "memory"
);
} else {
__asm__ __volatile__ (
@ -229,7 +229,7 @@ inline void Atomic::inc(volatile jint* dest) {
//---< inputs >---
:
//---< clobbered >---
: "cc"
: "cc", "memory"
);
}
}
@ -258,7 +258,7 @@ inline void Atomic::inc_ptr(volatile intptr_t* dest) {
:
// : [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc", "r2", "r3"
: "cc", "r2", "r3", "memory"
);
} else {
__asm__ __volatile__ (
@ -273,7 +273,7 @@ inline void Atomic::inc_ptr(volatile intptr_t* dest) {
//---< inputs >---
:
//---< clobbered >---
: "cc"
: "cc", "memory"
);
}
}
@ -317,7 +317,7 @@ inline void Atomic::dec(volatile jint* dest) {
:
// : [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc", "r2", "r3"
: "cc", "r2", "r3", "memory"
);
} else {
__asm__ __volatile__ (
@ -335,7 +335,7 @@ inline void Atomic::dec(volatile jint* dest) {
//---< inputs >---
:
//---< clobbered >---
: "cc"
: "cc", "memory"
);
}
}
@ -364,7 +364,7 @@ inline void Atomic::dec_ptr(volatile intptr_t* dest) {
:
// : [inc] "a" (inc) // read-only.
//---< clobbered >---
: "cc", "r2", "r3"
: "cc", "r2", "r3", "memory"
);
} else {
__asm__ __volatile__ (
@ -382,7 +382,7 @@ inline void Atomic::dec_ptr(volatile intptr_t* dest) {
//---< inputs >---
:
//---< clobbered >---
: "cc"
: "cc", "memory"
);
}
}
@ -420,7 +420,7 @@ inline jint Atomic::xchg (jint xchg_val, volatile jint* dest) {
//---< inputs >---
: [upd] "d" (xchg_val) // read-only, value to be written to memory
//---< clobbered >---
: "cc"
: "cc", "memory"
);
return (jint)old;
@ -439,7 +439,7 @@ inline intptr_t Atomic::xchg_ptr(intptr_t xchg_val, volatile intptr_t* dest) {
//---< inputs >---
: [upd] "d" (xchg_val) // read-only, value to be written to memory
//---< clobbered >---
: "cc"
: "cc", "memory"
);
return (intptr_t)old;
@ -490,7 +490,7 @@ jint Atomic::cmpxchg(jint xchg_val, volatile jint* dest, jint cmp_val, cmpxchg_m
: [upd] "d" (xchg_val)
, "0" (cmp_val) // Read-only, initial value for [old] (operand #0).
// clobbered
: "cc"
: "cc", "memory"
);
return (jint)old;
@ -508,7 +508,7 @@ jlong Atomic::cmpxchg(jlong xchg_val, volatile jlong* dest, jlong cmp_val, cmpxc
: [upd] "d" (xchg_val)
, "0" (cmp_val) // Read-only, initial value for [old] (operand #0).
// clobbered
: "cc"
: "cc", "memory"
);
return (jlong)old;