Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/sparc/vm/interp_masm_sparc.cpp
          +++ new/src/cpu/sparc/vm/interp_masm_sparc.cpp
↓ open down ↓ 806 lines elided ↑ open up ↑
 807  807    // Unsigned load is faster than signed on some implementations
 808  808    ldub(Lbcp, bcp_offset + 0, Rtmp);  sll(Rtmp, 24, Rtmp);
 809  809  #endif
 810  810    or3(Rtmp, Rdst, Rdst );
 811  811  
 812  812    bind(aligned);
 813  813    if (should_set_CC == set_CC) tst(Rdst);
 814  814  }
 815  815  
 816  816  
 817      -void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset) {
      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) {
 818  833    assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 819  834    assert_different_registers(cache, tmp);
 820  835    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
      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
 824  839    sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 825  840    add(LcpoolCache, tmp, cache);
 826  841  }
 827  842  
 828  843  
 829      -void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) {
      844 +void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp,
      845 +                                                               int bcp_offset, bool giant_index) {
 830  846    assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
 831  847    assert_different_registers(cache, tmp);
 832  848    assert_not_delayed();
      849 +  assert(!giant_index,"NYI");
 833  850    get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
 834  851                // convert from field index to ConstantPoolCacheEntry index
 835  852                // and from word index to byte offset
 836  853    sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 837  854                // skip past the header
 838  855    add(tmp, in_bytes(constantPoolCacheOopDesc::base_offset()), tmp);
 839  856                // construct pointer to cache entry
 840  857    add(LcpoolCache, tmp, cache);
 841  858  }
 842  859  
↓ open down ↓ 825 lines elided ↑ open up ↑
1668 1685      // The method data pointer needs to be updated to reflect the new target.
1669 1686      update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1670 1687      bind (profile_continue);
1671 1688    }
1672 1689  }
1673 1690  
1674 1691  
1675 1692  // Count a virtual call in the bytecodes.
1676 1693  
1677 1694  void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
1678      -                                                     Register scratch) {
     1695 +                                                     Register scratch,
     1696 +                                                     bool receiver_can_be_null) {
1679 1697    if (ProfileInterpreter) {
1680 1698      Label profile_continue;
1681 1699  
1682 1700      // If no method data exists, go to profile_continue.
1683 1701      test_method_data_pointer(profile_continue);
1684 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 +
1685 1717      // Record the receiver type.
1686 1718      record_klass_in_profile(receiver, scratch, true);
     1719 +    bind(skip_receiver_profile);
1687 1720  
1688 1721      // The method data pointer needs to be updated to reflect the new target.
1689 1722      update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
1690 1723      bind (profile_continue);
1691 1724    }
1692 1725  }
1693 1726  
1694 1727  void InterpreterMacroAssembler::record_klass_in_profile_helper(
1695 1728                                          Register receiver, Register scratch,
1696 1729                                          int start_row, Label& done, bool is_virtual_call) {
↓ open down ↓ 870 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX