< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page
@@ -43,11 +43,15 @@
  #define BLOCK_COMMENT(str) block_comment(str)
  #define STOP(error) block_comment(error); stop(error)
  #endif
  
  // C2 compiled method's prolog code.
- void C2_MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b, bool is_stub) {
+ void C2_MacroAssembler::verified_entry(Compile* C, int sp_inc) {
+   int framesize = C->output()->frame_size_in_bytes();
+   int bangsize = C->output()->bang_size_in_bytes();
+   bool fp_mode_24b = false;
+   int stack_bang_size = C->output()->need_stack_bang(bangsize) ? bangsize : 0;
  
    // WARNING: Initial instruction MUST be 5 bytes or longer so that
    // NativeJump::patch_verified_entry will be able to patch out the entry
    // code safely. The push to verify stack depth is ok at 5 bytes,
    // the frame allocation can be either 3 or 6 bytes. So if we don't do

@@ -96,10 +100,16 @@
          addptr(rbp, framesize);
        }
      }
    }
  
+   if (C->needs_stack_repair()) {
+     // Save stack increment just below the saved rbp (also account for fixed framesize and rbp)
+     assert((sp_inc & (StackAlignmentInBytes-1)) == 0, "stack increment not aligned");
+     movptr(Address(rsp, framesize - wordSize), sp_inc + framesize + wordSize);
+   }
+ 
    if (VerifyStackAtCalls) { // Majik cookie to verify stack depth
      framesize -= wordSize;
      movptr(Address(rsp, framesize), (int32_t)0xbadb100d);
    }
  

@@ -124,33 +134,10 @@
      jcc(Assembler::equal, L);
      STOP("Stack is not properly aligned!");
      bind(L);
    }
  #endif
- 
-   if (!is_stub) {
-     BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
-  #ifdef _LP64
-     if (BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
-       // We put the non-hot code of the nmethod entry barrier out-of-line in a stub.
-       Label dummy_slow_path;
-       Label dummy_continuation;
-       Label* slow_path = &dummy_slow_path;
-       Label* continuation = &dummy_continuation;
-       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 = Compile::current()->output()->entry_barrier_table()->add_entry_barrier();
-         slow_path = &stub->slow_path();
-         continuation = &stub->continuation();
-       }
-       bs->nmethod_entry_barrier(this, slow_path, continuation);
-     }
- #else
-     // Don't bother with out-of-line nmethod entry barrier stub for x86_32.
-     bs->nmethod_entry_barrier(this, NULL /* slow_path */, NULL /* continuation */);
- #endif
-   }
  }
  
  void C2_MacroAssembler::emit_entry_barrier_stub(C2EntryBarrierStub* stub) {
    bind(stub->slow_path());
    call(RuntimeAddress(StubRoutines::x86::method_entry_barrier()));

@@ -610,10 +597,14 @@
    jccb(Assembler::notZero, IsInflated);
  
    if (!UseHeavyMonitors) {
      // Attempt stack-locking ...
      orptr (tmpReg, markWord::unlocked_value);
+     if (EnableValhalla) {
+       // Mask inline_type bit such that we go to the slow path if object is an inline type
+       andptr(tmpReg, ~((int) markWord::inline_type_bit_in_place));
+     }
      movptr(Address(boxReg, 0), tmpReg);          // Anticipate successful CAS
      lock();
      cmpxchgptr(boxReg, Address(objReg, oopDesc::mark_offset_in_bytes()));      // Updates tmpReg
      jcc(Assembler::equal, COUNT);           // Success
  
< prev index next >