< prev index next >

src/hotspot/cpu/arm/macroAssembler_arm.cpp

Print this page
rev 52777 : 8214512: ARM32: Jtreg test compiler/c2/Test8062950.java fails on ARM
Summary: fix assertion failures with -XX:-OptoBiasInlining
Reviewed-by: duke
Contributed-by: nick.gasson@arm.com


1954   decorators = AccessInternal::decorator_fixup(decorators);
1955   bool as_raw = (decorators & AS_RAW) != 0;
1956   if (as_raw) {
1957     bs->BarrierSetAssembler::store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);
1958   } else {
1959     bs->store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);
1960   }
1961 }
1962 
1963 void MacroAssembler::resolve(DecoratorSet decorators, Register obj) {
1964   // Use stronger ACCESS_WRITE|ACCESS_READ by default.
1965   if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
1966     decorators |= ACCESS_READ | ACCESS_WRITE;
1967   }
1968   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1969   return bs->resolve(this, decorators, obj);
1970 }
1971 
1972 
1973 #ifdef COMPILER2
1974 void MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratch, Register Rscratch2)
1975 {
1976   assert(VM_Version::supports_ldrex(), "unsupported, yet?");
1977 
1978   Register Rmark      = Rscratch2;
1979 
1980   assert(Roop != Rscratch, "");
1981   assert(Roop != Rmark, "");
1982   assert(Rbox != Rscratch, "");
1983   assert(Rbox != Rmark, "");
1984 
1985   Label fast_lock, done;
1986 
1987   if (UseBiasedLocking && !UseOptoBiasInlining) {
1988     Label failed;
1989     biased_locking_enter(Roop, Rmark, Rscratch, false, noreg, done, failed);
1990     bind(failed);
1991   }


1992 
1993   ldr(Rmark, Address(Roop, oopDesc::mark_offset_in_bytes()));
1994   tst(Rmark, markOopDesc::unlocked_value);
1995   b(fast_lock, ne);
1996 
1997   // Check for recursive lock
1998   // See comments in InterpreterMacroAssembler::lock_object for
1999   // explanations on the fast recursive locking check.
2000   // -1- test low 2 bits
2001   movs(Rscratch, AsmOperand(Rmark, lsl, 30));
2002   // -2- test (hdr - SP) if the low two bits are 0
2003   sub(Rscratch, Rmark, SP, eq);
2004   movs(Rscratch, AsmOperand(Rscratch, lsr, exact_log2(os::vm_page_size())), eq);
2005   // If still 'eq' then recursive locking OK
2006   // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107)
2007   str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
2008   b(done);
2009 
2010   bind(fast_lock);
2011   str(Rmark, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));




1954   decorators = AccessInternal::decorator_fixup(decorators);
1955   bool as_raw = (decorators & AS_RAW) != 0;
1956   if (as_raw) {
1957     bs->BarrierSetAssembler::store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);
1958   } else {
1959     bs->store_at(this, decorators, type, obj, new_val, tmp1, tmp2, tmp3, is_null);
1960   }
1961 }
1962 
1963 void MacroAssembler::resolve(DecoratorSet decorators, Register obj) {
1964   // Use stronger ACCESS_WRITE|ACCESS_READ by default.
1965   if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
1966     decorators |= ACCESS_READ | ACCESS_WRITE;
1967   }
1968   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1969   return bs->resolve(this, decorators, obj);
1970 }
1971 
1972 
1973 #ifdef COMPILER2
1974 void MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratch, Register Rscratch2, Register scratch3)
1975 {
1976   assert(VM_Version::supports_ldrex(), "unsupported, yet?");
1977 
1978   Register Rmark      = Rscratch2;
1979 
1980   assert(Roop != Rscratch, "");
1981   assert(Roop != Rmark, "");
1982   assert(Rbox != Rscratch, "");
1983   assert(Rbox != Rmark, "");
1984 
1985   Label fast_lock, done;
1986 
1987   if (UseBiasedLocking && !UseOptoBiasInlining) {
1988     assert(scratch3 != noreg, "need extra temporary for -XX:-UseOptoBiasInlining");
1989     biased_locking_enter(Roop, Rmark, Rscratch, false, scratch3, done, done);
1990     // Fall through if lock not biased otherwise branch to done
1991   }
1992 
1993   // Invariant: Rmark loaded below does not contain biased lock pattern
1994 
1995   ldr(Rmark, Address(Roop, oopDesc::mark_offset_in_bytes()));
1996   tst(Rmark, markOopDesc::unlocked_value);
1997   b(fast_lock, ne);
1998 
1999   // Check for recursive lock
2000   // See comments in InterpreterMacroAssembler::lock_object for
2001   // explanations on the fast recursive locking check.
2002   // -1- test low 2 bits
2003   movs(Rscratch, AsmOperand(Rmark, lsl, 30));
2004   // -2- test (hdr - SP) if the low two bits are 0
2005   sub(Rscratch, Rmark, SP, eq);
2006   movs(Rscratch, AsmOperand(Rscratch, lsr, exact_log2(os::vm_page_size())), eq);
2007   // If still 'eq' then recursive locking OK
2008   // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107)
2009   str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
2010   b(done);
2011 
2012   bind(fast_lock);
2013   str(Rmark, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));


< prev index next >