< prev index next >

src/cpu/x86/vm/stubGenerator_x86_64.cpp

Print this page




 350     __ cmpl(c_rarg1, T_OBJECT);
 351     __ jcc(Assembler::equal, is_long);
 352     __ cmpl(c_rarg1, T_LONG);
 353     __ jcc(Assembler::equal, is_long);
 354     __ cmpl(c_rarg1, T_FLOAT);
 355     __ jcc(Assembler::equal, is_float);
 356     __ cmpl(c_rarg1, T_DOUBLE);
 357     __ jcc(Assembler::equal, is_double);
 358 
 359     // handle T_INT case
 360     __ movl(Address(c_rarg0, 0), rax);
 361 
 362     __ BIND(exit);
 363 
 364     // pop parameters
 365     __ lea(rsp, rsp_after_call);
 366 
 367 #ifdef ASSERT
 368     // verify that threads correspond
 369     {
 370       Label L, S;
 371       __ cmpptr(r15_thread, thread);
 372       __ jcc(Assembler::notEqual, S);


 373       __ get_thread(rbx);




 374       __ cmpptr(r15_thread, rbx);
 375       __ jcc(Assembler::equal, L);
 376       __ bind(S);
 377       __ jcc(Assembler::equal, L);
 378       __ stop("StubRoutines::call_stub: threads must correspond");
 379       __ bind(L);
 380     }
 381 #endif
 382 
 383     // restore regs belonging to calling function
 384 #ifdef _WIN64
 385     int xmm_ub = 15;
 386     if (UseAVX > 2) {
 387       xmm_ub = 31;
 388     }
 389     // emit the restores for xmm regs
 390     for (int i = 6; i <= xmm_ub; i++) {
 391       __ movdqu(as_XMMRegister(i), xmm_save(i));
 392     }
 393 #endif
 394     __ movptr(r15, r15_save);
 395     __ movptr(r14, r14_save);
 396     __ movptr(r13, r13_save);
 397     __ movptr(r12, r12_save);
 398     __ movptr(rbx, rbx_save);
 399 


 433   // within the VM.
 434   //
 435   // Note: Usually the parameters are removed by the callee. In case
 436   // of an exception crossing an activation frame boundary, that is
 437   // not the case if the callee is compiled code => need to setup the
 438   // rsp.
 439   //
 440   // rax: exception oop
 441 
 442   address generate_catch_exception() {
 443     StubCodeMark mark(this, "StubRoutines", "catch_exception");
 444     address start = __ pc();
 445 
 446     // same as in generate_call_stub():
 447     const Address rsp_after_call(rbp, rsp_after_call_off * wordSize);
 448     const Address thread        (rbp, thread_off         * wordSize);
 449 
 450 #ifdef ASSERT
 451     // verify that threads correspond
 452     {
 453       Label L, S;
 454       __ cmpptr(r15_thread, thread);
 455       __ jcc(Assembler::notEqual, S);


 456       __ get_thread(rbx);




 457       __ cmpptr(r15_thread, rbx);
 458       __ jcc(Assembler::equal, L);
 459       __ bind(S);
 460       __ stop("StubRoutines::catch_exception: threads must correspond");
 461       __ bind(L);
 462     }
 463 #endif
 464 
 465     // set pending exception
 466     __ verify_oop(rax);
 467 
 468     __ movptr(Address(r15_thread, Thread::pending_exception_offset()), rax);
 469     __ lea(rscratch1, ExternalAddress((address)__FILE__));
 470     __ movptr(Address(r15_thread, Thread::exception_file_offset()), rscratch1);
 471     __ movl(Address(r15_thread, Thread::exception_line_offset()), (int)  __LINE__);
 472 
 473     // complete return to VM
 474     assert(StubRoutines::_call_stub_return_address != NULL,
 475            "_call_stub_return_address must have been generated before");
 476     __ jump(RuntimeAddress(StubRoutines::_call_stub_return_address));
 477 
 478     return start;
 479   }
 480 
 481   // Continuation point for runtime calls returning with a pending




 350     __ cmpl(c_rarg1, T_OBJECT);
 351     __ jcc(Assembler::equal, is_long);
 352     __ cmpl(c_rarg1, T_LONG);
 353     __ jcc(Assembler::equal, is_long);
 354     __ cmpl(c_rarg1, T_FLOAT);
 355     __ jcc(Assembler::equal, is_float);
 356     __ cmpl(c_rarg1, T_DOUBLE);
 357     __ jcc(Assembler::equal, is_double);
 358 
 359     // handle T_INT case
 360     __ movl(Address(c_rarg0, 0), rax);
 361 
 362     __ BIND(exit);
 363 
 364     // pop parameters
 365     __ lea(rsp, rsp_after_call);
 366 
 367 #ifdef ASSERT
 368     // verify that threads correspond
 369     {
 370      Label L1, L2, L3;
 371       __ cmpptr(r15_thread, thread);
 372       __ jcc(Assembler::equal, L1);
 373       __ stop("StubRoutines::call_stub: r15_thread is corrupted");
 374       __ bind(L1);
 375       __ get_thread(rbx);
 376       __ cmpptr(r15_thread, thread);
 377       __ jcc(Assembler::equal, L2);
 378       __ stop("StubRoutines::call_stub: r15_thread is modified by call");
 379       __ bind(L2);
 380       __ cmpptr(r15_thread, rbx);
 381       __ jcc(Assembler::equal, L3);


 382       __ stop("StubRoutines::call_stub: threads must correspond");
 383       __ bind(L3); 
 384     }
 385 #endif
 386 
 387     // restore regs belonging to calling function
 388 #ifdef _WIN64
 389     int xmm_ub = 15;
 390     if (UseAVX > 2) {
 391       xmm_ub = 31;
 392     }
 393     // emit the restores for xmm regs
 394     for (int i = 6; i <= xmm_ub; i++) {
 395       __ movdqu(as_XMMRegister(i), xmm_save(i));
 396     }
 397 #endif
 398     __ movptr(r15, r15_save);
 399     __ movptr(r14, r14_save);
 400     __ movptr(r13, r13_save);
 401     __ movptr(r12, r12_save);
 402     __ movptr(rbx, rbx_save);
 403 


 437   // within the VM.
 438   //
 439   // Note: Usually the parameters are removed by the callee. In case
 440   // of an exception crossing an activation frame boundary, that is
 441   // not the case if the callee is compiled code => need to setup the
 442   // rsp.
 443   //
 444   // rax: exception oop
 445 
 446   address generate_catch_exception() {
 447     StubCodeMark mark(this, "StubRoutines", "catch_exception");
 448     address start = __ pc();
 449 
 450     // same as in generate_call_stub():
 451     const Address rsp_after_call(rbp, rsp_after_call_off * wordSize);
 452     const Address thread        (rbp, thread_off         * wordSize);
 453 
 454 #ifdef ASSERT
 455     // verify that threads correspond
 456     {
 457       Label L1, L2, L3;
 458       __ cmpptr(r15_thread, thread);
 459       __ jcc(Assembler::equal, L1);
 460       __ stop("StubRoutines::catch_exception: r15_thread is corrupted");
 461       __ bind(L1);
 462       __ get_thread(rbx);
 463       __ cmpptr(r15_thread, thread);
 464       __ jcc(Assembler::equal, L2);
 465       __ stop("StubRoutines::catch_exception: r15_thread is modified by call");
 466       __ bind(L2);
 467       __ cmpptr(r15_thread, rbx);
 468       __ jcc(Assembler::equal, L3);

 469       __ stop("StubRoutines::catch_exception: threads must correspond");
 470       __ bind(L3); 
 471     }
 472 #endif
 473 
 474     // set pending exception
 475     __ verify_oop(rax);
 476 
 477     __ movptr(Address(r15_thread, Thread::pending_exception_offset()), rax);
 478     __ lea(rscratch1, ExternalAddress((address)__FILE__));
 479     __ movptr(Address(r15_thread, Thread::exception_file_offset()), rscratch1);
 480     __ movl(Address(r15_thread, Thread::exception_line_offset()), (int)  __LINE__);
 481 
 482     // complete return to VM
 483     assert(StubRoutines::_call_stub_return_address != NULL,
 484            "_call_stub_return_address must have been generated before");
 485     __ jump(RuntimeAddress(StubRoutines::_call_stub_return_address));
 486 
 487     return start;
 488   }
 489 
 490   // Continuation point for runtime calls returning with a pending


< prev index next >