src/cpu/x86/vm/stubGenerator_x86_64.cpp

changeset 2978
d83ac25d0304
parent 2691
348c0df561a9
child 3136
c565834fb592
     1.1 --- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Wed Jun 15 10:20:03 2011 -0700
     1.2 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Thu Jun 16 13:46:55 2011 -0700
     1.3 @@ -2934,7 +2934,9 @@
     1.4    // caller saved registers were assumed volatile in the compiler.
     1.5    address generate_throw_exception(const char* name,
     1.6                                     address runtime_entry,
     1.7 -                                   bool restore_saved_exception_pc) {
     1.8 +                                   bool restore_saved_exception_pc,
     1.9 +                                   Register arg1 = noreg,
    1.10 +                                   Register arg2 = noreg) {
    1.11      // Information about frame layout at time of blocking runtime call.
    1.12      // Note that we only have to preserve callee-saved registers since
    1.13      // the compilers are responsible for supplying a continuation point
    1.14 @@ -2980,6 +2982,13 @@
    1.15      __ set_last_Java_frame(rsp, rbp, NULL);
    1.16  
    1.17      // Call runtime
    1.18 +    if (arg1 != noreg) {
    1.19 +      assert(arg2 != c_rarg1, "clobbered");
    1.20 +      __ movptr(c_rarg1, arg1);
    1.21 +    }
    1.22 +    if (arg2 != noreg) {
    1.23 +      __ movptr(c_rarg2, arg2);
    1.24 +    }
    1.25      __ movptr(c_rarg0, r15_thread);
    1.26      BLOCK_COMMENT("call runtime_entry");
    1.27      __ call(RuntimeAddress(runtime_entry));
    1.28 @@ -3052,6 +3061,14 @@
    1.29      StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp();
    1.30  
    1.31      StubRoutines::x86::_verify_mxcsr_entry    = generate_verify_mxcsr();
    1.32 +
    1.33 +    // Build this early so it's available for the interpreter.  Stub
    1.34 +    // expects the required and actual types as register arguments in
    1.35 +    // j_rarg0 and j_rarg1 respectively.
    1.36 +    StubRoutines::_throw_WrongMethodTypeException_entry =
    1.37 +      generate_throw_exception("WrongMethodTypeException throw_exception",
    1.38 +                               CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException),
    1.39 +                               false, rax, rcx);
    1.40    }
    1.41  
    1.42    void generate_all() {

mercurial