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

Tue, 11 Sep 2012 20:20:38 -0400

author
coleenp
date
Tue, 11 Sep 2012 20:20:38 -0400
changeset 4052
75f33eecc1b3
parent 4051
8a02ca5e5576
child 4055
43d524adb671

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

src/cpu/sparc/vm/assembler_sparc.hpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/methodHandles_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/templateTable_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/assembler_x86.hpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/cppInterpreter_x86.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/methodHandles_x86.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/templateTable_x86_32.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/templateTable_x86_64.cpp file | annotate | diff | comparison | revisions
src/share/vm/code/dependencies.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/sparc/vm/assembler_sparc.hpp	Tue Sep 11 16:20:57 2012 +0200
     1.2 +++ b/src/cpu/sparc/vm/assembler_sparc.hpp	Tue Sep 11 20:20:38 2012 -0400
     1.3 @@ -2375,8 +2375,14 @@
     1.4    void _verify_oop(Register reg, const char * msg, const char * file, int line);
     1.5    void _verify_oop_addr(Address addr, const char * msg, const char * file, int line);
     1.6  
     1.7 +  // TODO: verify_method and klass metadata (compare against vptr?)
     1.8 +  void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
     1.9 +  void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line){}
    1.10 +
    1.11  #define verify_oop(reg) _verify_oop(reg, "broken oop " #reg, __FILE__, __LINE__)
    1.12  #define verify_oop_addr(addr) _verify_oop_addr(addr, "broken oop addr ", __FILE__, __LINE__)
    1.13 +#define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__)
    1.14 +#define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__)
    1.15  
    1.16          // only if +VerifyOops
    1.17    void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
     2.1 --- a/src/cpu/sparc/vm/methodHandles_sparc.cpp	Tue Sep 11 16:20:57 2012 +0200
     2.2 +++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp	Tue Sep 11 20:20:38 2012 -0400
     2.3 @@ -346,7 +346,7 @@
     2.4          // load receiver klass itself
     2.5          __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
     2.6          __ load_klass(receiver_reg, temp1_recv_klass);
     2.7 -        __ verify_oop(temp1_recv_klass);
     2.8 +        __ verify_klass_ptr(temp1_recv_klass);
     2.9        }
    2.10        BLOCK_COMMENT("check_receiver {");
    2.11        // The receiver for the MemberName must be in receiver_reg.
    2.12 @@ -354,14 +354,14 @@
    2.13        if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
    2.14          // Did not load it above...
    2.15          __ load_klass(receiver_reg, temp1_recv_klass);
    2.16 -        __ verify_oop(temp1_recv_klass);
    2.17 +        __ verify_klass_ptr(temp1_recv_klass);
    2.18        }
    2.19        if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
    2.20          Label L_ok;
    2.21          Register temp2_defc = temp2;
    2.22          __ load_heap_oop(member_clazz, temp2_defc);
    2.23          load_klass_from_Class(_masm, temp2_defc, temp3, temp4);
    2.24 -        __ verify_oop(temp2_defc);
    2.25 +        __ verify_klass_ptr(temp2_defc);
    2.26          __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok);
    2.27          // If we get here, the type check failed!
    2.28          __ STOP("receiver class disagrees with MemberName.clazz");
    2.29 @@ -438,7 +438,7 @@
    2.30        Register temp3_intf = temp3;
    2.31        __ load_heap_oop(member_clazz, temp3_intf);
    2.32        load_klass_from_Class(_masm, temp3_intf, temp2, temp4);
    2.33 -      __ verify_oop(temp3_intf);
    2.34 +      __ verify_klass_ptr(temp3_intf);
    2.35  
    2.36        Register G5_index = G5_method;
    2.37        __ ld_ptr(member_vmindex, G5_index);
    2.38 @@ -458,7 +458,7 @@
    2.39                                   temp2, no_sethi_temp,
    2.40                                   L_no_such_interface);
    2.41  
    2.42 -      __ verify_oop(G5_method);
    2.43 +      __ verify_method_ptr(G5_method);
    2.44        jump_from_method_handle(_masm, G5_method, temp2, temp3, for_compiler_entry);
    2.45  
    2.46        __ bind(L_no_such_interface);
    2.47 @@ -479,7 +479,7 @@
    2.48        // After figuring out which concrete method to call, jump into it.
    2.49        // Note that this works in the interpreter with no data motion.
    2.50        // But the compiled version will require that rcx_recv be shifted out.
    2.51 -      __ verify_oop(G5_method);
    2.52 +      __ verify_method_ptr(G5_method);
    2.53        jump_from_method_handle(_masm, G5_method, temp1, temp3, for_compiler_entry);
    2.54      }
    2.55    }
     3.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp	Tue Sep 11 16:20:57 2012 +0200
     3.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp	Tue Sep 11 20:20:38 2012 -0400
     3.3 @@ -3018,7 +3018,7 @@
     3.4    // get receiver klass
     3.5    __ null_check(O0_recv, oopDesc::klass_offset_in_bytes());
     3.6    __ load_klass(O0_recv, O0_recv);
     3.7 -  __ verify_oop(O0_recv);
     3.8 +  __ verify_klass_ptr(O0_recv);
     3.9  
    3.10    __ profile_virtual_call(O0_recv, O4);
    3.11  
     4.1 --- a/src/cpu/x86/vm/assembler_x86.hpp	Tue Sep 11 16:20:57 2012 +0200
     4.2 +++ b/src/cpu/x86/vm/assembler_x86.hpp	Tue Sep 11 20:20:38 2012 -0400
     4.3 @@ -2274,9 +2274,17 @@
     4.4    // Debugging
     4.5  
     4.6    // only if +VerifyOops
     4.7 +  // TODO: Make these macros with file and line like sparc version!
     4.8    void verify_oop(Register reg, const char* s = "broken oop");
     4.9    void verify_oop_addr(Address addr, const char * s = "broken oop addr");
    4.10  
    4.11 +  // TODO: verify method and klass metadata (compare against vptr?)
    4.12 +  void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {}
    4.13 +  void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line){}
    4.14 +
    4.15 +#define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__)
    4.16 +#define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__)
    4.17 +
    4.18    // only if +VerifyFPU
    4.19    void verify_FPU(int stack_depth, const char* s = "illegal FPU state");
    4.20  
     5.1 --- a/src/cpu/x86/vm/cppInterpreter_x86.cpp	Tue Sep 11 16:20:57 2012 +0200
     5.2 +++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp	Tue Sep 11 20:20:38 2012 -0400
     5.3 @@ -1110,7 +1110,7 @@
     5.4  
     5.5    // allocate space for parameters
     5.6    __ movptr(method, STATE(_method));
     5.7 -  __ verify_oop(method);
     5.8 +  __ verify_method_ptr(method);
     5.9    __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
    5.10    __ shll(t, 2);
    5.11  #ifdef _LP64
    5.12 @@ -1134,7 +1134,7 @@
    5.13      __ movptr(method, STATE(_method));
    5.14      __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD);
    5.15      __ jcc(Assembler::notEqual, pending_exception_present);
    5.16 -    __ verify_oop(method);
    5.17 +    __ verify_method_ptr(method);
    5.18      __ movptr(t, Address(method, Method::signature_handler_offset()));
    5.19      __ bind(L);
    5.20    }
    5.21 @@ -1162,7 +1162,7 @@
    5.22    __ movptr(from_ptr, STATE(_locals));  // get the from pointer
    5.23    __ call(t);
    5.24    __ movptr(method, STATE(_method));
    5.25 -  __ verify_oop(method);
    5.26 +  __ verify_method_ptr(method);
    5.27  
    5.28    // result handler is in rax
    5.29    // set result handler
    5.30 @@ -1176,7 +1176,7 @@
    5.31      __ jcc(Assembler::notZero, L);
    5.32      __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method);
    5.33      __ movptr(method, STATE(_method));
    5.34 -    __ verify_oop(method);
    5.35 +    __ verify_method_ptr(method);
    5.36      __ movptr(rax, Address(method, Method::native_function_offset()));
    5.37      __ bind(L);
    5.38    }
    5.39 @@ -1351,7 +1351,7 @@
    5.40      __ increment(rsp, wordSize);
    5.41  
    5.42      __ movptr(method, STATE(_method));
    5.43 -    __ verify_oop(method);
    5.44 +    __ verify_method_ptr(method);
    5.45      __ movptr(thread, STATE(_thread));                       // get thread
    5.46  
    5.47      __ bind(Continue);
     6.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Sep 11 16:20:57 2012 +0200
     6.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Sep 11 20:20:38 2012 -0400
     6.3 @@ -118,7 +118,7 @@
     6.4  void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp,
     6.5                                              bool for_compiler_entry) {
     6.6    assert(method == rbx, "interpreter calling convention");
     6.7 -  __ verify_oop(method);
     6.8 +  __ verify_method_ptr(method);
     6.9  
    6.10    if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
    6.11      Label run_compiled_code;
    6.12 @@ -358,7 +358,7 @@
    6.13          // load receiver klass itself
    6.14          __ null_check(receiver_reg, oopDesc::klass_offset_in_bytes());
    6.15          __ load_klass(temp1_recv_klass, receiver_reg);
    6.16 -        __ verify_oop(temp1_recv_klass);
    6.17 +        __ verify_klass_ptr(temp1_recv_klass);
    6.18        }
    6.19        BLOCK_COMMENT("check_receiver {");
    6.20        // The receiver for the MemberName must be in receiver_reg.
    6.21 @@ -366,14 +366,14 @@
    6.22        if (VerifyMethodHandles && iid == vmIntrinsics::_linkToSpecial) {
    6.23          // Did not load it above...
    6.24          __ load_klass(temp1_recv_klass, receiver_reg);
    6.25 -        __ verify_oop(temp1_recv_klass);
    6.26 +        __ verify_klass_ptr(temp1_recv_klass);
    6.27        }
    6.28        if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
    6.29          Label L_ok;
    6.30          Register temp2_defc = temp2;
    6.31          __ load_heap_oop(temp2_defc, member_clazz);
    6.32          load_klass_from_Class(_masm, temp2_defc);
    6.33 -        __ verify_oop(temp2_defc);
    6.34 +        __ verify_klass_ptr(temp2_defc);
    6.35          __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, L_ok);
    6.36          // If we get here, the type check failed!
    6.37          __ STOP("receiver class disagrees with MemberName.clazz");
    6.38 @@ -451,7 +451,7 @@
    6.39        Register temp3_intf = temp3;
    6.40        __ load_heap_oop(temp3_intf, member_clazz);
    6.41        load_klass_from_Class(_masm, temp3_intf);
    6.42 -      __ verify_oop(temp3_intf);
    6.43 +      __ verify_klass_ptr(temp3_intf);
    6.44  
    6.45        Register rbx_index = rbx_method;
    6.46        __ movptr(rbx_index, member_vmindex);
    6.47 @@ -471,7 +471,7 @@
    6.48                                   temp2,
    6.49                                   L_no_such_interface);
    6.50  
    6.51 -      __ verify_oop(rbx_method);
    6.52 +      __ verify_method_ptr(rbx_method);
    6.53        jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry);
    6.54        __ hlt();
    6.55  
    6.56 @@ -491,7 +491,7 @@
    6.57        // After figuring out which concrete method to call, jump into it.
    6.58        // Note that this works in the interpreter with no data motion.
    6.59        // But the compiled version will require that rcx_recv be shifted out.
    6.60 -      __ verify_oop(rbx_method);
    6.61 +      __ verify_method_ptr(rbx_method);
    6.62        jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry);
    6.63      }
    6.64    }
     7.1 --- a/src/cpu/x86/vm/templateTable_x86_32.cpp	Tue Sep 11 16:20:57 2012 +0200
     7.2 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp	Tue Sep 11 20:20:38 2012 -0400
     7.3 @@ -3107,7 +3107,7 @@
     7.4    prepare_invoke(byte_no,
     7.5                   rbx_method, rax_mtype,  // get f2 Method*, f1 MethodType
     7.6                   rcx_recv);
     7.7 -  __ verify_oop(rbx_method);
     7.8 +  __ verify_method_ptr(rbx_method);
     7.9    __ verify_oop(rcx_recv);
    7.10    __ null_check(rcx_recv);
    7.11  
     8.1 --- a/src/cpu/x86/vm/templateTable_x86_64.cpp	Tue Sep 11 16:20:57 2012 +0200
     8.2 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp	Tue Sep 11 20:20:38 2012 -0400
     8.3 @@ -3158,7 +3158,7 @@
     8.4    prepare_invoke(byte_no,
     8.5                   rbx_method, rax_mtype,  // get f2 Method*, f1 MethodType
     8.6                   rcx_recv);
     8.7 -  __ verify_oop(rbx_method);
     8.8 +  __ verify_method_ptr(rbx_method);
     8.9    __ verify_oop(rcx_recv);
    8.10    __ null_check(rcx_recv);
    8.11  
     9.1 --- a/src/share/vm/code/dependencies.cpp	Tue Sep 11 16:20:57 2012 +0200
     9.2 +++ b/src/share/vm/code/dependencies.cpp	Tue Sep 11 20:20:38 2012 -0400
     9.3 @@ -567,9 +567,6 @@
     9.4  
     9.5  void Dependencies::DepStream::log_dependency(Klass* witness) {
     9.6    if (_deps == NULL && xtty == NULL)  return;  // fast cutout for runtime
     9.7 -  if (type() == call_site_target_value) {
     9.8 -    os::breakpoint();
     9.9 -  }
    9.10    int nargs = argument_count();
    9.11    DepArgument args[max_arg_count];
    9.12    for (int j = 0; j < nargs; j++) {

mercurial