7196681: NPG: Some JSR 292 tests crash in Windows exception handler
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
This commit is contained in:
parent
08757b8a99
commit
6f1b52ab16
@ -2375,8 +2375,14 @@ public:
|
||||
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);
|
||||
|
||||
// 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_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
|
||||
void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
|
||||
|
@ -346,7 +346,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
// load receiver klass itself
|
||||
__ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
|
||||
__ load_klass(receiver_reg, temp1_recv_klass);
|
||||
__ verify_oop(temp1_recv_klass);
|
||||
__ verify_klass_ptr(temp1_recv_klass);
|
||||
}
|
||||
BLOCK_COMMENT("check_receiver {");
|
||||
// The receiver for the MemberName must be in receiver_reg.
|
||||
@ -354,14 +354,14 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
|
||||
// Did not load it above...
|
||||
__ load_klass(receiver_reg, temp1_recv_klass);
|
||||
__ verify_oop(temp1_recv_klass);
|
||||
__ verify_klass_ptr(temp1_recv_klass);
|
||||
}
|
||||
if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
|
||||
Label L_ok;
|
||||
Register temp2_defc = temp2;
|
||||
__ load_heap_oop(member_clazz, temp2_defc);
|
||||
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);
|
||||
// If we get here, the type check failed!
|
||||
__ STOP("receiver class disagrees with MemberName.clazz");
|
||||
@ -438,7 +438,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
Register temp3_intf = temp3;
|
||||
__ load_heap_oop(member_clazz, temp3_intf);
|
||||
load_klass_from_Class(_masm, temp3_intf, temp2, temp4);
|
||||
__ verify_oop(temp3_intf);
|
||||
__ verify_klass_ptr(temp3_intf);
|
||||
|
||||
Register G5_index = G5_method;
|
||||
__ ld_ptr(member_vmindex, G5_index);
|
||||
@ -458,7 +458,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
temp2, no_sethi_temp,
|
||||
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);
|
||||
|
||||
__ bind(L_no_such_interface);
|
||||
@ -479,7 +479,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
// After figuring out which concrete method to call, jump into it.
|
||||
// Note that this works in the interpreter with no data motion.
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
@ -3018,7 +3018,7 @@ void TemplateTable::invokevirtual(int byte_no) {
|
||||
// get receiver klass
|
||||
__ null_check(O0_recv, oopDesc::klass_offset_in_bytes());
|
||||
__ load_klass(O0_recv, O0_recv);
|
||||
__ verify_oop(O0_recv);
|
||||
__ verify_klass_ptr(O0_recv);
|
||||
|
||||
__ profile_virtual_call(O0_recv, O4);
|
||||
|
||||
|
@ -2274,9 +2274,17 @@ class MacroAssembler: public Assembler {
|
||||
// Debugging
|
||||
|
||||
// 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_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
|
||||
void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
|
||||
|
||||
|
@ -1110,7 +1110,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
|
||||
// allocate space for parameters
|
||||
__ movptr(method, STATE(_method));
|
||||
__ verify_oop(method);
|
||||
__ verify_method_ptr(method);
|
||||
__ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
|
||||
__ shll(t, 2);
|
||||
#ifdef _LP64
|
||||
@ -1134,7 +1134,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ movptr(method, STATE(_method));
|
||||
__ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
|
||||
__ jcc(Assembler::notEqual, pending_exception_present);
|
||||
__ verify_oop(method);
|
||||
__ verify_method_ptr(method);
|
||||
__ movptr(t, Address(method, Method::signature_handler_offset()));
|
||||
__ bind(L);
|
||||
}
|
||||
@ -1162,7 +1162,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ movptr(from_ptr, STATE(_locals)); // get the from pointer
|
||||
__ call(t);
|
||||
__ movptr(method, STATE(_method));
|
||||
__ verify_oop(method);
|
||||
__ verify_method_ptr(method);
|
||||
|
||||
// result handler is in rax
|
||||
// set result handler
|
||||
@ -1176,7 +1176,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ jcc(Assembler::notZero, L);
|
||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method);
|
||||
__ movptr(method, STATE(_method));
|
||||
__ verify_oop(method);
|
||||
__ verify_method_ptr(method);
|
||||
__ movptr(rax, Address(method, Method::native_function_offset()));
|
||||
__ bind(L);
|
||||
}
|
||||
@ -1351,7 +1351,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ increment(rsp, wordSize);
|
||||
|
||||
__ movptr(method, STATE(_method));
|
||||
__ verify_oop(method);
|
||||
__ verify_method_ptr(method);
|
||||
__ movptr(thread, STATE(_thread)); // get thread
|
||||
|
||||
__ bind(Continue);
|
||||
|
@ -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,
|
||||
bool for_compiler_entry) {
|
||||
assert(method == rbx, "interpreter calling convention");
|
||||
__ verify_oop(method);
|
||||
__ verify_method_ptr(method);
|
||||
|
||||
if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
|
||||
Label run_compiled_code;
|
||||
@ -358,7 +358,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
// load receiver klass itself
|
||||
__ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
|
||||
__ load_klass(temp1_recv_klass, receiver_reg);
|
||||
__ verify_oop(temp1_recv_klass);
|
||||
__ verify_klass_ptr(temp1_recv_klass);
|
||||
}
|
||||
BLOCK_COMMENT("check_receiver {");
|
||||
// The receiver for the MemberName must be in receiver_reg.
|
||||
@ -366,14 +366,14 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
|
||||
// Did not load it above...
|
||||
__ load_klass(temp1_recv_klass, receiver_reg);
|
||||
__ verify_oop(temp1_recv_klass);
|
||||
__ verify_klass_ptr(temp1_recv_klass);
|
||||
}
|
||||
if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
|
||||
Label L_ok;
|
||||
Register temp2_defc = temp2;
|
||||
__ load_heap_oop(temp2_defc, member_clazz);
|
||||
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);
|
||||
// If we get here, the type check failed!
|
||||
__ STOP("receiver class disagrees with MemberName.clazz");
|
||||
@ -451,7 +451,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
Register temp3_intf = temp3;
|
||||
__ load_heap_oop(temp3_intf, member_clazz);
|
||||
load_klass_from_Class(_masm, temp3_intf);
|
||||
__ verify_oop(temp3_intf);
|
||||
__ verify_klass_ptr(temp3_intf);
|
||||
|
||||
Register rbx_index = rbx_method;
|
||||
__ movptr(rbx_index, member_vmindex);
|
||||
@ -471,7 +471,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
temp2,
|
||||
L_no_such_interface);
|
||||
|
||||
__ verify_oop(rbx_method);
|
||||
__ verify_method_ptr(rbx_method);
|
||||
jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry);
|
||||
__ hlt();
|
||||
|
||||
@ -491,7 +491,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
// After figuring out which concrete method to call, jump into it.
|
||||
// Note that this works in the interpreter with no data motion.
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
@ -3107,7 +3107,7 @@ void TemplateTable::invokehandle(int byte_no) {
|
||||
prepare_invoke(byte_no,
|
||||
rbx_method, rax_mtype, // get f2 Method*, f1 MethodType
|
||||
rcx_recv);
|
||||
__ verify_oop(rbx_method);
|
||||
__ verify_method_ptr(rbx_method);
|
||||
__ verify_oop(rcx_recv);
|
||||
__ null_check(rcx_recv);
|
||||
|
||||
|
@ -3158,7 +3158,7 @@ void TemplateTable::invokehandle(int byte_no) {
|
||||
prepare_invoke(byte_no,
|
||||
rbx_method, rax_mtype, // get f2 Method*, f1 MethodType
|
||||
rcx_recv);
|
||||
__ verify_oop(rbx_method);
|
||||
__ verify_method_ptr(rbx_method);
|
||||
__ verify_oop(rcx_recv);
|
||||
__ null_check(rcx_recv);
|
||||
|
||||
|
@ -567,9 +567,6 @@ void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[],
|
||||
|
||||
void Dependencies::DepStream::log_dependency(Klass* witness) {
|
||||
if (_deps == NULL && xtty == NULL) return; // fast cutout for runtime
|
||||
if (type() == call_site_target_value) {
|
||||
os::breakpoint();
|
||||
}
|
||||
int nargs = argument_count();
|
||||
DepArgument args[max_arg_count];
|
||||
for (int j = 0; j < nargs; j++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user