415 |
415 |
416 guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets"); |
416 guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets"); |
417 |
417 |
418 // Some handy addresses: |
418 // Some handy addresses: |
419 Address G5_method_fie( G5_method, in_bytes(methodOopDesc::from_interpreted_offset())); |
419 Address G5_method_fie( G5_method, in_bytes(methodOopDesc::from_interpreted_offset())); |
|
420 Address G5_method_fce( G5_method, in_bytes(methodOopDesc::from_compiled_offset())); |
420 |
421 |
421 Address G3_mh_vmtarget( G3_method_handle, java_dyn_MethodHandle::vmtarget_offset_in_bytes()); |
422 Address G3_mh_vmtarget( G3_method_handle, java_dyn_MethodHandle::vmtarget_offset_in_bytes()); |
422 |
423 |
423 Address G3_dmh_vmindex( G3_method_handle, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes()); |
424 Address G3_dmh_vmindex( G3_method_handle, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes()); |
424 |
425 |
442 |
443 |
443 switch ((int) ek) { |
444 switch ((int) ek) { |
444 case _raise_exception: |
445 case _raise_exception: |
445 { |
446 { |
446 // Not a real MH entry, but rather shared code for raising an |
447 // Not a real MH entry, but rather shared code for raising an |
447 // exception. Since we use a C2I adapter to set up the |
448 // exception. Since we use the compiled entry, arguments are |
448 // interpreter state, arguments are expected in compiler |
449 // expected in compiler argument registers. |
449 // argument registers. |
|
450 assert(raise_exception_method(), "must be set"); |
450 assert(raise_exception_method(), "must be set"); |
451 address c2i_entry = raise_exception_method()->get_c2i_entry(); |
451 assert(raise_exception_method()->from_compiled_entry(), "method must be linked"); |
452 assert(c2i_entry, "method must be linked"); |
|
453 |
452 |
454 __ mov(O5_savedSP, SP); // Cut the stack back to where the caller started. |
453 __ mov(O5_savedSP, SP); // Cut the stack back to where the caller started. |
455 |
454 |
456 Label L_no_method; |
455 Label L_no_method; |
457 // FIXME: fill in _raise_exception_method with a suitable sun.dyn method |
456 // FIXME: fill in _raise_exception_method with a suitable sun.dyn method |
466 __ tst(G5_method); |
465 __ tst(G5_method); |
467 __ brx(Assembler::zero, false, Assembler::pn, L_no_method); |
466 __ brx(Assembler::zero, false, Assembler::pn, L_no_method); |
468 __ delayed()->nop(); |
467 __ delayed()->nop(); |
469 |
468 |
470 __ verify_oop(G5_method); |
469 __ verify_oop(G5_method); |
471 __ jump_to(AddressLiteral(c2i_entry), O3_scratch); |
470 __ jump_indirect_to(G5_method_fce, O3_scratch); // jump to compiled entry |
472 __ delayed()->nop(); |
471 __ delayed()->nop(); |
473 |
472 |
474 // If we get here, the Java runtime did not do its job of creating the exception. |
|
475 // Do something that is at least causes a valid throw from the interpreter. |
473 // Do something that is at least causes a valid throw from the interpreter. |
476 __ bind(L_no_method); |
474 __ bind(L_no_method); |
477 __ unimplemented("call throw_WrongMethodType_entry"); |
475 __ unimplemented("call throw_WrongMethodType_entry"); |
478 } |
476 } |
479 break; |
477 break; |