3269 Register Rret_type = Rret_addr; 3270 address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); 3271 3272 // Get return type. It's coded into the upper 4 bits of the lower half of the 64 bit value. 3273 __ rldicl(Rret_type, Rflags, 64-ConstantPoolCacheEntry::tos_state_shift, 64-ConstantPoolCacheEntry::tos_state_bits); 3274 __ load_dispatch_table(Rtable_addr, (address*)table_addr); 3275 __ sldi(Rret_type, Rret_type, LogBytesPerWord); 3276 // Get return address. 3277 __ ldx(Rret_addr, Rtable_addr, Rret_type); 3278 } 3279 } 3280 3281 // Helper for virtual calls. Load target out of vtable and jump off! 3282 // Kills all passed registers. 3283 void TemplateTable::generate_vtable_call(Register Rrecv_klass, Register Rindex, Register Rret, Register Rtemp) { 3284 3285 assert_different_registers(Rrecv_klass, Rtemp, Rret); 3286 const Register Rtarget_method = Rindex; 3287 3288 // Get target method & entry point. 3289 const int base = InstanceKlass::vtable_start_offset() * wordSize; 3290 // Calc vtable addr scale the vtable index by 8. 3291 __ sldi(Rindex, Rindex, exact_log2(vtableEntry::size() * wordSize)); 3292 // Load target. 3293 __ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes()); 3294 __ ldx(Rtarget_method, Rindex, Rrecv_klass); 3295 // Argument and return type profiling. 3296 __ profile_arguments_type(Rtarget_method, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */, true); 3297 __ call_from_interpreter(Rtarget_method, Rret, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */); 3298 } 3299 3300 // Virtual or final call. Final calls are rewritten on the fly to run through "fast_finalcall" next time. 3301 void TemplateTable::invokevirtual(int byte_no) { 3302 transition(vtos, vtos); 3303 3304 Register Rtable_addr = R11_scratch1, 3305 Rret_type = R12_scratch2, 3306 Rret_addr = R5_ARG3, 3307 Rflags = R22_tmp2, // Should survive C call. 3308 Rrecv = R3_ARG1, 3309 Rrecv_klass = Rrecv, 3310 Rvtableindex_or_method = R31, // Should survive C call. 3311 Rnum_params = R4_ARG2, | 3269 Register Rret_type = Rret_addr; 3270 address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); 3271 3272 // Get return type. It's coded into the upper 4 bits of the lower half of the 64 bit value. 3273 __ rldicl(Rret_type, Rflags, 64-ConstantPoolCacheEntry::tos_state_shift, 64-ConstantPoolCacheEntry::tos_state_bits); 3274 __ load_dispatch_table(Rtable_addr, (address*)table_addr); 3275 __ sldi(Rret_type, Rret_type, LogBytesPerWord); 3276 // Get return address. 3277 __ ldx(Rret_addr, Rtable_addr, Rret_type); 3278 } 3279 } 3280 3281 // Helper for virtual calls. Load target out of vtable and jump off! 3282 // Kills all passed registers. 3283 void TemplateTable::generate_vtable_call(Register Rrecv_klass, Register Rindex, Register Rret, Register Rtemp) { 3284 3285 assert_different_registers(Rrecv_klass, Rtemp, Rret); 3286 const Register Rtarget_method = Rindex; 3287 3288 // Get target method & entry point. 3289 const int base = in_bytes(InstanceKlass::vtable_start_offset()); 3290 // Calc vtable addr scale the vtable index by 8. 3291 __ sldi(Rindex, Rindex, exact_log2(vtableEntry::size_in_bytes())); 3292 // Load target. 3293 __ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes()); 3294 __ ldx(Rtarget_method, Rindex, Rrecv_klass); 3295 // Argument and return type profiling. 3296 __ profile_arguments_type(Rtarget_method, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */, true); 3297 __ call_from_interpreter(Rtarget_method, Rret, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */); 3298 } 3299 3300 // Virtual or final call. Final calls are rewritten on the fly to run through "fast_finalcall" next time. 3301 void TemplateTable::invokevirtual(int byte_no) { 3302 transition(vtos, vtos); 3303 3304 Register Rtable_addr = R11_scratch1, 3305 Rret_type = R12_scratch2, 3306 Rret_addr = R5_ARG3, 3307 Rflags = R22_tmp2, // Should survive C call. 3308 Rrecv = R3_ARG1, 3309 Rrecv_klass = Rrecv, 3310 Rvtableindex_or_method = R31, // Should survive C call. 3311 Rnum_params = R4_ARG2, |