src/cpu/x86/vm/stubGenerator_x86_32.cpp

changeset 2978
d83ac25d0304
parent 2606
0ac769a57c64
child 3136
c565834fb592
     1.1 --- a/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Wed Jun 15 10:20:03 2011 -0700
     1.2 +++ b/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Thu Jun 16 13:46:55 2011 -0700
     1.3 @@ -2151,6 +2151,8 @@
     1.4    // if they expect all registers to be preserved.
     1.5    enum layout {
     1.6      thread_off,    // last_java_sp
     1.7 +    arg1_off,
     1.8 +    arg2_off,
     1.9      rbp_off,       // callee saved register
    1.10      ret_pc,
    1.11      framesize
    1.12 @@ -2185,7 +2187,7 @@
    1.13    // either at call sites or otherwise assume that stack unwinding will be initiated,
    1.14    // so caller saved registers were assumed volatile in the compiler.
    1.15    address generate_throw_exception(const char* name, address runtime_entry,
    1.16 -                                   bool restore_saved_exception_pc) {
    1.17 +                                   bool restore_saved_exception_pc, Register arg1 = noreg, Register arg2 = noreg) {
    1.18  
    1.19      int insts_size = 256;
    1.20      int locs_size  = 32;
    1.21 @@ -2218,6 +2220,13 @@
    1.22  
    1.23      // push java thread (becomes first argument of C function)
    1.24      __ movptr(Address(rsp, thread_off * wordSize), java_thread);
    1.25 +    if (arg1 != noreg) {
    1.26 +      __ movptr(Address(rsp, arg1_off * wordSize), arg1);
    1.27 +    }
    1.28 +    if (arg2 != noreg) {
    1.29 +      assert(arg1 != noreg, "missing reg arg");
    1.30 +      __ movptr(Address(rsp, arg2_off * wordSize), arg2);
    1.31 +    }
    1.32  
    1.33      // Set up last_Java_sp and last_Java_fp
    1.34      __ set_last_Java_frame(java_thread, rsp, rbp, NULL);
    1.35 @@ -2309,6 +2318,12 @@
    1.36                                                                                     CAST_FROM_FN_PTR(address, SharedRuntime::d2i));
    1.37      StubRoutines::_d2l_wrapper                              = generate_d2i_wrapper(T_LONG,
    1.38                                                                                     CAST_FROM_FN_PTR(address, SharedRuntime::d2l));
    1.39 +
    1.40 +    // Build this early so it's available for the interpreter
    1.41 +    StubRoutines::_throw_WrongMethodTypeException_entry =
    1.42 +      generate_throw_exception("WrongMethodTypeException throw_exception",
    1.43 +                               CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException),
    1.44 +                               false, rax, rcx);
    1.45    }
    1.46  
    1.47  

mercurial