330 testl(pop_cond, JavaThread::popframe_processing_bit);
331 jcc(Assembler::notZero, L);
332 // Call Interpreter::remove_activation_preserving_args_entry() to get the
333 // address of the same-named entrypoint in the generated interpreter code.
334 call_VM_leaf(CAST_FROM_FN_PTR(address, Interpreter::remove_activation_preserving_args_entry));
335 jmp(rax);
336 bind(L);
337 NOT_LP64(get_thread(java_thread);)
338 }
339 }
340
341 void InterpreterMacroAssembler::load_earlyret_value(TosState state) {
342 Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
343 NOT_LP64(get_thread(thread);)
344 movptr(rcx, Address(thread, JavaThread::jvmti_thread_state_offset()));
345 const Address tos_addr(rcx, JvmtiThreadState::earlyret_tos_offset());
346 const Address oop_addr(rcx, JvmtiThreadState::earlyret_oop_offset());
347 const Address val_addr(rcx, JvmtiThreadState::earlyret_value_offset());
348 #ifdef _LP64
349 switch (state) {
350 case qtos: // fall through
351 case atos: movptr(rax, oop_addr);
352 movptr(oop_addr, (int32_t)NULL_WORD);
353 verify_oop(rax, state); break;
354 case ltos: movptr(rax, val_addr); break;
355 case btos: // fall through
356 case ztos: // fall through
357 case ctos: // fall through
358 case stos: // fall through
359 case itos: movl(rax, val_addr); break;
360 case ftos: load_float(val_addr); break;
361 case dtos: load_double(val_addr); break;
362 case vtos: /* nothing to do */ break;
363 default : ShouldNotReachHere();
364 }
365 // Clean up tos value in the thread object
366 movl(tos_addr, (int) ilgl);
367 movl(val_addr, (int32_t) NULL_WORD);
368 #else
369 const Address val_addr1(rcx, JvmtiThreadState::earlyret_value_offset()
370 + in_ByteSize(wordSize));
371 switch (state) {
372 case qtos: // fall through
373 case atos: movptr(rax, oop_addr);
374 movptr(oop_addr, NULL_WORD);
375 verify_oop(rax, state); break;
376 case ltos:
377 movl(rdx, val_addr1); // fall through
378 case btos: // fall through
379 case ztos: // fall through
380 case ctos: // fall through
381 case stos: // fall through
382 case itos: movl(rax, val_addr); break;
383 case ftos: load_float(val_addr); break;
384 case dtos: load_double(val_addr); break;
385 case vtos: /* nothing to do */ break;
386 default : ShouldNotReachHere();
387 }
388 #endif // _LP64
389 // Clean up tos value in the thread object
390 movl(tos_addr, (int32_t) ilgl);
391 movptr(val_addr, NULL_WORD);
392 NOT_LP64(movptr(val_addr1, NULL_WORD);)
615 #ifdef _LP64
616 void InterpreterMacroAssembler::pop_i(Register r) {
617 // XXX can't use pop currently, upper half non clean
618 movl(r, Address(rsp, 0));
619 addptr(rsp, wordSize);
620 }
621
622 void InterpreterMacroAssembler::pop_l(Register r) {
623 movq(r, Address(rsp, 0));
624 addptr(rsp, 2 * Interpreter::stackElementSize);
625 }
626
627 void InterpreterMacroAssembler::push_l(Register r) {
628 subptr(rsp, 2 * wordSize);
629 movptr(Address(rsp, Interpreter::expr_offset_in_bytes(0)), r );
630 movptr(Address(rsp, Interpreter::expr_offset_in_bytes(1)), NULL_WORD );
631 }
632
633 void InterpreterMacroAssembler::pop(TosState state) {
634 switch (state) {
635 case ptos: // Fall through
636 case qtos: // Fall through
637 case atos: pop_ptr(); break;
638 case btos:
639 case ztos:
640 case ctos:
641 case stos:
642 case itos: pop_i(); break;
643 case ltos: pop_l(); break;
644 case ftos: pop_f(xmm0); break;
645 case dtos: pop_d(xmm0); break;
646 case vtos: /* nothing to do */ break;
647 default: ShouldNotReachHere();
648 }
649 verify_oop(rax, state);
650 }
651
652 void InterpreterMacroAssembler::push(TosState state) {
653 verify_oop(rax, state);
654 switch (state) {
655 case qtos: // Fall through
656 case atos: push_ptr(); break;
657 case btos:
658 case ztos:
659 case ctos:
660 case stos:
661 case itos: push_i(); break;
662 case ltos: push_l(); break;
663 case ftos: push_f(xmm0); break;
664 case dtos: push_d(xmm0); break;
665 case vtos: /* nothing to do */ break;
666 default : ShouldNotReachHere();
667 }
668 }
669 #else
670 void InterpreterMacroAssembler::pop_i(Register r) {
671 pop(r);
672 }
673
674 void InterpreterMacroAssembler::pop_l(Register lo, Register hi) {
675 pop(lo);
676 pop(hi);
677 }
678
679 void InterpreterMacroAssembler::pop_f() {
680 fld_s(Address(rsp, 0));
681 addptr(rsp, 1 * wordSize);
682 }
683
684 void InterpreterMacroAssembler::pop_d() {
685 fld_d(Address(rsp, 0));
686 addptr(rsp, 2 * wordSize);
687 }
688
689
690 void InterpreterMacroAssembler::pop(TosState state) {
691 switch (state) {
692 case qtos: // fall through
693 case atos: pop_ptr(rax); break;
694 case btos: // fall through
695 case ztos: // fall through
696 case ctos: // fall through
697 case stos: // fall through
698 case itos: pop_i(rax); break;
699 case ltos: pop_l(rax, rdx); break;
700 case ftos:
701 if (UseSSE >= 1) {
702 pop_f(xmm0);
703 } else {
704 pop_f();
705 }
706 break;
707 case dtos:
708 if (UseSSE >= 2) {
709 pop_d(xmm0);
710 } else {
711 pop_d();
712 }
722 push(hi);
723 push(lo);
724 }
725
726 void InterpreterMacroAssembler::push_f() {
727 // Do not schedule for no AGI! Never write beyond rsp!
728 subptr(rsp, 1 * wordSize);
729 fstp_s(Address(rsp, 0));
730 }
731
732 void InterpreterMacroAssembler::push_d() {
733 // Do not schedule for no AGI! Never write beyond rsp!
734 subptr(rsp, 2 * wordSize);
735 fstp_d(Address(rsp, 0));
736 }
737
738
739 void InterpreterMacroAssembler::push(TosState state) {
740 verify_oop(rax, state);
741 switch (state) {
742 case qtos: // fall through
743 case atos: push_ptr(rax); break;
744 case btos: // fall through
745 case ztos: // fall through
746 case ctos: // fall through
747 case stos: // fall through
748 case itos: push_i(rax); break;
749 case ltos: push_l(rax, rdx); break;
750 case ftos:
751 if (UseSSE >= 1) {
752 push_f(xmm0);
753 } else {
754 push_f();
755 }
756 break;
757 case dtos:
758 if (UseSSE >= 2) {
759 push_d(xmm0);
760 } else {
761 push_d();
762 }
|
330 testl(pop_cond, JavaThread::popframe_processing_bit);
331 jcc(Assembler::notZero, L);
332 // Call Interpreter::remove_activation_preserving_args_entry() to get the
333 // address of the same-named entrypoint in the generated interpreter code.
334 call_VM_leaf(CAST_FROM_FN_PTR(address, Interpreter::remove_activation_preserving_args_entry));
335 jmp(rax);
336 bind(L);
337 NOT_LP64(get_thread(java_thread);)
338 }
339 }
340
341 void InterpreterMacroAssembler::load_earlyret_value(TosState state) {
342 Register thread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
343 NOT_LP64(get_thread(thread);)
344 movptr(rcx, Address(thread, JavaThread::jvmti_thread_state_offset()));
345 const Address tos_addr(rcx, JvmtiThreadState::earlyret_tos_offset());
346 const Address oop_addr(rcx, JvmtiThreadState::earlyret_oop_offset());
347 const Address val_addr(rcx, JvmtiThreadState::earlyret_value_offset());
348 #ifdef _LP64
349 switch (state) {
350 case atos: movptr(rax, oop_addr);
351 movptr(oop_addr, (int32_t)NULL_WORD);
352 verify_oop(rax, state); break;
353 case ltos: movptr(rax, val_addr); break;
354 case btos: // fall through
355 case ztos: // fall through
356 case ctos: // fall through
357 case stos: // fall through
358 case itos: movl(rax, val_addr); break;
359 case ftos: load_float(val_addr); break;
360 case dtos: load_double(val_addr); break;
361 case vtos: /* nothing to do */ break;
362 default : ShouldNotReachHere();
363 }
364 // Clean up tos value in the thread object
365 movl(tos_addr, (int) ilgl);
366 movl(val_addr, (int32_t) NULL_WORD);
367 #else
368 const Address val_addr1(rcx, JvmtiThreadState::earlyret_value_offset()
369 + in_ByteSize(wordSize));
370 switch (state) {
371 case atos: movptr(rax, oop_addr);
372 movptr(oop_addr, NULL_WORD);
373 verify_oop(rax, state); break;
374 case ltos:
375 movl(rdx, val_addr1); // fall through
376 case btos: // fall through
377 case ztos: // fall through
378 case ctos: // fall through
379 case stos: // fall through
380 case itos: movl(rax, val_addr); break;
381 case ftos: load_float(val_addr); break;
382 case dtos: load_double(val_addr); break;
383 case vtos: /* nothing to do */ break;
384 default : ShouldNotReachHere();
385 }
386 #endif // _LP64
387 // Clean up tos value in the thread object
388 movl(tos_addr, (int32_t) ilgl);
389 movptr(val_addr, NULL_WORD);
390 NOT_LP64(movptr(val_addr1, NULL_WORD);)
613 #ifdef _LP64
614 void InterpreterMacroAssembler::pop_i(Register r) {
615 // XXX can't use pop currently, upper half non clean
616 movl(r, Address(rsp, 0));
617 addptr(rsp, wordSize);
618 }
619
620 void InterpreterMacroAssembler::pop_l(Register r) {
621 movq(r, Address(rsp, 0));
622 addptr(rsp, 2 * Interpreter::stackElementSize);
623 }
624
625 void InterpreterMacroAssembler::push_l(Register r) {
626 subptr(rsp, 2 * wordSize);
627 movptr(Address(rsp, Interpreter::expr_offset_in_bytes(0)), r );
628 movptr(Address(rsp, Interpreter::expr_offset_in_bytes(1)), NULL_WORD );
629 }
630
631 void InterpreterMacroAssembler::pop(TosState state) {
632 switch (state) {
633 case atos: pop_ptr(); break;
634 case btos:
635 case ztos:
636 case ctos:
637 case stos:
638 case itos: pop_i(); break;
639 case ltos: pop_l(); break;
640 case ftos: pop_f(xmm0); break;
641 case dtos: pop_d(xmm0); break;
642 case vtos: /* nothing to do */ break;
643 default: ShouldNotReachHere();
644 }
645 verify_oop(rax, state);
646 }
647
648 void InterpreterMacroAssembler::push(TosState state) {
649 verify_oop(rax, state);
650 switch (state) {
651 case atos: push_ptr(); break;
652 case btos:
653 case ztos:
654 case ctos:
655 case stos:
656 case itos: push_i(); break;
657 case ltos: push_l(); break;
658 case ftos: push_f(xmm0); break;
659 case dtos: push_d(xmm0); break;
660 case vtos: /* nothing to do */ break;
661 default : ShouldNotReachHere();
662 }
663 }
664 #else
665 void InterpreterMacroAssembler::pop_i(Register r) {
666 pop(r);
667 }
668
669 void InterpreterMacroAssembler::pop_l(Register lo, Register hi) {
670 pop(lo);
671 pop(hi);
672 }
673
674 void InterpreterMacroAssembler::pop_f() {
675 fld_s(Address(rsp, 0));
676 addptr(rsp, 1 * wordSize);
677 }
678
679 void InterpreterMacroAssembler::pop_d() {
680 fld_d(Address(rsp, 0));
681 addptr(rsp, 2 * wordSize);
682 }
683
684
685 void InterpreterMacroAssembler::pop(TosState state) {
686 switch (state) {
687 case atos: pop_ptr(rax); break;
688 case btos: // fall through
689 case ztos: // fall through
690 case ctos: // fall through
691 case stos: // fall through
692 case itos: pop_i(rax); break;
693 case ltos: pop_l(rax, rdx); break;
694 case ftos:
695 if (UseSSE >= 1) {
696 pop_f(xmm0);
697 } else {
698 pop_f();
699 }
700 break;
701 case dtos:
702 if (UseSSE >= 2) {
703 pop_d(xmm0);
704 } else {
705 pop_d();
706 }
716 push(hi);
717 push(lo);
718 }
719
720 void InterpreterMacroAssembler::push_f() {
721 // Do not schedule for no AGI! Never write beyond rsp!
722 subptr(rsp, 1 * wordSize);
723 fstp_s(Address(rsp, 0));
724 }
725
726 void InterpreterMacroAssembler::push_d() {
727 // Do not schedule for no AGI! Never write beyond rsp!
728 subptr(rsp, 2 * wordSize);
729 fstp_d(Address(rsp, 0));
730 }
731
732
733 void InterpreterMacroAssembler::push(TosState state) {
734 verify_oop(rax, state);
735 switch (state) {
736 case atos: push_ptr(rax); break;
737 case btos: // fall through
738 case ztos: // fall through
739 case ctos: // fall through
740 case stos: // fall through
741 case itos: push_i(rax); break;
742 case ltos: push_l(rax, rdx); break;
743 case ftos:
744 if (UseSSE >= 1) {
745 push_f(xmm0);
746 } else {
747 push_f();
748 }
749 break;
750 case dtos:
751 if (UseSSE >= 2) {
752 push_d(xmm0);
753 } else {
754 push_d();
755 }
|