src/cpu/x86/vm/sharedRuntime_x86_64.cpp

changeset 8987
9ffa0d7ed932
parent 8877
f04097176542
child 8997
f8a45a60bc6b
equal deleted inserted replaced
8986:6470230caf2a 8987:9ffa0d7ed932
1386 __ andptr(rsp, -16); // align stack as required by ABI 1386 __ andptr(rsp, -16); // align stack as required by ABI
1387 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::block_for_jni_critical))); 1387 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::block_for_jni_critical)));
1388 __ mov(rsp, r12); // restore sp 1388 __ mov(rsp, r12); // restore sp
1389 __ reinit_heapbase(); 1389 __ reinit_heapbase();
1390 1390
1391 __ reset_last_Java_frame(false, true); 1391 __ reset_last_Java_frame(false);
1392 1392
1393 save_or_restore_arguments(masm, stack_slots, total_in_args, 1393 save_or_restore_arguments(masm, stack_slots, total_in_args,
1394 arg_save_area, NULL, in_regs, in_sig_bt); 1394 arg_save_area, NULL, in_regs, in_sig_bt);
1395 1395
1396 __ bind(cont); 1396 __ bind(cont);
2495 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), 2495 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
2496 r15_thread, c_rarg1); 2496 r15_thread, c_rarg1);
2497 restore_native_result(masm, ret_type, stack_slots); 2497 restore_native_result(masm, ret_type, stack_slots);
2498 } 2498 }
2499 2499
2500 __ reset_last_Java_frame(false, true); 2500 __ reset_last_Java_frame(false);
2501 2501
2502 // Unpack oop result 2502 // Unpack oop result
2503 if (ret_type == T_OBJECT || ret_type == T_ARRAY) { 2503 if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
2504 Label L; 2504 Label L;
2505 __ testptr(rax, rax); 2505 __ testptr(rax, rax);
3433 3433
3434 // Need to have an oopmap that tells fetch_unroll_info where to 3434 // Need to have an oopmap that tells fetch_unroll_info where to
3435 // find any register it might need. 3435 // find any register it might need.
3436 oop_maps->add_gc_map(__ pc() - start, map); 3436 oop_maps->add_gc_map(__ pc() - start, map);
3437 3437
3438 __ reset_last_Java_frame(false, false); 3438 __ reset_last_Java_frame(false);
3439 3439
3440 // Load UnrollBlock* into rdi 3440 // Load UnrollBlock* into rdi
3441 __ mov(rdi, rax); 3441 __ mov(rdi, rax);
3442 3442
3443 Label noException; 3443 Label noException;
3590 // Use the same PC we used for the last java frame 3590 // Use the same PC we used for the last java frame
3591 oop_maps->add_gc_map(the_pc - start, 3591 oop_maps->add_gc_map(the_pc - start,
3592 new OopMap( frame_size_in_words, 0 )); 3592 new OopMap( frame_size_in_words, 0 ));
3593 3593
3594 // Clear fp AND pc 3594 // Clear fp AND pc
3595 __ reset_last_Java_frame(true, true); 3595 __ reset_last_Java_frame(true);
3596 3596
3597 // Collect return values 3597 // Collect return values
3598 __ movdbl(xmm0, Address(rsp, RegisterSaver::xmm0_offset_in_bytes())); 3598 __ movdbl(xmm0, Address(rsp, RegisterSaver::xmm0_offset_in_bytes()));
3599 __ movptr(rax, Address(rsp, RegisterSaver::rax_offset_in_bytes())); 3599 __ movptr(rax, Address(rsp, RegisterSaver::rax_offset_in_bytes()));
3600 // I think this is useless (throwing pc?) 3600 // I think this is useless (throwing pc?)
3660 3660
3661 // location of rbp is known implicitly by the frame sender code 3661 // location of rbp is known implicitly by the frame sender code
3662 3662
3663 oop_maps->add_gc_map(__ pc() - start, map); 3663 oop_maps->add_gc_map(__ pc() - start, map);
3664 3664
3665 __ reset_last_Java_frame(false, false); 3665 __ reset_last_Java_frame(false);
3666 3666
3667 // Load UnrollBlock* into rdi 3667 // Load UnrollBlock* into rdi
3668 __ mov(rdi, rax); 3668 __ mov(rdi, rax);
3669 3669
3670 // Pop all the frames we must move/replace. 3670 // Pop all the frames we must move/replace.
3773 // Set an oopmap for the call site 3773 // Set an oopmap for the call site
3774 // Use the same PC we used for the last java frame 3774 // Use the same PC we used for the last java frame
3775 oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); 3775 oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
3776 3776
3777 // Clear fp AND pc 3777 // Clear fp AND pc
3778 __ reset_last_Java_frame(true, true); 3778 __ reset_last_Java_frame(true);
3779 3779
3780 // Pop self-frame. 3780 // Pop self-frame.
3781 __ leave(); // Epilog 3781 __ leave(); // Epilog
3782 3782
3783 // Jump to interpreter 3783 // Jump to interpreter
3856 3856
3857 oop_maps->add_gc_map( __ pc() - start, map); 3857 oop_maps->add_gc_map( __ pc() - start, map);
3858 3858
3859 Label noException; 3859 Label noException;
3860 3860
3861 __ reset_last_Java_frame(false, false); 3861 __ reset_last_Java_frame(false);
3862 3862
3863 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); 3863 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
3864 __ jcc(Assembler::equal, noException); 3864 __ jcc(Assembler::equal, noException);
3865 3865
3866 // Exception pending 3866 // Exception pending
3926 oop_maps->add_gc_map( __ offset() - start, map); 3926 oop_maps->add_gc_map( __ offset() - start, map);
3927 3927
3928 // rax contains the address we are going to jump to assuming no exception got installed 3928 // rax contains the address we are going to jump to assuming no exception got installed
3929 3929
3930 // clear last_Java_sp 3930 // clear last_Java_sp
3931 __ reset_last_Java_frame(false, false); 3931 __ reset_last_Java_frame(false);
3932 // check for pending exceptions 3932 // check for pending exceptions
3933 Label pending; 3933 Label pending;
3934 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); 3934 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
3935 __ jcc(Assembler::notEqual, pending); 3935 __ jcc(Assembler::notEqual, pending);
3936 3936
4307 4307
4308 OopMapSet* oop_maps = new OopMapSet(); 4308 OopMapSet* oop_maps = new OopMapSet();
4309 4309
4310 oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0)); 4310 oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
4311 4311
4312 __ reset_last_Java_frame(false, true); 4312 __ reset_last_Java_frame(false);
4313 4313
4314 // Restore callee-saved registers 4314 // Restore callee-saved registers
4315 4315
4316 // rbp is an implicitly saved callee-saved register (i.e., the calling 4316 // rbp is an implicitly saved callee-saved register (i.e., the calling
4317 // convention will save restore it in prolog/epilog) Other than that 4317 // convention will save restore it in prolog/epilog) Other than that

mercurial