1851 // Bump bcp to target of JSR. |
1851 // Bump bcp to target of JSR. |
1852 __ z_agr(Z_bcp, disp); |
1852 __ z_agr(Z_bcp, disp); |
1853 // Push return address for "ret" on stack. |
1853 // Push return address for "ret" on stack. |
1854 __ push_ptr(Z_tos); |
1854 __ push_ptr(Z_tos); |
1855 // And away we go! |
1855 // And away we go! |
1856 __ dispatch_next(vtos); |
1856 __ dispatch_next(vtos, 0 , true); |
1857 return; |
1857 return; |
1858 } |
1858 } |
1859 |
1859 |
1860 // Normal (non-jsr) branch handling. |
1860 // Normal (non-jsr) branch handling. |
1861 |
1861 |
1959 |
1959 |
1960 // Continue with the bytecode @ target. |
1960 // Continue with the bytecode @ target. |
1961 // Z_tos: Return bci for jsr's, unused otherwise. |
1961 // Z_tos: Return bci for jsr's, unused otherwise. |
1962 // Z_bytecode: target bytecode |
1962 // Z_bytecode: target bytecode |
1963 // Z_bcp: target bcp |
1963 // Z_bcp: target bcp |
1964 __ dispatch_only(vtos); |
1964 __ dispatch_only(vtos, true); |
1965 |
1965 |
1966 // Out-of-line code runtime calls. |
1966 // Out-of-line code runtime calls. |
1967 if (UseLoopCounter) { |
1967 if (UseLoopCounter) { |
1968 if (ProfileInterpreter) { |
1968 if (ProfileInterpreter) { |
1969 // Out-of-line code to allocate method data oop. |
1969 // Out-of-line code to allocate method data oop. |
2070 __ mem2reg_opt(Z_tmp_1, iaddress(_masm, Z_tmp_1)); |
2070 __ mem2reg_opt(Z_tmp_1, iaddress(_masm, Z_tmp_1)); |
2071 __ profile_ret(Z_tmp_1, Z_tmp_2); |
2071 __ profile_ret(Z_tmp_1, Z_tmp_2); |
2072 __ get_method(Z_tos); |
2072 __ get_method(Z_tos); |
2073 __ mem2reg_opt(Z_R1_scratch, Address(Z_tos, Method::const_offset())); |
2073 __ mem2reg_opt(Z_R1_scratch, Address(Z_tos, Method::const_offset())); |
2074 __ load_address(Z_bcp, Address(Z_R1_scratch, Z_tmp_1, ConstMethod::codes_offset())); |
2074 __ load_address(Z_bcp, Address(Z_R1_scratch, Z_tmp_1, ConstMethod::codes_offset())); |
2075 __ dispatch_next(vtos); |
2075 __ dispatch_next(vtos, 0 , true); |
2076 } |
2076 } |
2077 |
2077 |
2078 void TemplateTable::wide_ret() { |
2078 void TemplateTable::wide_ret() { |
2079 transition(vtos, vtos); |
2079 transition(vtos, vtos); |
2080 |
2080 |
2083 __ mem2reg_opt(Z_tmp_1, aaddress(_masm, Z_tmp_1)); |
2083 __ mem2reg_opt(Z_tmp_1, aaddress(_masm, Z_tmp_1)); |
2084 __ profile_ret(Z_tmp_1, Z_tmp_2); |
2084 __ profile_ret(Z_tmp_1, Z_tmp_2); |
2085 __ get_method(Z_tos); |
2085 __ get_method(Z_tos); |
2086 __ mem2reg_opt(Z_R1_scratch, Address(Z_tos, Method::const_offset())); |
2086 __ mem2reg_opt(Z_R1_scratch, Address(Z_tos, Method::const_offset())); |
2087 __ load_address(Z_bcp, Address(Z_R1_scratch, Z_tmp_1, ConstMethod::codes_offset())); |
2087 __ load_address(Z_bcp, Address(Z_R1_scratch, Z_tmp_1, ConstMethod::codes_offset())); |
2088 __ dispatch_next(vtos); |
2088 __ dispatch_next(vtos, 0, true); |
2089 } |
2089 } |
2090 |
2090 |
2091 void TemplateTable::tableswitch () { |
2091 void TemplateTable::tableswitch () { |
2092 transition(itos, vtos); |
2092 transition(itos, vtos); |
2093 |
2093 |
2127 __ bind(continue_execution); |
2127 __ bind(continue_execution); |
2128 |
2128 |
2129 // Load next bytecode. |
2129 // Load next bytecode. |
2130 __ z_llgc(Z_bytecode, Address(Z_bcp, index)); |
2130 __ z_llgc(Z_bytecode, Address(Z_bcp, index)); |
2131 __ z_agr(Z_bcp, index); // Advance bcp. |
2131 __ z_agr(Z_bcp, index); // Advance bcp. |
2132 __ dispatch_only(vtos); |
2132 __ dispatch_only(vtos, true); |
2133 |
2133 |
2134 // Handle default. |
2134 // Handle default. |
2135 __ bind(default_case); |
2135 __ bind(default_case); |
2136 |
2136 |
2137 __ profile_switch_default(Z_tos); |
2137 __ profile_switch_default(Z_tos); |
2191 __ bind(continue_execution); |
2191 __ bind(continue_execution); |
2192 |
2192 |
2193 // Load next bytecode. |
2193 // Load next bytecode. |
2194 __ z_llgc(Z_bytecode, Address(Z_bcp, offset, 0)); |
2194 __ z_llgc(Z_bytecode, Address(Z_bcp, offset, 0)); |
2195 __ z_agr(Z_bcp, offset); // Advance bcp. |
2195 __ z_agr(Z_bcp, offset); // Advance bcp. |
2196 __ dispatch_only(vtos); |
2196 __ dispatch_only(vtos, true); |
2197 } |
2197 } |
2198 |
2198 |
2199 |
2199 |
2200 void TemplateTable::fast_binaryswitch() { |
2200 void TemplateTable::fast_binaryswitch() { |
2201 |
2201 |
2300 __ mem2reg_signed_opt(j, Address(array, h, BytesPerInt)); |
2300 __ mem2reg_signed_opt(j, Address(array, h, BytesPerInt)); |
2301 __ profile_switch_case(i, key, array, Z_bytecode); |
2301 __ profile_switch_case(i, key, array, Z_bytecode); |
2302 // Load next bytecode. |
2302 // Load next bytecode. |
2303 __ z_llgc(Z_bytecode, Address(Z_bcp, j)); |
2303 __ z_llgc(Z_bytecode, Address(Z_bcp, j)); |
2304 __ z_agr(Z_bcp, j); // Advance bcp. |
2304 __ z_agr(Z_bcp, j); // Advance bcp. |
2305 __ dispatch_only(vtos); |
2305 __ dispatch_only(vtos, true); |
2306 |
2306 |
2307 // default case -> j = default offset |
2307 // default case -> j = default offset |
2308 __ bind(default_case); |
2308 __ bind(default_case); |
2309 |
2309 |
2310 __ profile_switch_default(i); |
2310 __ profile_switch_default(i); |
2311 __ mem2reg_signed_opt(j, Address(array, -2 * BytesPerInt)); |
2311 __ mem2reg_signed_opt(j, Address(array, -2 * BytesPerInt)); |
2312 // Load next bytecode. |
2312 // Load next bytecode. |
2313 __ z_llgc(Z_bytecode, Address(Z_bcp, j)); |
2313 __ z_llgc(Z_bytecode, Address(Z_bcp, j)); |
2314 __ z_agr(Z_bcp, j); // Advance bcp. |
2314 __ z_agr(Z_bcp, j); // Advance bcp. |
2315 __ dispatch_only(vtos); |
2315 __ dispatch_only(vtos, true); |
2316 } |
2316 } |
2317 |
2317 |
2318 void TemplateTable::_return(TosState state) { |
2318 void TemplateTable::_return(TosState state) { |
2319 transition(state, state); |
2319 transition(state, state); |
2320 assert(_desc->calls_vm(), |
2320 assert(_desc->calls_vm(), |
2329 __ load_klass(Rklass, Rthis); |
2329 __ load_klass(Rklass, Rthis); |
2330 __ testbit(Address(Rklass, Klass::access_flags_offset()), exact_log2(JVM_ACC_HAS_FINALIZER)); |
2330 __ testbit(Address(Rklass, Klass::access_flags_offset()), exact_log2(JVM_ACC_HAS_FINALIZER)); |
2331 __ z_bfalse(skip_register_finalizer); |
2331 __ z_bfalse(skip_register_finalizer); |
2332 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), Rthis); |
2332 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), Rthis); |
2333 __ bind(skip_register_finalizer); |
2333 __ bind(skip_register_finalizer); |
|
2334 } |
|
2335 |
|
2336 if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) { |
|
2337 Label no_safepoint; |
|
2338 const Address poll_byte_addr(Z_thread, in_bytes(Thread::polling_page_offset()) + 7 /* Big Endian */); |
|
2339 __ z_tm(poll_byte_addr, SafepointMechanism::poll_bit()); |
|
2340 __ z_braz(no_safepoint); |
|
2341 __ push(state); |
|
2342 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)); |
|
2343 __ pop(state); |
|
2344 __ bind(no_safepoint); |
2334 } |
2345 } |
2335 |
2346 |
2336 if (state == itos) { |
2347 if (state == itos) { |
2337 // Narrow result if state is itos but result type is smaller. |
2348 // Narrow result if state is itos but result type is smaller. |
2338 // Need to narrow in the return bytecode rather than in generate_return_entry |
2349 // Need to narrow in the return bytecode rather than in generate_return_entry |