comparison src/cpu/x86/vm/stubGenerator_x86_64.cpp @ 3451:38fa55e5e792

7055355: JSR 292: crash while throwing WrongMethodTypeException Reviewed-by: jrose, twisti, bdelsart
author never
date Thu, 16 Jun 2011 13:46:55 -0700
parents 348c0df561a9
children c565834fb592
comparison
equal deleted inserted replaced
3450:3275a6560cf7 3451:38fa55e5e792
2932 // AbstractMethodError on entry) are either at call sites or 2932 // AbstractMethodError on entry) are either at call sites or
2933 // otherwise assume that stack unwinding will be initiated, so 2933 // otherwise assume that stack unwinding will be initiated, so
2934 // caller saved registers were assumed volatile in the compiler. 2934 // caller saved registers were assumed volatile in the compiler.
2935 address generate_throw_exception(const char* name, 2935 address generate_throw_exception(const char* name,
2936 address runtime_entry, 2936 address runtime_entry,
2937 bool restore_saved_exception_pc) { 2937 bool restore_saved_exception_pc,
2938 Register arg1 = noreg,
2939 Register arg2 = noreg) {
2938 // Information about frame layout at time of blocking runtime call. 2940 // Information about frame layout at time of blocking runtime call.
2939 // Note that we only have to preserve callee-saved registers since 2941 // Note that we only have to preserve callee-saved registers since
2940 // the compilers are responsible for supplying a continuation point 2942 // the compilers are responsible for supplying a continuation point
2941 // if they expect all registers to be preserved. 2943 // if they expect all registers to be preserved.
2942 enum layout { 2944 enum layout {
2978 2980
2979 // Set up last_Java_sp and last_Java_fp 2981 // Set up last_Java_sp and last_Java_fp
2980 __ set_last_Java_frame(rsp, rbp, NULL); 2982 __ set_last_Java_frame(rsp, rbp, NULL);
2981 2983
2982 // Call runtime 2984 // Call runtime
2985 if (arg1 != noreg) {
2986 assert(arg2 != c_rarg1, "clobbered");
2987 __ movptr(c_rarg1, arg1);
2988 }
2989 if (arg2 != noreg) {
2990 __ movptr(c_rarg2, arg2);
2991 }
2983 __ movptr(c_rarg0, r15_thread); 2992 __ movptr(c_rarg0, r15_thread);
2984 BLOCK_COMMENT("call runtime_entry"); 2993 BLOCK_COMMENT("call runtime_entry");
2985 __ call(RuntimeAddress(runtime_entry)); 2994 __ call(RuntimeAddress(runtime_entry));
2986 2995
2987 // Generate oop map 2996 // Generate oop map
3050 3059
3051 // platform dependent 3060 // platform dependent
3052 StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp(); 3061 StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp();
3053 3062
3054 StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr(); 3063 StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr();
3064
3065 // Build this early so it's available for the interpreter. Stub
3066 // expects the required and actual types as register arguments in
3067 // j_rarg0 and j_rarg1 respectively.
3068 StubRoutines::_throw_WrongMethodTypeException_entry =
3069 generate_throw_exception("WrongMethodTypeException throw_exception",
3070 CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException),
3071 false, rax, rcx);
3055 } 3072 }
3056 3073
3057 void generate_all() { 3074 void generate_all() {
3058 // Generates all stubs and initializes the entry points 3075 // Generates all stubs and initializes the entry points
3059 3076