Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
3759:cfcf2ba8f3eb | 3781:d83ac25d0304 |
---|---|
305 __ br(Assembler::greaterEqualUnsigned, false, Assembler::pt, L_ok_2); | 305 __ br(Assembler::greaterEqualUnsigned, false, Assembler::pt, L_ok_2); |
306 __ delayed()->nop(); | 306 __ delayed()->nop(); |
307 __ stop("damaged ricochet frame: L4 < FP"); | 307 __ stop("damaged ricochet frame: L4 < FP"); |
308 | 308 |
309 __ BIND(L_ok_2); | 309 __ BIND(L_ok_2); |
310 __ sub(L4_saved_args_base, UNREASONABLE_STACK_MOVE * Interpreter::stackElementSize, O7_temp); | 310 // Disable until we decide on it's fate |
311 __ cmp(O7_temp, FP_temp); | 311 // __ sub(L4_saved_args_base, UNREASONABLE_STACK_MOVE * Interpreter::stackElementSize, O7_temp); |
312 __ br(Assembler::lessEqualUnsigned, false, Assembler::pt, L_ok_3); | 312 // __ cmp(O7_temp, FP_temp); |
313 __ delayed()->nop(); | 313 // __ br(Assembler::lessEqualUnsigned, false, Assembler::pt, L_ok_3); |
314 __ stop("damaged ricochet frame: (L4 - UNREASONABLE_STACK_MOVE) > FP"); | 314 // __ delayed()->nop(); |
315 // __ stop("damaged ricochet frame: (L4 - UNREASONABLE_STACK_MOVE) > FP"); | |
315 | 316 |
316 __ BIND(L_ok_3); | 317 __ BIND(L_ok_3); |
317 extract_conversion_dest_type(_masm, L5_conversion, O7_temp); | 318 extract_conversion_dest_type(_masm, L5_conversion, O7_temp); |
318 __ cmp(O7_temp, T_VOID); | 319 __ cmp(O7_temp, T_VOID); |
319 __ br(Assembler::equal, false, Assembler::pt, L_ok_4); | 320 __ br(Assembler::equal, false, Assembler::pt, L_ok_4); |
545 __ ldub(Address(G5_method, methodOopDesc::intrinsic_id_offset_in_bytes()), O1_scratch); | 546 __ ldub(Address(G5_method, methodOopDesc::intrinsic_id_offset_in_bytes()), O1_scratch); |
546 __ cmp(O1_scratch, (int) vmIntrinsics::_invokeExact); | 547 __ cmp(O1_scratch, (int) vmIntrinsics::_invokeExact); |
547 __ brx(Assembler::notEqual, false, Assembler::pt, invoke_generic_slow_path); | 548 __ brx(Assembler::notEqual, false, Assembler::pt, invoke_generic_slow_path); |
548 __ delayed()->nop(); | 549 __ delayed()->nop(); |
549 __ mov(O0_mtype, G5_method_type); // required by throw_WrongMethodType | 550 __ mov(O0_mtype, G5_method_type); // required by throw_WrongMethodType |
550 // mov(G3_method_handle, G3_method_handle); // already in this register | 551 __ mov(G3_method_handle, G3_method_handle); // already in this register |
551 __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch); | 552 // O0 will be filled in with JavaThread in stub |
553 __ jump_to(AddressLiteral(StubRoutines::throw_WrongMethodTypeException_entry()), O3_scratch); | |
552 __ delayed()->nop(); | 554 __ delayed()->nop(); |
553 | 555 |
554 // here's where control starts out: | 556 // here's where control starts out: |
555 __ align(CodeEntryAlignment); | 557 __ align(CodeEntryAlignment); |
556 address entry_point = __ pc(); | 558 address entry_point = __ pc(); |
1143 | 1145 |
1144 Label L_no_method; | 1146 Label L_no_method; |
1145 // FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method | 1147 // FIXME: fill in _raise_exception_method with a suitable java.lang.invoke method |
1146 __ set(AddressLiteral((address) &_raise_exception_method), G5_method); | 1148 __ set(AddressLiteral((address) &_raise_exception_method), G5_method); |
1147 __ ld_ptr(Address(G5_method, 0), G5_method); | 1149 __ ld_ptr(Address(G5_method, 0), G5_method); |
1148 __ tst(G5_method); | |
1149 __ brx(Assembler::zero, false, Assembler::pn, L_no_method); | |
1150 __ delayed()->nop(); | |
1151 | 1150 |
1152 const int jobject_oop_offset = 0; | 1151 const int jobject_oop_offset = 0; |
1153 __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method); | 1152 __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method); |
1154 __ tst(G5_method); | |
1155 __ brx(Assembler::zero, false, Assembler::pn, L_no_method); | |
1156 __ delayed()->nop(); | |
1157 | 1153 |
1158 __ verify_oop(G5_method); | 1154 __ verify_oop(G5_method); |
1159 __ jump_indirect_to(G5_method_fce, O3_scratch); // jump to compiled entry | 1155 __ jump_indirect_to(G5_method_fce, O3_scratch); // jump to compiled entry |
1160 __ delayed()->nop(); | 1156 __ delayed()->nop(); |
1161 | |
1162 // Do something that is at least causes a valid throw from the interpreter. | |
1163 __ bind(L_no_method); | |
1164 __ unimplemented("call throw_WrongMethodType_entry"); | |
1165 } | 1157 } |
1166 break; | 1158 break; |
1167 | 1159 |
1168 case _invokestatic_mh: | 1160 case _invokestatic_mh: |
1169 case _invokespecial_mh: | 1161 case _invokespecial_mh: |