提交 c9bb8cb1 编写于 作者: C coleenp

7196681: NPG: Some JSR 292 tests crash in Windows exception handler

Summary: There was a rogue os::breakpoint() call in log_dependency left over from the jsr292 merge.  Also changed verify_oop() calls for metadata to verify_{method,klass}_ptr.
Reviewed-by: kvn, twisti
上级 85b8ac38
...@@ -2375,8 +2375,14 @@ public: ...@@ -2375,8 +2375,14 @@ public:
void _verify_oop(Register reg, const char * msg, const char * file, int line); void _verify_oop(Register reg, const char * msg, const char * file, int line);
void _verify_oop_addr(Address addr, const char * msg, const char * file, int line); void _verify_oop_addr(Address addr, const char * msg, const char * file, int line);
// TODO: verify_method and klass metadata (compare against vptr?)
void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line){}
#define verify_oop(reg) _verify_oop(reg, "broken oop " #reg, __FILE__, __LINE__) #define verify_oop(reg) _verify_oop(reg, "broken oop " #reg, __FILE__, __LINE__)
#define verify_oop_addr(addr) _verify_oop_addr(addr, "broken oop addr ", __FILE__, __LINE__) #define verify_oop_addr(addr) _verify_oop_addr(addr, "broken oop addr ", __FILE__, __LINE__)
#define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__)
#define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__)
// only if +VerifyOops // only if +VerifyOops
void verify_FPU(int stack_depth, const char* s = "illegal FPU state"); void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
......
...@@ -346,7 +346,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -346,7 +346,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// load receiver klass itself // load receiver klass itself
__ null_check(receiver_reg, oopDesc::klass_offset_in_bytes()); __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
__ load_klass(receiver_reg, temp1_recv_klass); __ load_klass(receiver_reg, temp1_recv_klass);
__ verify_oop(temp1_recv_klass); __ verify_klass_ptr(temp1_recv_klass);
} }
BLOCK_COMMENT("check_receiver {"); BLOCK_COMMENT("check_receiver {");
// The receiver for the MemberName must be in receiver_reg. // The receiver for the MemberName must be in receiver_reg.
...@@ -354,14 +354,14 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -354,14 +354,14 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) { if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
// Did not load it above... // Did not load it above...
__ load_klass(receiver_reg, temp1_recv_klass); __ load_klass(receiver_reg, temp1_recv_klass);
__ verify_oop(temp1_recv_klass); __ verify_klass_ptr(temp1_recv_klass);
} }
if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) { if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
Label L_ok; Label L_ok;
Register temp2_defc = temp2; Register temp2_defc = temp2;
__ load_heap_oop(member_clazz, temp2_defc); __ load_heap_oop(member_clazz, temp2_defc);
load_klass_from_Class(_masm, temp2_defc, temp3, temp4); load_klass_from_Class(_masm, temp2_defc, temp3, temp4);
__ verify_oop(temp2_defc); __ verify_klass_ptr(temp2_defc);
__ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok); __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok);
// If we get here, the type check failed! // If we get here, the type check failed!
__ STOP("receiver class disagrees with MemberName.clazz"); __ STOP("receiver class disagrees with MemberName.clazz");
...@@ -438,7 +438,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -438,7 +438,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
Register temp3_intf = temp3; Register temp3_intf = temp3;
__ load_heap_oop(member_clazz, temp3_intf); __ load_heap_oop(member_clazz, temp3_intf);
load_klass_from_Class(_masm, temp3_intf, temp2, temp4); load_klass_from_Class(_masm, temp3_intf, temp2, temp4);
__ verify_oop(temp3_intf); __ verify_klass_ptr(temp3_intf);
Register G5_index = G5_method; Register G5_index = G5_method;
__ ld_ptr(member_vmindex, G5_index); __ ld_ptr(member_vmindex, G5_index);
...@@ -458,7 +458,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -458,7 +458,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
temp2, no_sethi_temp, temp2, no_sethi_temp,
L_no_such_interface); L_no_such_interface);
__ verify_oop(G5_method); __ verify_method_ptr(G5_method);
jump_from_method_handle(_masm, G5_method, temp2, temp3, for_compiler_entry); jump_from_method_handle(_masm, G5_method, temp2, temp3, for_compiler_entry);
__ bind(L_no_such_interface); __ bind(L_no_such_interface);
...@@ -479,7 +479,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -479,7 +479,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// After figuring out which concrete method to call, jump into it. // After figuring out which concrete method to call, jump into it.
// Note that this works in the interpreter with no data motion. // Note that this works in the interpreter with no data motion.
// But the compiled version will require that rcx_recv be shifted out. // But the compiled version will require that rcx_recv be shifted out.
__ verify_oop(G5_method); __ verify_method_ptr(G5_method);
jump_from_method_handle(_masm, G5_method, temp1, temp3, for_compiler_entry); jump_from_method_handle(_masm, G5_method, temp1, temp3, for_compiler_entry);
} }
} }
......
...@@ -3018,7 +3018,7 @@ void TemplateTable::invokevirtual(int byte_no) { ...@@ -3018,7 +3018,7 @@ void TemplateTable::invokevirtual(int byte_no) {
// get receiver klass // get receiver klass
__ null_check(O0_recv, oopDesc::klass_offset_in_bytes()); __ null_check(O0_recv, oopDesc::klass_offset_in_bytes());
__ load_klass(O0_recv, O0_recv); __ load_klass(O0_recv, O0_recv);
__ verify_oop(O0_recv); __ verify_klass_ptr(O0_recv);
__ profile_virtual_call(O0_recv, O4); __ profile_virtual_call(O0_recv, O4);
......
...@@ -2274,9 +2274,17 @@ class MacroAssembler: public Assembler { ...@@ -2274,9 +2274,17 @@ class MacroAssembler: public Assembler {
// Debugging // Debugging
// only if +VerifyOops // only if +VerifyOops
// TODO: Make these macros with file and line like sparc version!
void verify_oop(Register reg, const char* s = "broken oop"); void verify_oop(Register reg, const char* s = "broken oop");
void verify_oop_addr(Address addr, const char * s = "broken oop addr"); void verify_oop_addr(Address addr, const char * s = "broken oop addr");
// TODO: verify method and klass metadata (compare against vptr?)
void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line){}
#define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__)
#define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__)
// only if +VerifyFPU // only if +VerifyFPU
void verify_FPU(int stack_depth, const char* s = "illegal FPU state"); void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
......
...@@ -1110,7 +1110,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { ...@@ -1110,7 +1110,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// allocate space for parameters // allocate space for parameters
__ movptr(method, STATE(_method)); __ movptr(method, STATE(_method));
__ verify_oop(method); __ verify_method_ptr(method);
__ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset())); __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
__ shll(t, 2); __ shll(t, 2);
#ifdef _LP64 #ifdef _LP64
...@@ -1134,7 +1134,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { ...@@ -1134,7 +1134,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
__ movptr(method, STATE(_method)); __ movptr(method, STATE(_method));
__ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
__ jcc(Assembler::notEqual, pending_exception_present); __ jcc(Assembler::notEqual, pending_exception_present);
__ verify_oop(method); __ verify_method_ptr(method);
__ movptr(t, Address(method, Method::signature_handler_offset())); __ movptr(t, Address(method, Method::signature_handler_offset()));
__ bind(L); __ bind(L);
} }
...@@ -1162,7 +1162,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { ...@@ -1162,7 +1162,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
__ movptr(from_ptr, STATE(_locals)); // get the from pointer __ movptr(from_ptr, STATE(_locals)); // get the from pointer
__ call(t); __ call(t);
__ movptr(method, STATE(_method)); __ movptr(method, STATE(_method));
__ verify_oop(method); __ verify_method_ptr(method);
// result handler is in rax // result handler is in rax
// set result handler // set result handler
...@@ -1176,7 +1176,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { ...@@ -1176,7 +1176,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
__ jcc(Assembler::notZero, L); __ jcc(Assembler::notZero, L);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method); __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method);
__ movptr(method, STATE(_method)); __ movptr(method, STATE(_method));
__ verify_oop(method); __ verify_method_ptr(method);
__ movptr(rax, Address(method, Method::native_function_offset())); __ movptr(rax, Address(method, Method::native_function_offset()));
__ bind(L); __ bind(L);
} }
...@@ -1351,7 +1351,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { ...@@ -1351,7 +1351,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
__ increment(rsp, wordSize); __ increment(rsp, wordSize);
__ movptr(method, STATE(_method)); __ movptr(method, STATE(_method));
__ verify_oop(method); __ verify_method_ptr(method);
__ movptr(thread, STATE(_thread)); // get thread __ movptr(thread, STATE(_thread)); // get thread
__ bind(Continue); __ bind(Continue);
......
...@@ -118,7 +118,7 @@ void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Registe ...@@ -118,7 +118,7 @@ void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Registe
void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp, void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
bool for_compiler_entry) { bool for_compiler_entry) {
assert(method == rbx, "interpreter calling convention"); assert(method == rbx, "interpreter calling convention");
__ verify_oop(method); __ verify_method_ptr(method);
if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) { if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
Label run_compiled_code; Label run_compiled_code;
...@@ -358,7 +358,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -358,7 +358,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// load receiver klass itself // load receiver klass itself
__ null_check(receiver_reg, oopDesc::klass_offset_in_bytes()); __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
__ load_klass(temp1_recv_klass, receiver_reg); __ load_klass(temp1_recv_klass, receiver_reg);
__ verify_oop(temp1_recv_klass); __ verify_klass_ptr(temp1_recv_klass);
} }
BLOCK_COMMENT("check_receiver {"); BLOCK_COMMENT("check_receiver {");
// The receiver for the MemberName must be in receiver_reg. // The receiver for the MemberName must be in receiver_reg.
...@@ -366,14 +366,14 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -366,14 +366,14 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) { if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
// Did not load it above... // Did not load it above...
__ load_klass(temp1_recv_klass, receiver_reg); __ load_klass(temp1_recv_klass, receiver_reg);
__ verify_oop(temp1_recv_klass); __ verify_klass_ptr(temp1_recv_klass);
} }
if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) { if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
Label L_ok; Label L_ok;
Register temp2_defc = temp2; Register temp2_defc = temp2;
__ load_heap_oop(temp2_defc, member_clazz); __ load_heap_oop(temp2_defc, member_clazz);
load_klass_from_Class(_masm, temp2_defc); load_klass_from_Class(_masm, temp2_defc);
__ verify_oop(temp2_defc); __ verify_klass_ptr(temp2_defc);
__ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok); __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
// If we get here, the type check failed! // If we get here, the type check failed!
__ STOP("receiver class disagrees with MemberName.clazz"); __ STOP("receiver class disagrees with MemberName.clazz");
...@@ -451,7 +451,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -451,7 +451,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
Register temp3_intf = temp3; Register temp3_intf = temp3;
__ load_heap_oop(temp3_intf, member_clazz); __ load_heap_oop(temp3_intf, member_clazz);
load_klass_from_Class(_masm, temp3_intf); load_klass_from_Class(_masm, temp3_intf);
__ verify_oop(temp3_intf); __ verify_klass_ptr(temp3_intf);
Register rbx_index = rbx_method; Register rbx_index = rbx_method;
__ movptr(rbx_index, member_vmindex); __ movptr(rbx_index, member_vmindex);
...@@ -471,7 +471,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -471,7 +471,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
temp2, temp2,
L_no_such_interface); L_no_such_interface);
__ verify_oop(rbx_method); __ verify_method_ptr(rbx_method);
jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry); jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry);
__ hlt(); __ hlt();
...@@ -491,7 +491,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, ...@@ -491,7 +491,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// After figuring out which concrete method to call, jump into it. // After figuring out which concrete method to call, jump into it.
// Note that this works in the interpreter with no data motion. // Note that this works in the interpreter with no data motion.
// But the compiled version will require that rcx_recv be shifted out. // But the compiled version will require that rcx_recv be shifted out.
__ verify_oop(rbx_method); __ verify_method_ptr(rbx_method);
jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry); jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry);
} }
} }
......
...@@ -3107,7 +3107,7 @@ void TemplateTable::invokehandle(int byte_no) { ...@@ -3107,7 +3107,7 @@ void TemplateTable::invokehandle(int byte_no) {
prepare_invoke(byte_no, prepare_invoke(byte_no,
rbx_method, rax_mtype, // get f2 Method*, f1 MethodType rbx_method, rax_mtype, // get f2 Method*, f1 MethodType
rcx_recv); rcx_recv);
__ verify_oop(rbx_method); __ verify_method_ptr(rbx_method);
__ verify_oop(rcx_recv); __ verify_oop(rcx_recv);
__ null_check(rcx_recv); __ null_check(rcx_recv);
......
...@@ -3158,7 +3158,7 @@ void TemplateTable::invokehandle(int byte_no) { ...@@ -3158,7 +3158,7 @@ void TemplateTable::invokehandle(int byte_no) {
prepare_invoke(byte_no, prepare_invoke(byte_no,
rbx_method, rax_mtype, // get f2 Method*, f1 MethodType rbx_method, rax_mtype, // get f2 Method*, f1 MethodType
rcx_recv); rcx_recv);
__ verify_oop(rbx_method); __ verify_method_ptr(rbx_method);
__ verify_oop(rcx_recv); __ verify_oop(rcx_recv);
__ null_check(rcx_recv); __ null_check(rcx_recv);
......
...@@ -567,9 +567,6 @@ void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[], ...@@ -567,9 +567,6 @@ void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[],
void Dependencies::DepStream::log_dependency(Klass* witness) { void Dependencies::DepStream::log_dependency(Klass* witness) {
if (_deps == NULL && xtty == NULL) return; // fast cutout for runtime if (_deps == NULL && xtty == NULL) return; // fast cutout for runtime
if (type() == call_site_target_value) {
os::breakpoint();
}
int nargs = argument_count(); int nargs = argument_count();
DepArgument args[max_arg_count]; DepArgument args[max_arg_count];
for (int j = 0; j < nargs; j++) { for (int j = 0; j < nargs; j++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册