< prev index next >

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

Print this page
rev 49172 : 8197405: Improve messages of AbstractMethodErrors and IncompatibleClassChangeErrors.
Reviewed-by: coleenp, dholmes, mdoerr, njian


3671   __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass);
3672   __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass);
3673 
3674   // Get itable index from method
3675   __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod);
3676   __ subfic(Rindex, Rindex, Method::itable_index_max);
3677 
3678   __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2,
3679                              L_no_such_interface);
3680 
3681   __ cmpdi(CCR0, Rmethod2, 0);
3682   __ beq(CCR0, Lthrow_ame);
3683   // Found entry. Jump off!
3684   // Argument and return type profiling.
3685   __ profile_arguments_type(Rmethod2, Rscratch1, Rscratch2, true);
3686   //__ profile_called_method(Rindex, Rscratch1);
3687   __ call_from_interpreter(Rmethod2, Rret_addr, Rscratch1, Rscratch2);
3688 
3689   // Vtable entry was NULL => Throw abstract method error.
3690   __ bind(Lthrow_ame);
3691   call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));


3692 
3693   // Interface was not found => Throw incompatible class change error.
3694   __ bind(L_no_such_interface);
3695   call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeError));


3696   DEBUG_ONLY( __ should_not_reach_here(); )
3697 
3698   // Special case of invokeinterface called for virtual method of
3699   // java.lang.Object. See ConstantPoolCacheEntry::set_method() for details:
3700   // The invokeinterface was rewritten to a invokevirtual, hence we have
3701   // to handle this corner case. This code isn't produced by javac, but could
3702   // be produced by another compliant java compiler.
3703   __ bind(LobjectMethod);
3704   invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rmethod, Rscratch1, Rscratch2);
3705 }
3706 
3707 void TemplateTable::invokedynamic(int byte_no) {
3708   transition(vtos, vtos);
3709 
3710   const Register Rret_addr = R3_ARG1,
3711                  Rflags    = R4_ARG2,
3712                  Rmethod   = R22_tmp2,
3713                  Rscratch1 = R11_scratch1,
3714                  Rscratch2 = R12_scratch2;
3715 




3671   __ ld(Rinterface_klass, in_bytes(ConstMethod::constants_offset()), Rinterface_klass);
3672   __ ld(Rinterface_klass, ConstantPool::pool_holder_offset_in_bytes(), Rinterface_klass);
3673 
3674   // Get itable index from method
3675   __ lwa(Rindex, in_bytes(Method::itable_index_offset()), Rmethod);
3676   __ subfic(Rindex, Rindex, Method::itable_index_max);
3677 
3678   __ lookup_interface_method(Rrecv_klass, Rinterface_klass, Rindex, Rmethod2, Rscratch1, Rscratch2,
3679                              L_no_such_interface);
3680 
3681   __ cmpdi(CCR0, Rmethod2, 0);
3682   __ beq(CCR0, Lthrow_ame);
3683   // Found entry. Jump off!
3684   // Argument and return type profiling.
3685   __ profile_arguments_type(Rmethod2, Rscratch1, Rscratch2, true);
3686   //__ profile_called_method(Rindex, Rscratch1);
3687   __ call_from_interpreter(Rmethod2, Rret_addr, Rscratch1, Rscratch2);
3688 
3689   // Vtable entry was NULL => Throw abstract method error.
3690   __ bind(Lthrow_ame);
3691   // Pass arguments for generating a verbose error message.
3692   call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodErrorVerbose),
3693           Rrecv_klass, Rmethod);
3694 
3695   // Interface was not found => Throw incompatible class change error.
3696   __ bind(L_no_such_interface);
3697   // Pass arguments for generating a verbose error message.
3698   call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeErrorVerbose),
3699           Rrecv_klass, Rinterface_klass);
3700   DEBUG_ONLY( __ should_not_reach_here(); )
3701 
3702   // Special case of invokeinterface called for virtual method of
3703   // java.lang.Object. See ConstantPoolCacheEntry::set_method() for details:
3704   // The invokeinterface was rewritten to a invokevirtual, hence we have
3705   // to handle this corner case. This code isn't produced by javac, but could
3706   // be produced by another compliant java compiler.
3707   __ bind(LobjectMethod);
3708   invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rmethod, Rscratch1, Rscratch2);
3709 }
3710 
3711 void TemplateTable::invokedynamic(int byte_no) {
3712   transition(vtos, vtos);
3713 
3714   const Register Rret_addr = R3_ARG1,
3715                  Rflags    = R4_ARG2,
3716                  Rmethod   = R22_tmp2,
3717                  Rscratch1 = R11_scratch1,
3718                  Rscratch2 = R12_scratch2;
3719 


< prev index next >