1.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp Fri Sep 14 22:00:41 2012 -0700 1.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp Mon Sep 17 12:57:58 2012 -0700 1.3 @@ -327,10 +327,11 @@ 1.4 assert_different_registers(temp3, rcx, rdx); 1.5 } 1.6 #endif 1.7 + else { 1.8 + assert_different_registers(temp1, temp2, temp3, saved_last_sp_register()); // don't trash lastSP 1.9 + } 1.10 assert_different_registers(temp1, temp2, temp3, receiver_reg); 1.11 assert_different_registers(temp1, temp2, temp3, member_reg); 1.12 - if (!for_compiler_entry) 1.13 - assert_different_registers(temp1, temp2, temp3, saved_last_sp_register()); // don't trash lastSP 1.14 1.15 if (iid == vmIntrinsics::_invokeBasic) { 1.16 // indirect through MH.form.vmentry.vmtarget 1.17 @@ -392,14 +393,13 @@ 1.18 // rsi/r13 - interpreter linkage (if interpreted) 1.19 // rcx, rdx, rsi, rdi, r8, r8 - compiler arguments (if compiled) 1.20 1.21 - bool method_is_live = false; 1.22 + Label L_incompatible_class_change_error; 1.23 switch (iid) { 1.24 case vmIntrinsics::_linkToSpecial: 1.25 if (VerifyMethodHandles) { 1.26 verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3); 1.27 } 1.28 __ movptr(rbx_method, member_vmtarget); 1.29 - method_is_live = true; 1.30 break; 1.31 1.32 case vmIntrinsics::_linkToStatic: 1.33 @@ -407,7 +407,6 @@ 1.34 verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp3); 1.35 } 1.36 __ movptr(rbx_method, member_vmtarget); 1.37 - method_is_live = true; 1.38 break; 1.39 1.40 case vmIntrinsics::_linkToVirtual: 1.41 @@ -436,7 +435,6 @@ 1.42 1.43 // get target Method* & entry point 1.44 __ lookup_virtual_method(temp1_recv_klass, temp2_index, rbx_method); 1.45 - method_is_live = true; 1.46 break; 1.47 } 1.48 1.49 @@ -464,35 +462,32 @@ 1.50 } 1.51 1.52 // given intf, index, and recv klass, dispatch to the implementation method 1.53 - Label L_no_such_interface; 1.54 __ lookup_interface_method(temp1_recv_klass, temp3_intf, 1.55 // note: next two args must be the same: 1.56 rbx_index, rbx_method, 1.57 temp2, 1.58 - L_no_such_interface); 1.59 - 1.60 - __ verify_method_ptr(rbx_method); 1.61 - jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry); 1.62 - __ hlt(); 1.63 - 1.64 - __ bind(L_no_such_interface); 1.65 - __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry())); 1.66 + L_incompatible_class_change_error); 1.67 break; 1.68 } 1.69 1.70 default: 1.71 - fatal(err_msg("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid))); 1.72 + fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid))); 1.73 break; 1.74 } 1.75 1.76 - if (method_is_live) { 1.77 - // live at this point: rbx_method, rsi/r13 (if interpreted) 1.78 + // Live at this point: 1.79 + // rbx_method 1.80 + // rsi/r13 (if interpreted) 1.81 1.82 - // After figuring out which concrete method to call, jump into it. 1.83 - // Note that this works in the interpreter with no data motion. 1.84 - // But the compiled version will require that rcx_recv be shifted out. 1.85 - __ verify_method_ptr(rbx_method); 1.86 - jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry); 1.87 + // After figuring out which concrete method to call, jump into it. 1.88 + // Note that this works in the interpreter with no data motion. 1.89 + // But the compiled version will require that rcx_recv be shifted out. 1.90 + __ verify_method_ptr(rbx_method); 1.91 + jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry); 1.92 + 1.93 + if (iid == vmIntrinsics::_linkToInterface) { 1.94 + __ bind(L_incompatible_class_change_error); 1.95 + __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry())); 1.96 } 1.97 } 1.98 }