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

src/cpu/sparc/vm/interp_masm_sparc.cpp

Print this page




 797 #else
 798   delayed()->ld(Rtmp, 0, Rdst);
 799 #endif
 800 
 801   ldub(Lbcp, bcp_offset + 3, Rdst);
 802   ldub(Lbcp, bcp_offset + 2, Rtmp);  sll(Rtmp,  8, Rtmp);  or3(Rtmp, Rdst, Rdst);
 803   ldub(Lbcp, bcp_offset + 1, Rtmp);  sll(Rtmp, 16, Rtmp);  or3(Rtmp, Rdst, Rdst);
 804 #ifdef _LP64
 805   ldsb(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 806 #else
 807   // Unsigned load is faster than signed on some implementations
 808   ldub(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 809 #endif
 810   or3(Rtmp, Rdst, Rdst );
 811 
 812   bind(aligned);
 813   if (should_set_CC == set_CC) tst(Rdst);
 814 }
 815 
 816 
 817 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset) {















 818   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 819   assert_different_registers(cache, tmp);
 820   assert_not_delayed();
 821   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 822               // convert from field index to ConstantPoolCacheEntry index
 823               // and from word index to byte offset
 824   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 825   add(LcpoolCache, tmp, cache);
 826 }
 827 
 828 
 829 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) {

 830   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 831   assert_different_registers(cache, tmp);
 832   assert_not_delayed();

 833   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 834               // convert from field index to ConstantPoolCacheEntry index
 835               // and from word index to byte offset
 836   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 837               // skip past the header
 838   add(tmp, in_bytes(constantPoolCacheOopDesc::base_offset()), tmp);
 839               // construct pointer to cache entry
 840   add(LcpoolCache, tmp, cache);
 841 }
 842 
 843 
 844 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 845 // a subtype of super_klass.  Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2.
 846 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 847                                                   Register Rsuper_klass,
 848                                                   Register Rtmp1,
 849                                                   Register Rtmp2,
 850                                                   Register Rtmp3,
 851                                                   Label &ok_is_subtype ) {
 852   Label not_subtype;


1658 void InterpreterMacroAssembler::profile_final_call(Register scratch) {
1659   if (ProfileInterpreter) {
1660     Label profile_continue;
1661 
1662     // If no method data exists, go to profile_continue.
1663     test_method_data_pointer(profile_continue);
1664 
1665     // We are making a call.  Increment the count.
1666     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1667 
1668     // The method data pointer needs to be updated to reflect the new target.
1669     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1670     bind (profile_continue);
1671   }
1672 }
1673 
1674 
1675 // Count a virtual call in the bytecodes.
1676 
1677 void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
1678                                                      Register scratch) {

1679   if (ProfileInterpreter) {
1680     Label profile_continue;
1681 
1682     // If no method data exists, go to profile_continue.
1683     test_method_data_pointer(profile_continue);
1684 














1685     // Record the receiver type.
1686     record_klass_in_profile(receiver, scratch, true);

1687 
1688     // The method data pointer needs to be updated to reflect the new target.
1689     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1690     bind (profile_continue);
1691   }
1692 }
1693 
1694 void InterpreterMacroAssembler::record_klass_in_profile_helper(
1695                                         Register receiver, Register scratch,
1696                                         int start_row, Label& done, bool is_virtual_call) {
1697   if (TypeProfileWidth == 0) {
1698     if (is_virtual_call) {
1699       increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1700     }
1701     return;
1702   }
1703 
1704   int last_row = VirtualCallData::row_limit() - 1;
1705   assert(start_row <= last_row, "must be work left to do");
1706   // Test this row for both the receiver and for null.




 797 #else
 798   delayed()->ld(Rtmp, 0, Rdst);
 799 #endif
 800 
 801   ldub(Lbcp, bcp_offset + 3, Rdst);
 802   ldub(Lbcp, bcp_offset + 2, Rtmp);  sll(Rtmp,  8, Rtmp);  or3(Rtmp, Rdst, Rdst);
 803   ldub(Lbcp, bcp_offset + 1, Rtmp);  sll(Rtmp, 16, Rtmp);  or3(Rtmp, Rdst, Rdst);
 804 #ifdef _LP64
 805   ldsb(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 806 #else
 807   // Unsigned load is faster than signed on some implementations
 808   ldub(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 809 #endif
 810   or3(Rtmp, Rdst, Rdst );
 811 
 812   bind(aligned);
 813   if (should_set_CC == set_CC) tst(Rdst);
 814 }
 815 
 816 
 817 void InterpreterMacroAssembler::get_cache_index_at_bcp(Register cache, Register tmp,
 818                                                        int bcp_offset, bool giant_index) {
 819   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 820   if (!giant_index) {
 821     get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 822   } else {
 823     assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic");
 824     get_4_byte_integer_at_bcp(bcp_offset, cache, tmp);
 825     assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line");
 826     xor3(tmp, -1, tmp);  // convert to plain index
 827   }
 828 }
 829 
 830 
 831 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp,
 832                                                            int bcp_offset, bool giant_index) {
 833   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 834   assert_different_registers(cache, tmp);
 835   assert_not_delayed();
 836   get_cache_index_at_bcp(cache, tmp, bcp_offset, giant_index);
 837   // convert from field index to ConstantPoolCacheEntry index and from
 838   // word index to byte offset
 839   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 840   add(LcpoolCache, tmp, cache);
 841 }
 842 
 843 
 844 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp,
 845                                                                int bcp_offset, bool giant_index) {
 846   assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 847   assert_different_registers(cache, tmp);
 848   assert_not_delayed();
 849   assert(!giant_index,"NYI");
 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;


1675 void InterpreterMacroAssembler::profile_final_call(Register scratch) {
1676   if (ProfileInterpreter) {
1677     Label profile_continue;
1678 
1679     // If no method data exists, go to profile_continue.
1680     test_method_data_pointer(profile_continue);
1681 
1682     // We are making a call.  Increment the count.
1683     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1684 
1685     // The method data pointer needs to be updated to reflect the new target.
1686     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1687     bind (profile_continue);
1688   }
1689 }
1690 
1691 
1692 // Count a virtual call in the bytecodes.
1693 
1694 void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
1695                                                      Register scratch,
1696                                                      bool receiver_can_be_null) {
1697   if (ProfileInterpreter) {
1698     Label profile_continue;
1699 
1700     // If no method data exists, go to profile_continue.
1701     test_method_data_pointer(profile_continue);
1702 
1703 
1704     Label skip_receiver_profile;
1705     if (receiver_can_be_null) {
1706       Label not_null;
1707       tst(receiver);
1708       brx(Assembler::notZero, false, Assembler::pt, not_null);
1709       delayed()->nop();
1710       // We are making a call.  Increment the count for null receiver.
1711       increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1712       ba(false, skip_receiver_profile);
1713       delayed()->nop();
1714       bind(not_null);
1715     }
1716 
1717     // Record the receiver type.
1718     record_klass_in_profile(receiver, scratch, true);
1719     bind(skip_receiver_profile);
1720 
1721     // The method data pointer needs to be updated to reflect the new target.
1722     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1723     bind (profile_continue);
1724   }
1725 }
1726 
1727 void InterpreterMacroAssembler::record_klass_in_profile_helper(
1728                                         Register receiver, Register scratch,
1729                                         int start_row, Label& done, bool is_virtual_call) {
1730   if (TypeProfileWidth == 0) {
1731     if (is_virtual_call) {
1732       increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
1733     }
1734     return;
1735   }
1736 
1737   int last_row = VirtualCallData::row_limit() - 1;
1738   assert(start_row <= last_row, "must be work left to do");
1739   // Test this row for both the receiver and for null.


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