< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page
rev 51972 : 8209415: Fix JVMTI test failure HS202
Summary: Fix test for static method in exception throw handler
Reviewed-by: adinn


1895   __ restore_bcp();
1896   __ restore_locals();
1897   __ restore_constant_pool_cache();
1898   __ get_method(rmethod);
1899 
1900   // The method data pointer was incremented already during
1901   // call profiling. We have to restore the mdp for the current bcp.
1902   if (ProfileInterpreter) {
1903     __ set_method_data_pointer_for_bcp();
1904   }
1905 
1906   // Clear the popframe condition flag
1907   __ strw(zr, Address(rthread, JavaThread::popframe_condition_offset()));
1908   assert(JavaThread::popframe_inactive == 0, "fix popframe_inactive");
1909 
1910 #if INCLUDE_JVMTI
1911   {
1912     Label L_done;
1913 
1914     __ ldrb(rscratch1, Address(rbcp, 0));
1915     __ cmpw(r1, Bytecodes::_invokestatic);
1916     __ br(Assembler::EQ, L_done);
1917 
1918     // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
1919     // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
1920 
1921     __ ldr(c_rarg0, Address(rlocals, 0));
1922     __ call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), c_rarg0, rmethod, rbcp);
1923 
1924     __ cbz(r0, L_done);
1925 
1926     __ str(r0, Address(esp, 0));
1927     __ bind(L_done);
1928   }
1929 #endif // INCLUDE_JVMTI
1930 
1931   // Restore machine SP
1932   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
1933   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
1934   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 4);
1935   __ ldr(rscratch2,
1936          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
1937   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
1938   __ andr(sp, rscratch1, -16);
1939 
1940   __ dispatch_next(vtos);
1941   // end of PopFrame support
1942 
1943   Interpreter::_remove_activation_entry = __ pc();
1944 
1945   // preserve exception over this code sequence
1946   __ pop_ptr(r0);
1947   __ str(r0, Address(rthread, JavaThread::vm_result_offset()));
1948   // remove the activation (without doing throws on illegalMonitorExceptions)
1949   __ remove_activation(vtos, false, true, false);
1950   // restore exception
1951   // restore exception
1952   __ get_vm_result(r0, rthread);
1953 
1954   // In between activations - previous activation type unknown yet
1955   // compute continuation point - the continuation point expects the
1956   // following registers set up:
1957   //
1958   // r0: exception
1959   // lr: return address/pc that threw exception
1960   // rsp: expression stack of caller
1961   // rfp: fp of caller
1962   // FIXME: There's no point saving LR here because VM calls don't trash it
1963   __ stp(r0, lr, Address(__ pre(sp, -2 * wordSize)));  // save exception & return address
1964   __ super_call_VM_leaf(CAST_FROM_FN_PTR(address,
1965                           SharedRuntime::exception_handler_for_return_address),
1966                         rthread, lr);
1967   __ mov(r1, r0);                               // save exception handler
1968   __ ldp(r0, lr, Address(__ post(sp, 2 * wordSize)));  // restore exception & return address
1969   // We might be returning to a deopt handler that expects r3 to
1970   // contain the exception pc
1971   __ mov(r3, lr);
1972   // Note that an "issuing PC" is actually the next PC after the call
1973   __ br(r1);                                    // jump to exception
1974                                                 // handler of caller
1975 }
1976 
1977 
1978 //
1979 // JVMTI ForceEarlyReturn support
1980 //
1981 address TemplateInterpreterGenerator::generate_earlyret_entry_for(TosState state) {
1982   address entry = __ pc();




1895   __ restore_bcp();
1896   __ restore_locals();
1897   __ restore_constant_pool_cache();
1898   __ get_method(rmethod);
1899 
1900   // The method data pointer was incremented already during
1901   // call profiling. We have to restore the mdp for the current bcp.
1902   if (ProfileInterpreter) {
1903     __ set_method_data_pointer_for_bcp();
1904   }
1905 
1906   // Clear the popframe condition flag
1907   __ strw(zr, Address(rthread, JavaThread::popframe_condition_offset()));
1908   assert(JavaThread::popframe_inactive == 0, "fix popframe_inactive");
1909 
1910 #if INCLUDE_JVMTI
1911   {
1912     Label L_done;
1913 
1914     __ ldrb(rscratch1, Address(rbcp, 0));
1915     __ cmpw(rscratch1, Bytecodes::_invokestatic);
1916     __ br(Assembler::NE, L_done);
1917 
1918     // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
1919     // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
1920 
1921     __ ldr(c_rarg0, Address(rlocals, 0));
1922     __ call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), c_rarg0, rmethod, rbcp);
1923 
1924     __ cbz(r0, L_done);
1925 
1926     __ str(r0, Address(esp, 0));
1927     __ bind(L_done);
1928   }
1929 #endif // INCLUDE_JVMTI
1930 
1931   // Restore machine SP
1932   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
1933   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
1934   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 4);
1935   __ ldr(rscratch2,
1936          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
1937   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
1938   __ andr(sp, rscratch1, -16);
1939 
1940   __ dispatch_next(vtos);
1941   // end of PopFrame support
1942 
1943   Interpreter::_remove_activation_entry = __ pc();
1944 
1945   // preserve exception over this code sequence
1946   __ pop_ptr(r0);
1947   __ str(r0, Address(rthread, JavaThread::vm_result_offset()));
1948   // remove the activation (without doing throws on illegalMonitorExceptions)
1949   __ remove_activation(vtos, false, true, false);
1950   // restore exception

1951   __ get_vm_result(r0, rthread);
1952 
1953   // In between activations - previous activation type unknown yet
1954   // compute continuation point - the continuation point expects the
1955   // following registers set up:
1956   //
1957   // r0: exception
1958   // lr: return address/pc that threw exception
1959   // esp: expression stack of caller
1960   // rfp: fp of caller

1961   __ stp(r0, lr, Address(__ pre(sp, -2 * wordSize)));  // save exception & return address
1962   __ super_call_VM_leaf(CAST_FROM_FN_PTR(address,
1963                           SharedRuntime::exception_handler_for_return_address),
1964                         rthread, lr);
1965   __ mov(r1, r0);                               // save exception handler
1966   __ ldp(r0, lr, Address(__ post(sp, 2 * wordSize)));  // restore exception & return address
1967   // We might be returning to a deopt handler that expects r3 to
1968   // contain the exception pc
1969   __ mov(r3, lr);
1970   // Note that an "issuing PC" is actually the next PC after the call
1971   __ br(r1);                                    // jump to exception
1972                                                 // handler of caller
1973 }
1974 
1975 
1976 //
1977 // JVMTI ForceEarlyReturn support
1978 //
1979 address TemplateInterpreterGenerator::generate_earlyret_entry_for(TosState state) {
1980   address entry = __ pc();


< prev index next >