src/cpu/x86/vm/templateTable_x86_32.cpp

changeset 3698
19e197e2a1af
parent 3400
22cee0ee8927
child 3969
1d7922586cf6
     1.1 --- a/src/cpu/x86/vm/templateTable_x86_32.cpp	Sun Apr 01 17:04:26 2012 -0400
     1.2 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp	Thu Apr 05 12:17:52 2012 -0400
     1.3 @@ -2651,56 +2651,49 @@
     1.4      // Check to see if a field modification watch has been set before we take
     1.5      // the time to call into the VM.
     1.6      Label L2;
     1.7 -    __ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
     1.8 -    __ testl(rcx,rcx);
     1.9 -    __ jcc(Assembler::zero, L2);
    1.10 -    __ pop_ptr(rbx);               // copy the object pointer from tos
    1.11 -    __ verify_oop(rbx);
    1.12 -    __ push_ptr(rbx);              // put the object pointer back on tos
    1.13 -    __ subptr(rsp, sizeof(jvalue));  // add space for a jvalue object
    1.14 -    __ mov(rcx, rsp);
    1.15 -    __ push_ptr(rbx);                 // save object pointer so we can steal rbx,
    1.16 -    __ xorptr(rbx, rbx);
    1.17 -    const Address lo_value(rcx, rbx, Address::times_1, 0*wordSize);
    1.18 -    const Address hi_value(rcx, rbx, Address::times_1, 1*wordSize);
    1.19 -    switch (bytecode()) {          // load values into the jvalue object
    1.20 -    case Bytecodes::_fast_bputfield: __ movb(lo_value, rax); break;
    1.21 -    case Bytecodes::_fast_sputfield: __ movw(lo_value, rax); break;
    1.22 -    case Bytecodes::_fast_cputfield: __ movw(lo_value, rax); break;
    1.23 -    case Bytecodes::_fast_iputfield: __ movl(lo_value, rax);                         break;
    1.24 -    case Bytecodes::_fast_lputfield:
    1.25 -      NOT_LP64(__ movptr(hi_value, rdx));
    1.26 -      __ movptr(lo_value, rax);
    1.27 -      break;
    1.28 -
    1.29 -    // need to call fld_s() after fstp_s() to restore the value for below
    1.30 -    case Bytecodes::_fast_fputfield: __ fstp_s(lo_value); __ fld_s(lo_value);        break;
    1.31 -
    1.32 -    // need to call fld_d() after fstp_d() to restore the value for below
    1.33 -    case Bytecodes::_fast_dputfield: __ fstp_d(lo_value); __ fld_d(lo_value);        break;
    1.34 -
    1.35 -    // since rcx is not an object we don't call store_check() here
    1.36 -    case Bytecodes::_fast_aputfield: __ movptr(lo_value, rax);                       break;
    1.37 -
    1.38 -    default:  ShouldNotReachHere();
    1.39 -    }
    1.40 -    __ pop_ptr(rbx);  // restore copy of object pointer
    1.41 -
    1.42 -    // Save rax, and sometimes rdx because call_VM() will clobber them,
    1.43 -    // then use them for JVM/DI purposes
    1.44 -    __ push(rax);
    1.45 -    if (bytecode() == Bytecodes::_fast_lputfield) __ push(rdx);
    1.46 -    // access constant pool cache entry
    1.47 -    __ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
    1.48 -    __ verify_oop(rbx);
    1.49 -    // rbx,: object pointer copied above
    1.50 -    // rax,: cache entry pointer
    1.51 -    // rcx: jvalue object on the stack
    1.52 -    __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
    1.53 -    if (bytecode() == Bytecodes::_fast_lputfield) __ pop(rdx);  // restore high value
    1.54 -    __ pop(rax);     // restore lower value
    1.55 -    __ addptr(rsp, sizeof(jvalue));  // release jvalue object space
    1.56 -    __ bind(L2);
    1.57 +     __ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
    1.58 +     __ testl(rcx,rcx);
    1.59 +     __ jcc(Assembler::zero, L2);
    1.60 +     __ pop_ptr(rbx);               // copy the object pointer from tos
    1.61 +     __ verify_oop(rbx);
    1.62 +     __ push_ptr(rbx);              // put the object pointer back on tos
    1.63 +
    1.64 +     // Save tos values before call_VM() clobbers them. Since we have
    1.65 +     // to do it for every data type, we use the saved values as the
    1.66 +     // jvalue object.
    1.67 +     switch (bytecode()) {          // load values into the jvalue object
    1.68 +     case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
    1.69 +     case Bytecodes::_fast_bputfield: // fall through
    1.70 +     case Bytecodes::_fast_sputfield: // fall through
    1.71 +     case Bytecodes::_fast_cputfield: // fall through
    1.72 +     case Bytecodes::_fast_iputfield: __ push_i(rax); break;
    1.73 +     case Bytecodes::_fast_dputfield: __ push_d(); break;
    1.74 +     case Bytecodes::_fast_fputfield: __ push_f(); break;
    1.75 +     case Bytecodes::_fast_lputfield: __ push_l(rax); break;
    1.76 +
    1.77 +     default:
    1.78 +       ShouldNotReachHere();
    1.79 +     }
    1.80 +     __ mov(rcx, rsp);              // points to jvalue on the stack
    1.81 +     // access constant pool cache entry
    1.82 +     __ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
    1.83 +     __ verify_oop(rbx);
    1.84 +     // rbx,: object pointer copied above
    1.85 +     // rax,: cache entry pointer
    1.86 +     // rcx: jvalue object on the stack
    1.87 +     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
    1.88 +
    1.89 +     switch (bytecode()) {             // restore tos values
    1.90 +     case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
    1.91 +     case Bytecodes::_fast_bputfield: // fall through
    1.92 +     case Bytecodes::_fast_sputfield: // fall through
    1.93 +     case Bytecodes::_fast_cputfield: // fall through
    1.94 +     case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
    1.95 +     case Bytecodes::_fast_dputfield: __ pop_d(); break;
    1.96 +     case Bytecodes::_fast_fputfield: __ pop_f(); break;
    1.97 +     case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
    1.98 +     }
    1.99 +     __ bind(L2);
   1.100    }
   1.101  }
   1.102  

mercurial