diff src/cpu/sparc/vm/methodHandles_sparc.cpp @ 3781:d83ac25d0304

7055355: JSR 292: crash while throwing WrongMethodTypeException Reviewed-by: jrose, twisti, bdelsart
author never
date Thu, 16 Jun 2011 13:46:55 -0700
parents f8c9417e3571
children 341a57af9b0a
line wrap: on
line diff
--- a/src/cpu/sparc/vm/methodHandles_sparc.cpp	Wed Jun 15 10:20:03 2011 -0700
+++ b/src/cpu/sparc/vm/methodHandles_sparc.cpp	Thu Jun 16 13:46:55 2011 -0700
@@ -307,11 +307,12 @@
   __ stop("damaged ricochet frame: L4 < FP");
 
   __ BIND(L_ok_2);
-  __ sub(L4_saved_args_base, UNREASONABLE_STACK_MOVE * Interpreter::stackElementSize, O7_temp);
-  __ cmp(O7_temp, FP_temp);
-  __ br(Assembler::lessEqualUnsigned, false, Assembler::pt, L_ok_3);
-  __ delayed()->nop();
-  __ stop("damaged ricochet frame: (L4 - UNREASONABLE_STACK_MOVE) > FP");
+  // Disable until we decide on it's fate
+  // __ sub(L4_saved_args_base, UNREASONABLE_STACK_MOVE * Interpreter::stackElementSize, O7_temp);
+  // __ cmp(O7_temp, FP_temp);
+  // __ br(Assembler::lessEqualUnsigned, false, Assembler::pt, L_ok_3);
+  // __ delayed()->nop();
+  // __ stop("damaged ricochet frame: (L4 - UNREASONABLE_STACK_MOVE) > FP");
 
   __ BIND(L_ok_3);
   extract_conversion_dest_type(_masm, L5_conversion, O7_temp);
@@ -547,8 +548,9 @@
   __ brx(Assembler::notEqual, false, Assembler::pt, invoke_generic_slow_path);
   __ delayed()->nop();
   __ mov(O0_mtype, G5_method_type);  // required by throw_WrongMethodType
-  // mov(G3_method_handle, G3_method_handle);  // already in this register
-  __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch);
+  __ mov(G3_method_handle, G3_method_handle);  // already in this register
+  // O0 will be filled in with JavaThread in stub
+  __ jump_to(AddressLiteral(StubRoutines::throw_WrongMethodTypeException_entry()), O3_scratch);
   __ delayed()->nop();
 
   // here's where control starts out:
@@ -1145,23 +1147,13 @@
       // FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method
       __ set(AddressLiteral((address) &_raise_exception_method), G5_method);
       __ ld_ptr(Address(G5_method, 0), G5_method);
-      __ tst(G5_method);
-      __ brx(Assembler::zero, false, Assembler::pn, L_no_method);
-      __ delayed()->nop();
 
       const int jobject_oop_offset = 0;
       __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method);
-      __ tst(G5_method);
-      __ brx(Assembler::zero, false, Assembler::pn, L_no_method);
-      __ delayed()->nop();
 
       __ verify_oop(G5_method);
       __ jump_indirect_to(G5_method_fce, O3_scratch);  // jump to compiled entry
       __ delayed()->nop();
-
-      // Do something that is at least causes a valid throw from the interpreter.
-      __ bind(L_no_method);
-      __ unimplemented("call throw_WrongMethodType_entry");
     }
     break;