comparison src/cpu/x86/vm/templateInterpreter_x86_32.cpp @ 2700: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 3d2ab563047a
children b20d64f83668
comparison
equal deleted inserted replaced
27:26fb11eb49cd 28:a5b0f280afa6
109 CAST_FROM_FN_PTR(address, 109 CAST_FROM_FN_PTR(address,
110 InterpreterRuntime::throw_ClassCastException), 110 InterpreterRuntime::throw_ClassCastException),
111 rax); 111 rax);
112 return entry; 112 return entry;
113 } 113 }
114
115 // Arguments are: required type at TOS+4, failing object (or NULL) at TOS.
116 address TemplateInterpreterGenerator::generate_WrongMethodType_handler() {
117 address entry = __ pc();
118
119 __ pop(rbx); // actual failing object is at TOS
120 __ pop(rax); // required type is at TOS+4
121
122 __ verify_oop(rbx);
123 __ verify_oop(rax);
124
125 // Various method handle types use interpreter registers as temps.
126 __ restore_bcp();
127 __ restore_locals();
128
129 // Expression stack must be empty before entering the VM for an exception.
130 __ empty_expression_stack();
131 __ empty_FPU_stack();
132 __ call_VM(noreg,
133 CAST_FROM_FN_PTR(address,
134 InterpreterRuntime::throw_WrongMethodTypeException),
135 // pass required type, failing object (or NULL)
136 rax, rbx);
137 return entry;
138 }
139
140 114
141 address TemplateInterpreterGenerator::generate_exception_handler_common(const char* name, const char* message, bool pass_oop) { 115 address TemplateInterpreterGenerator::generate_exception_handler_common(const char* name, const char* message, bool pass_oop) {
142 assert(!pass_oop || message == NULL, "either oop or message but not both"); 116 assert(!pass_oop || message == NULL, "either oop or message but not both");
143 address entry = __ pc(); 117 address entry = __ pc();
144 if (pass_oop) { 118 if (pass_oop) {