< prev index next >

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Print this page
*** 43,10 ***
--- 43,33 ---
  
  #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
  
  typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
  
+ void C2_MacroAssembler::entry_barrier() {
+   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+   if (BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
+     // Dummy labels for just measuring the code size
+     Label dummy_slow_path;
+     Label dummy_continuation;
+     Label dummy_guard;
+     Label* slow_path = &dummy_slow_path;
+     Label* continuation = &dummy_continuation;
+     Label* guard = &dummy_guard;
+     if (!Compile::current()->output()->in_scratch_emit_size()) {
+       // Use real labels from actual stub when not emitting code for the purpose of measuring its size
+       C2EntryBarrierStub* stub = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
+       Compile::current()->output()->add_stub(stub);
+       slow_path = &stub->entry();
+       continuation = &stub->continuation();
+       guard = &stub->guard();
+     }
+     // In the C2 code, we move the non-hot part of nmethod entry barriers out-of-line to a stub.
+     bs->nmethod_entry_barrier(this, slow_path, continuation, guard);
+   }
+ }
+ 
  void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register tmpReg,
                                    Register tmp2Reg, Register tmp3Reg) {
    Register oop = objectReg;
    Register box = boxReg;
    Register disp_hdr = tmpReg;

*** 75,10 ***
--- 98,15 ---
      b(cont);
    } else if (LockingMode == LM_LEGACY) {
      // Set tmp to be (markWord of object | UNLOCK_VALUE).
      orr(tmp, disp_hdr, markWord::unlocked_value);
  
+     if (EnableValhalla) {
+       // Mask inline_type bit such that we go to the slow path if object is an inline type
+       andr(tmp, tmp, ~((int) markWord::inline_type_bit_in_place));
+     }
+ 
      // Initialize the box. (Must happen before we update the object mark!)
      str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes()));
  
      // Compare object markWord with an unlocked value (tmp) and if
      // equal exchange the stack address of our box with object markWord.
< prev index next >