677 const Register cache = R11_scratch1;
678 const Register size = R12_scratch2;
679 __ get_cache_and_index_at_bcp(cache, 1, index_size);
680
681 // Get least significant byte of 64 bit value:
682 #if defined(VM_LITTLE_ENDIAN)
683 __ lbz(size, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()), cache);
684 #else
685 __ lbz(size, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()) + 7, cache);
686 #endif
687 __ sldi(size, size, Interpreter::logStackElementSize);
688 __ add(R15_esp, R15_esp, size);
689
690 __ check_and_handle_popframe(R11_scratch1);
691 __ check_and_handle_earlyret(R11_scratch1);
692
693 __ dispatch_next(state, step);
694 return entry;
695 }
696
697 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, int step) {
698 address entry = __ pc();
699 // If state != vtos, we're returning from a native method, which put it's result
700 // into the result register. So move the value out of the return register back
701 // to the TOS cache of current frame.
702
703 switch (state) {
704 case ltos:
705 case btos:
706 case ztos:
707 case ctos:
708 case stos:
709 case atos:
710 case itos: __ mr(R17_tos, R3_RET); break; // GR_RET -> TOS cache
711 case ftos:
712 case dtos: __ fmr(F15_ftos, F1_RET); break; // TOS cache -> GR_FRET
713 case vtos: break; // Nothing to do, this was a void return.
714 default : ShouldNotReachHere();
715 }
716
717 // Load LcpoolCache @@@ should be already set!
718 __ get_constant_pool_cache(R27_constPoolCache);
719
720 // Handle a pending exception, fall through if none.
721 __ check_and_forward_exception(R11_scratch1, R12_scratch2);
722
723 // Start executing bytecodes.
724 __ dispatch_next(state, step);
725
726 return entry;
727 }
728
729 address TemplateInterpreterGenerator::generate_safept_entry_for(TosState state, address runtime_entry) {
730 address entry = __ pc();
731
732 __ push(state);
733 __ call_VM(noreg, runtime_entry);
734 __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
735
736 return entry;
737 }
738
739 // Helpers for commoning out cases in the various type of method entries.
740
741 // Increment invocation count & check for overflow.
742 //
743 // Note: checking for negative value instead of overflow
744 // so we have a 'sticky' overflow test.
|
677 const Register cache = R11_scratch1;
678 const Register size = R12_scratch2;
679 __ get_cache_and_index_at_bcp(cache, 1, index_size);
680
681 // Get least significant byte of 64 bit value:
682 #if defined(VM_LITTLE_ENDIAN)
683 __ lbz(size, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()), cache);
684 #else
685 __ lbz(size, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()) + 7, cache);
686 #endif
687 __ sldi(size, size, Interpreter::logStackElementSize);
688 __ add(R15_esp, R15_esp, size);
689
690 __ check_and_handle_popframe(R11_scratch1);
691 __ check_and_handle_earlyret(R11_scratch1);
692
693 __ dispatch_next(state, step);
694 return entry;
695 }
696
697 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, int step, address continuation) {
698 address entry = __ pc();
699 // If state != vtos, we're returning from a native method, which put it's result
700 // into the result register. So move the value out of the return register back
701 // to the TOS cache of current frame.
702
703 switch (state) {
704 case ltos:
705 case btos:
706 case ztos:
707 case ctos:
708 case stos:
709 case atos:
710 case itos: __ mr(R17_tos, R3_RET); break; // GR_RET -> TOS cache
711 case ftos:
712 case dtos: __ fmr(F15_ftos, F1_RET); break; // TOS cache -> GR_FRET
713 case vtos: break; // Nothing to do, this was a void return.
714 default : ShouldNotReachHere();
715 }
716
717 // Load LcpoolCache @@@ should be already set!
718 __ get_constant_pool_cache(R27_constPoolCache);
719
720 // Handle a pending exception, fall through if none.
721 __ check_and_forward_exception(R11_scratch1, R12_scratch2);
722
723 // Start executing bytecodes.
724 if (continuation == NULL) {
725 __ dispatch_next(state, step);
726 } else {
727 __ jump_to_entry(continuation, R11_scratch1);
728 }
729
730 return entry;
731 }
732
733 address TemplateInterpreterGenerator::generate_safept_entry_for(TosState state, address runtime_entry) {
734 address entry = __ pc();
735
736 __ push(state);
737 __ call_VM(noreg, runtime_entry);
738 __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
739
740 return entry;
741 }
742
743 // Helpers for commoning out cases in the various type of method entries.
744
745 // Increment invocation count & check for overflow.
746 //
747 // Note: checking for negative value instead of overflow
748 // so we have a 'sticky' overflow test.
|