src/cpu/x86/vm/interp_masm_x86_64.cpp

changeset 1543
85f13cdfbc1d
parent 1402
6918603297f7
child 1641
87684f1a88b5
     1.1 --- a/src/cpu/x86/vm/interp_masm_x86_64.cpp	Tue Dec 15 17:19:40 2009 -0800
     1.2 +++ b/src/cpu/x86/vm/interp_masm_x86_64.cpp	Wed Dec 16 12:48:04 2009 +0100
     1.3 @@ -185,12 +185,30 @@
     1.4  }
     1.5  
     1.6  
     1.7 +void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index,
     1.8 +                                                       int bcp_offset,
     1.9 +                                                       bool giant_index) {
    1.10 +  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
    1.11 +  if (!giant_index) {
    1.12 +    load_unsigned_short(index, Address(r13, bcp_offset));
    1.13 +  } else {
    1.14 +    assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic");
    1.15 +    movl(index, Address(r13, bcp_offset));
    1.16 +    // Check if the secondary index definition is still ~x, otherwise
    1.17 +    // we have to change the following assembler code to calculate the
    1.18 +    // plain index.
    1.19 +    assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line");
    1.20 +    notl(index);  // convert to plain index
    1.21 +  }
    1.22 +}
    1.23 +
    1.24 +
    1.25  void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache,
    1.26                                                             Register index,
    1.27 -                                                           int bcp_offset) {
    1.28 -  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
    1.29 +                                                           int bcp_offset,
    1.30 +                                                           bool giant_index) {
    1.31    assert(cache != index, "must use different registers");
    1.32 -  load_unsigned_short(index, Address(r13, bcp_offset));
    1.33 +  get_cache_index_at_bcp(index, bcp_offset, giant_index);
    1.34    movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize));
    1.35    assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below");
    1.36    // convert from field index to ConstantPoolCacheEntry index
    1.37 @@ -200,10 +218,10 @@
    1.38  
    1.39  void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache,
    1.40                                                                 Register tmp,
    1.41 -                                                               int bcp_offset) {
    1.42 -  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
    1.43 +                                                               int bcp_offset,
    1.44 +                                                               bool giant_index) {
    1.45    assert(cache != tmp, "must use different register");
    1.46 -  load_unsigned_short(tmp, Address(r13, bcp_offset));
    1.47 +  get_cache_index_at_bcp(tmp, bcp_offset, giant_index);
    1.48    assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below");
    1.49    // convert from field index to ConstantPoolCacheEntry index
    1.50    // and from word offset to byte offset
    1.51 @@ -1236,7 +1254,8 @@
    1.52  
    1.53  void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
    1.54                                                       Register mdp,
    1.55 -                                                     Register reg2) {
    1.56 +                                                     Register reg2,
    1.57 +                                                     bool receiver_can_be_null) {
    1.58    if (ProfileInterpreter) {
    1.59      Label profile_continue;
    1.60  
    1.61 @@ -1246,8 +1265,15 @@
    1.62      // We are making a call.  Increment the count.
    1.63      increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
    1.64  
    1.65 +    Label skip_receiver_profile;
    1.66 +    if (receiver_can_be_null) {
    1.67 +      testptr(receiver, receiver);
    1.68 +      jcc(Assembler::zero, skip_receiver_profile);
    1.69 +    }
    1.70 +
    1.71      // Record the receiver type.
    1.72      record_klass_in_profile(receiver, mdp, reg2);
    1.73 +    bind(skip_receiver_profile);
    1.74  
    1.75      // The method data pointer needs to be updated to reflect the new target.
    1.76      update_mdp_by_constant(mdp,

mercurial