8202676: AArch64: Missing enter/leave around barrier leads to infinite loop

Reviewed-by: aph, eosterlund
This commit is contained in:
Roman Kennke 2018-05-06 00:42:59 +02:00
parent e6bccc9d86
commit 97ff2fce38
3 changed files with 8 additions and 0 deletions

@ -259,6 +259,8 @@ void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorator
bool on_reference = on_weak || on_phantom;
ModRefBarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread);
if (on_oop && on_reference) {
// LR is live. It must be saved around calls.
__ enter(); // barrier may call runtime
// Generate the G1 pre-barrier code to log the value of
// the referent field in an SATB buffer.
g1_write_barrier_pre(masm /* masm */,
@ -268,6 +270,7 @@ void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorator
tmp1 /* tmp */,
true /* tosca_live */,
true /* expand_call */);
__ leave();
}
}

@ -30,6 +30,9 @@
void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
Register dst, Address src, Register tmp1, Register tmp_thread) {
// LR is live. It must be saved around calls.
bool on_heap = (decorators & IN_HEAP) != 0;
bool on_root = (decorators & IN_ROOT) != 0;
switch (type) {

@ -918,6 +918,8 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
// rmethod: Method*
// r13: senderSP must preserve for slow path, set SP to it on fast path
// LR is live. It must be saved around calls.
address entry = __ pc();
const int referent_offset = java_lang_ref_Reference::referent_offset;