< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page
*** 2560,10 ***
--- 2560,21 ---
  }
  
  void TemplateTable::_return(TosState state) {
    transition(state, state);
  
+   // {
+   //   Label not_rb;
+   //   Register aa = rcx, bb = rdi;
+   //   __ movptr(aa, Address(rsp, 0));
+   //   __ lea(bb, ExternalAddress(StubRoutines::cont_returnBarrier()));
+   //   __ cmpq(aa, bb);
+   //   // __ cmpq(ExternalAddress(StubRoutines::cont_returnBarrier()).addr(), aa);
+   //   __ jcc(Assembler::notZero, not_rb);
+   //   __ stop("WQWWQWQW");
+   //   __ bind(not_rb);
+   // }
    assert(_desc->calls_vm(),
           "inconsistent calls_vm information"); // call in remove_activation
  
    if (_desc->bytecode() == Bytecodes::_return_register_finalizer) {
      assert(state == vtos, "only valid state");

*** 2591,12 ***
--- 2602,15 ---
      __ get_thread(thread);
      __ testb(Address(thread, JavaThread::polling_word_offset()), SafepointMechanism::poll_bit());
  #endif
      __ jcc(Assembler::zero, no_safepoint);
      __ push(state);
+     __ push_cont_fastpath(NOT_LP64(thread) LP64_ONLY(r15_thread));
      __ call_VM(noreg, CAST_FROM_FN_PTR(address,
                                         InterpreterRuntime::at_safepoint));
+     NOT_LP64(__ get_thread(thread);)
+     __ pop_cont_fastpath(NOT_LP64(thread) LP64_ONLY(r15_thread));
      __ pop(state);
      __ bind(no_safepoint);
    }
  
    // Narrow result if state is itos but result type is smaller.

*** 4360,10 ***
--- 4374,15 ---
  
    // store object
    __ movptr(Address(rmon, BasicObjectLock::obj_offset_in_bytes()), rax);
    __ lock_object(rmon);
  
+   // The object is stored so counter should be increased even if stackoverflow is generated
+   Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rbx);
+   NOT_LP64(__ get_thread(rthread);)
+   __ inc_held_monitor_count(rthread);
+ 
    // check to make sure this monitor doesn't cause stack overflow after locking
    __ save_bcp();  // in case of exception
    __ generate_stack_overflow_check(0);
  
    // The bcp has already been incremented. Just need to dispatch to

*** 4418,10 ***
--- 4437,15 ---
  
    // call run-time routine
    __ bind(found);
    __ push_ptr(rax); // make sure object is on stack (contract with oopMaps)
    __ unlock_object(rtop);
+   
+   Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rax);
+   NOT_LP64(__ get_thread(rthread);)
+   __ dec_held_monitor_count(rthread);
+ 
    __ pop_ptr(rax); // discard object
  }
  
  // Wide instructions
  void TemplateTable::wide() {
< prev index next >