src/cpu/sparc/vm/interp_masm_sparc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot-dvm Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/interp_masm_sparc.cpp

Print this page
rev 423 : imported patch indy.patch


 814 #else
 815   delayed()->ld(Rtmp, 0, Rdst);
 816 #endif
 817 
 818   ldub(Lbcp, bcp_offset + 3, Rdst);
 819   ldub(Lbcp, bcp_offset + 2, Rtmp);  sll(Rtmp,  8, Rtmp);  or3(Rtmp, Rdst, Rdst);
 820   ldub(Lbcp, bcp_offset + 1, Rtmp);  sll(Rtmp, 16, Rtmp);  or3(Rtmp, Rdst, Rdst);
 821 #ifdef _LP64
 822   ldsb(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 823 #else
 824   // Unsigned load is faster than signed on some implementations
 825   ldub(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 826 #endif
 827   or3(Rtmp, Rdst, Rdst );
 828 
 829   bind(aligned);
 830   if (should_set_CC == set_CC) tst(Rdst);
 831 }
 832 
 833 
 834 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset) {















 835   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 836   assert_different_registers(cache, tmp);
 837   assert_not_delayed();

 838   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 839               // convert from field index to ConstantPoolCacheEntry index
 840               // and from word index to byte offset
 841   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 842   add(LcpoolCache, tmp, cache);
 843 }
 844 
 845 
 846 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) {

 847   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 848   assert_different_registers(cache, tmp);
 849   assert_not_delayed();

 850   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 851               // convert from field index to ConstantPoolCacheEntry index
 852               // and from word index to byte offset
 853   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 854               // skip past the header
 855   add(tmp, in_bytes(constantPoolCacheOopDesc::base_offset()), tmp);
 856               // construct pointer to cache entry
 857   add(LcpoolCache, tmp, cache);
 858 }
 859 
 860 
 861 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 862 // a subtype of super_klass.  Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2.
 863 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 864                                                   Register Rsuper_klass,
 865                                                   Register Rtmp1,
 866                                                   Register Rtmp2,
 867                                                   Register Rtmp3,
 868                                                   Label &ok_is_subtype ) {
 869   Label not_subtype, loop;


1722 void InterpreterMacroAssembler::profile_final_call(Register scratch) {
1723   if (ProfileInterpreter) {
1724     Label profile_continue;
1725 
1726     // If no method data exists, go to profile_continue.
1727     test_method_data_pointer(profile_continue);
1728 
1729     // We are making a call.  Increment the count.
1730     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1731 
1732     // The method data pointer needs to be updated to reflect the new target.
1733     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1734     bind (profile_continue);
1735   }
1736 }
1737 
1738 
1739 // Count a virtual call in the bytecodes.
1740 
1741 void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
1742                                                      Register scratch) {

1743   if (ProfileInterpreter) {
1744     Label profile_continue;
1745 
1746     // If no method data exists, go to profile_continue.
1747     test_method_data_pointer(profile_continue);
1748 
1749     // We are making a call.  Increment the count.
1750     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1751 
1752     // Record the receiver type.
1753     record_klass_in_profile(receiver, scratch);
1754 
1755     // The method data pointer needs to be updated to reflect the new target.
1756     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1757     bind (profile_continue);
1758   }
1759 }
1760 
1761 void InterpreterMacroAssembler::record_klass_in_profile_helper(
1762                                         Register receiver, Register scratch,




 814 #else
 815   delayed()->ld(Rtmp, 0, Rdst);
 816 #endif
 817 
 818   ldub(Lbcp, bcp_offset + 3, Rdst);
 819   ldub(Lbcp, bcp_offset + 2, Rtmp);  sll(Rtmp,  8, Rtmp);  or3(Rtmp, Rdst, Rdst);
 820   ldub(Lbcp, bcp_offset + 1, Rtmp);  sll(Rtmp, 16, Rtmp);  or3(Rtmp, Rdst, Rdst);
 821 #ifdef _LP64
 822   ldsb(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 823 #else
 824   // Unsigned load is faster than signed on some implementations
 825   ldub(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 826 #endif
 827   or3(Rtmp, Rdst, Rdst );
 828 
 829   bind(aligned);
 830   if (should_set_CC == set_CC) tst(Rdst);
 831 }
 832 
 833 
 834 void InterpreterMacroAssembler::get_index_at_bcp(Register Rtmp, Register Rdst,
 835                                                  int bcp_offset, bool giant_index) {
 836   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 837   if (!giant_index) {
 838     get_2_byte_integer_at_bcp(bcp_offset, Rtmp, Rdst, Unsigned);
 839   } else {
 840     assert(InvokeDynamic, "giant index used only for InvokeDynamic");
 841     get_4_byte_integer_at_bcp(bcp_offset, Rtmp, Rdst);
 842     assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line");
 843     xor3(Rdst, -1, Rdst);  // convert to plain index
 844   }
 845 }
 846 
 847 
 848 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp,
 849                                                            int bcp_offset, bool giant_index) {
 850   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 851   assert_different_registers(cache, tmp);
 852   assert_not_delayed();
 853   assert(!giant_index,"NYI");
 854   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 855               // convert from field index to ConstantPoolCacheEntry index
 856               // and from word index to byte offset
 857   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 858   add(LcpoolCache, tmp, cache);
 859 }
 860 
 861 
 862 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp,
 863                                                                int bcp_offset, bool giant_index) {
 864   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 865   assert_different_registers(cache, tmp);
 866   assert_not_delayed();
 867   assert(!giant_index,"NYI");
 868   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 869               // convert from field index to ConstantPoolCacheEntry index
 870               // and from word index to byte offset
 871   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 872               // skip past the header
 873   add(tmp, in_bytes(constantPoolCacheOopDesc::base_offset()), tmp);
 874               // construct pointer to cache entry
 875   add(LcpoolCache, tmp, cache);
 876 }
 877 
 878 
 879 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 880 // a subtype of super_klass.  Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2.
 881 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 882                                                   Register Rsuper_klass,
 883                                                   Register Rtmp1,
 884                                                   Register Rtmp2,
 885                                                   Register Rtmp3,
 886                                                   Label &ok_is_subtype ) {
 887   Label not_subtype, loop;


1740 void InterpreterMacroAssembler::profile_final_call(Register scratch) {
1741   if (ProfileInterpreter) {
1742     Label profile_continue;
1743 
1744     // If no method data exists, go to profile_continue.
1745     test_method_data_pointer(profile_continue);
1746 
1747     // We are making a call.  Increment the count.
1748     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1749 
1750     // The method data pointer needs to be updated to reflect the new target.
1751     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1752     bind (profile_continue);
1753   }
1754 }
1755 
1756 
1757 // Count a virtual call in the bytecodes.
1758 
1759 void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
1760                                                      Register scratch,
1761                                                      bool receiver_can_be_null) {
1762   if (ProfileInterpreter) {
1763     Label profile_continue;
1764 
1765     // If no method data exists, go to profile_continue.
1766     test_method_data_pointer(profile_continue);
1767 
1768     // We are making a call.  Increment the count.
1769     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1770 
1771     // Record the receiver type.
1772     record_klass_in_profile(receiver, scratch);
1773 
1774     // The method data pointer needs to be updated to reflect the new target.
1775     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1776     bind (profile_continue);
1777   }
1778 }
1779 
1780 void InterpreterMacroAssembler::record_klass_in_profile_helper(
1781                                         Register receiver, Register scratch,


src/cpu/sparc/vm/interp_masm_sparc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File