src/hotspot/cpu/x86/templateTable_x86.cpp
changeset 49368 2ed1c37df3a5
parent 49359 59f6547e151f
child 49449 ef5d5d343e2a
child 56348 f3b0961adb3c
equal deleted inserted replaced
49366:f95ef5511e1f 49368:2ed1c37df3a5
  3870   __ null_check(rcx, oopDesc::klass_offset_in_bytes());
  3870   __ null_check(rcx, oopDesc::klass_offset_in_bytes());
  3871   __ load_klass(rdx, rcx);
  3871   __ load_klass(rdx, rcx);
  3872 
  3872 
  3873   Label no_such_interface, no_such_method;
  3873   Label no_such_interface, no_such_method;
  3874 
  3874 
       
  3875   // Preserve method for throw_AbstractMethodErrorVerbose.
       
  3876   __ mov(rcx, rbx);
  3875   // Receiver subtype check against REFC.
  3877   // Receiver subtype check against REFC.
  3876   // Superklass in rax. Subklass in rdx. Blows rcx, rdi.
  3878   // Superklass in rax. Subklass in rdx. Blows rcx, rdi.
  3877   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3879   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3878                              rdx, rax, noreg,
  3880                              rdx, rax, noreg,
  3879                              // outputs: scan temp. reg, scan temp. reg
  3881                              // outputs: scan temp. reg, scan temp. reg
  3891   __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes()));
  3893   __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes()));
  3892   __ movl(rbx, Address(rbx, Method::itable_index_offset()));
  3894   __ movl(rbx, Address(rbx, Method::itable_index_offset()));
  3893   __ subl(rbx, Method::itable_index_max);
  3895   __ subl(rbx, Method::itable_index_max);
  3894   __ negl(rbx);
  3896   __ negl(rbx);
  3895 
  3897 
       
  3898   // Preserve recvKlass for throw_AbstractMethodErrorVerbose.
       
  3899   __ mov(rlocals, rdx);
  3896   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3900   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3897                              rdx, rax, rbx,
  3901                              rlocals, rax, rbx,
  3898                              // outputs: method, scan temp. reg
  3902                              // outputs: method, scan temp. reg
  3899                              rbx, rbcp,
  3903                              rbx, rbcp,
  3900                              no_such_interface);
  3904                              no_such_interface);
  3901 
  3905 
  3902   // rbx: Method* to call
  3906   // rbx: Method* to call
  3924   __ bind(no_such_method);
  3928   __ bind(no_such_method);
  3925   // throw exception
  3929   // throw exception
  3926   __ pop(rbx);           // pop return address (pushed by prepare_invoke)
  3930   __ pop(rbx);           // pop return address (pushed by prepare_invoke)
  3927   __ restore_bcp();      // rbcp must be correct for exception handler   (was destroyed)
  3931   __ restore_bcp();      // rbcp must be correct for exception handler   (was destroyed)
  3928   __ restore_locals();   // make sure locals pointer is correct as well (was destroyed)
  3932   __ restore_locals();   // make sure locals pointer is correct as well (was destroyed)
  3929   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
  3933   // Pass arguments for generating a verbose error message.
  3930   // the call_VM checks for exception, so we should never return here.
  3934 #ifdef _LP64
       
  3935   Register recvKlass = c_rarg1;
       
  3936   Register method    = c_rarg2;
       
  3937   if (recvKlass != rdx) { __ movq(recvKlass, rdx); }
       
  3938   if (method != rcx)    { __ movq(method, rcx);    }
       
  3939 #else
       
  3940   Register recvKlass = rdx;
       
  3941   Register method    = rcx;
       
  3942 #endif
       
  3943   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodErrorVerbose),
       
  3944              recvKlass, method);
       
  3945   // The call_VM checks for exception, so we should never return here.
  3931   __ should_not_reach_here();
  3946   __ should_not_reach_here();
  3932 
  3947 
  3933   __ bind(no_such_interface);
  3948   __ bind(no_such_interface);
  3934   // throw exception
  3949   // throw exception
  3935   __ pop(rbx);           // pop return address (pushed by prepare_invoke)
  3950   __ pop(rbx);           // pop return address (pushed by prepare_invoke)
  3936   __ restore_bcp();      // rbcp must be correct for exception handler   (was destroyed)
  3951   __ restore_bcp();      // rbcp must be correct for exception handler   (was destroyed)
  3937   __ restore_locals();   // make sure locals pointer is correct as well (was destroyed)
  3952   __ restore_locals();   // make sure locals pointer is correct as well (was destroyed)
  3938   __ call_VM(noreg, CAST_FROM_FN_PTR(address,
  3953   // Pass arguments for generating a verbose error message.
  3939                    InterpreterRuntime::throw_IncompatibleClassChangeError));
  3954   LP64_ONLY( if (recvKlass != rdx) { __ movq(recvKlass, rdx); } )
       
  3955   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeErrorVerbose),
       
  3956              recvKlass, rax);
  3940   // the call_VM checks for exception, so we should never return here.
  3957   // the call_VM checks for exception, so we should never return here.
  3941   __ should_not_reach_here();
  3958   __ should_not_reach_here();
  3942 }
  3959 }
  3943 
  3960 
  3944 void TemplateTable::invokehandle(int byte_no) {
  3961 void TemplateTable::invokehandle(int byte_no) {