< prev index next >

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

Print this page
rev 50788 : 8205609: [PPC64] Fix PPC64 part of 8010319 and TLH without UseSIGTRAP on AIX
Reviewed-by: dholmes


3303       __ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
3304       __ bne_predict_not_taken(CCR0, Ldummy);
3305       __ bind(Ldummy);
3306       __ isync();
3307       break;
3308     }
3309   default: ShouldNotReachHere();
3310   }
3311   __ addi(R14_bcp, R14_bcp, -1);
3312 }
3313 
3314 // ============================================================================
3315 // Calls
3316 
3317 // Common code for invoke
3318 //
3319 // Input:
3320 //   - byte_no
3321 //
3322 // Output:
3323 //   - Rmethod:        The method to invoke next.
3324 //   - Rret_addr:      The return address to return to.
3325 //   - Rindex:         MethodType (invokehandle) or CallSite obj (invokedynamic)
3326 //   - Rrecv:          Cache for "this" pointer, might be noreg if static call.
3327 //   - Rflags:         Method flags from const pool cache.
3328 //
3329 //  Kills:
3330 //   - Rscratch1
3331 //
3332 void TemplateTable::prepare_invoke(int byte_no,
3333                                    Register Rmethod,  // linked method (or i-klass)
3334                                    Register Rret_addr,// return address
3335                                    Register Rindex,   // itable index, MethodType, etc.
3336                                    Register Rrecv,    // If caller wants to see it.
3337                                    Register Rflags,   // If caller wants to test it.
3338                                    Register Rscratch
3339                                    ) {
3340   // Determine flags.
3341   const Bytecodes::Code code = bytecode();
3342   const bool is_invokeinterface  = code == Bytecodes::_invokeinterface;
3343   const bool is_invokedynamic    = code == Bytecodes::_invokedynamic;
3344   const bool is_invokehandle     = code == Bytecodes::_invokehandle;
3345   const bool is_invokevirtual    = code == Bytecodes::_invokevirtual;
3346   const bool is_invokespecial    = code == Bytecodes::_invokespecial;
3347   const bool load_receiver       = (Rrecv != noreg);
3348   assert(load_receiver == (code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic), "");
3349 
3350   assert_different_registers(Rmethod, Rindex, Rflags, Rscratch);
3351   assert_different_registers(Rmethod, Rrecv, Rflags, Rscratch);
3352   assert_different_registers(Rret_addr, Rscratch);
3353 
3354   load_invoke_cp_cache_entry(byte_no, Rmethod, Rindex, Rflags, is_invokevirtual, false, is_invokedynamic);
3355 


3601   __ bfalse(CCR0, LnotObjectMethod);
3602   invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rmethod, Rscratch1, Rscratch2);
3603   __ bind(LnotObjectMethod);
3604 
3605   // Check for private method invocation - indicated by vfinal
3606   Label LnotVFinal, L_no_such_interface, L_subtype;
3607 
3608   __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift);
3609   __ bfalse(CCR0, LnotVFinal);
3610 
3611   __ check_klass_subtype(Rrecv_klass, Rinterface_klass, Rscratch1, Rscratch2, L_subtype);
3612   // If we get here the typecheck failed
3613   __ b(L_no_such_interface);
3614   __ bind(L_subtype);
3615 
3616   // do the call
3617 
3618   Register Rscratch = Rflags; // Rflags is dead now.
3619 
3620   __ profile_final_call(Rscratch1, Rscratch);
3621   __ profile_arguments_type(Rindex, Rscratch, Rrecv_klass /* scratch */, true);
3622 
3623   __ call_from_interpreter(Rindex, Rret_addr, Rscratch, Rrecv_klass /* scratch */);
3624 
3625   __ bind(LnotVFinal);
3626 
3627   __ lookup_interface_method(Rrecv_klass, Rinterface_klass, noreg, noreg, Rscratch1, Rscratch2,
3628                              L_no_such_interface, /*return_method=*/false);
3629 
3630   __ profile_virtual_call(Rrecv_klass, Rscratch1, Rscratch2, false);
3631 
3632   // Find entry point to call.
3633 
3634   // Get declaring interface class from method
3635   __ ld(Rinterface_klass, in_bytes(Method::const_offset()), Rmethod);
3636   __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass);
3637   __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass);
3638 
3639   // Get itable index from method
3640   __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod);
3641   __ subfic(Rindex, Rindex, Method::itable_index_max);
3642 
3643   __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2,




3303       __ fcmpu(CCR0, F15_ftos, F15_ftos); // Acquire by cmp-br-isync.
3304       __ bne_predict_not_taken(CCR0, Ldummy);
3305       __ bind(Ldummy);
3306       __ isync();
3307       break;
3308     }
3309   default: ShouldNotReachHere();
3310   }
3311   __ addi(R14_bcp, R14_bcp, -1);
3312 }
3313 
3314 // ============================================================================
3315 // Calls
3316 
3317 // Common code for invoke
3318 //
3319 // Input:
3320 //   - byte_no
3321 //
3322 // Output:
3323 //   - Rmethod:        The method to invoke next or i-klass (invokeinterface).
3324 //   - Rret_addr:      The return address to return to.
3325 //   - Rindex:         MethodType (invokehandle), CallSite obj (invokedynamic) or Method (invokeinterface)
3326 //   - Rrecv:          Cache for "this" pointer, might be noreg if static call.
3327 //   - Rflags:         Method flags from const pool cache.
3328 //
3329 //  Kills:
3330 //   - Rscratch1
3331 //
3332 void TemplateTable::prepare_invoke(int byte_no,
3333                                    Register Rmethod,  // linked method (or i-klass)
3334                                    Register Rret_addr,// return address
3335                                    Register Rindex,   // itable index, MethodType, Method, etc.
3336                                    Register Rrecv,    // If caller wants to see it.
3337                                    Register Rflags,   // If caller wants to test it.
3338                                    Register Rscratch
3339                                    ) {
3340   // Determine flags.
3341   const Bytecodes::Code code = bytecode();
3342   const bool is_invokeinterface  = code == Bytecodes::_invokeinterface;
3343   const bool is_invokedynamic    = code == Bytecodes::_invokedynamic;
3344   const bool is_invokehandle     = code == Bytecodes::_invokehandle;
3345   const bool is_invokevirtual    = code == Bytecodes::_invokevirtual;
3346   const bool is_invokespecial    = code == Bytecodes::_invokespecial;
3347   const bool load_receiver       = (Rrecv != noreg);
3348   assert(load_receiver == (code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic), "");
3349 
3350   assert_different_registers(Rmethod, Rindex, Rflags, Rscratch);
3351   assert_different_registers(Rmethod, Rrecv, Rflags, Rscratch);
3352   assert_different_registers(Rret_addr, Rscratch);
3353 
3354   load_invoke_cp_cache_entry(byte_no, Rmethod, Rindex, Rflags, is_invokevirtual, false, is_invokedynamic);
3355 


3601   __ bfalse(CCR0, LnotObjectMethod);
3602   invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rmethod, Rscratch1, Rscratch2);
3603   __ bind(LnotObjectMethod);
3604 
3605   // Check for private method invocation - indicated by vfinal
3606   Label LnotVFinal, L_no_such_interface, L_subtype;
3607 
3608   __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift);
3609   __ bfalse(CCR0, LnotVFinal);
3610 
3611   __ check_klass_subtype(Rrecv_klass, Rinterface_klass, Rscratch1, Rscratch2, L_subtype);
3612   // If we get here the typecheck failed
3613   __ b(L_no_such_interface);
3614   __ bind(L_subtype);
3615 
3616   // do the call
3617 
3618   Register Rscratch = Rflags; // Rflags is dead now.
3619 
3620   __ profile_final_call(Rscratch1, Rscratch);
3621   __ profile_arguments_type(Rmethod, Rscratch, Rrecv_klass /* scratch */, true);
3622 
3623   __ call_from_interpreter(Rmethod, Rret_addr, Rscratch, Rrecv_klass /* scratch */);
3624 
3625   __ bind(LnotVFinal);
3626 
3627   __ lookup_interface_method(Rrecv_klass, Rinterface_klass, noreg, noreg, Rscratch1, Rscratch2,
3628                              L_no_such_interface, /*return_method=*/false);
3629 
3630   __ profile_virtual_call(Rrecv_klass, Rscratch1, Rscratch2, false);
3631 
3632   // Find entry point to call.
3633 
3634   // Get declaring interface class from method
3635   __ ld(Rinterface_klass, in_bytes(Method::const_offset()), Rmethod);
3636   __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass);
3637   __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass);
3638 
3639   // Get itable index from method
3640   __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod);
3641   __ subfic(Rindex, Rindex, Method::itable_index_max);
3642 
3643   __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2,


< prev index next >