src/hotspot/cpu/x86/templateTable_x86.cpp
changeset 48557 2e867226b914
parent 47916 bdbef8638948
child 48608 1dab70e20292
equal deleted inserted replaced
48556:d44d912ea9bb 48557:2e867226b914
  3710 
  3710 
  3711 
  3711 
  3712 void TemplateTable::invokeinterface(int byte_no) {
  3712 void TemplateTable::invokeinterface(int byte_no) {
  3713   transition(vtos, vtos);
  3713   transition(vtos, vtos);
  3714   assert(byte_no == f1_byte, "use this argument");
  3714   assert(byte_no == f1_byte, "use this argument");
  3715   prepare_invoke(byte_no, rax, rbx,  // get f1 Klass*, f2 itable index
  3715   prepare_invoke(byte_no, rax, rbx,  // get f1 Klass*, f2 Method*
  3716                  rcx, rdx); // recv, flags
  3716                  rcx, rdx); // recv, flags
  3717 
  3717 
  3718   // rax: interface klass (from f1)
  3718   // rax: reference klass (from f1)
  3719   // rbx: itable index (from f2)
  3719   // rbx: method (from f2)
  3720   // rcx: receiver
  3720   // rcx: receiver
  3721   // rdx: flags
  3721   // rdx: flags
  3722 
  3722 
  3723   // Special case of invokeinterface called for virtual method of
  3723   // Special case of invokeinterface called for virtual method of
  3724   // java.lang.Object.  See cpCacheOop.cpp for details.
  3724   // java.lang.Object.  See cpCacheOop.cpp for details.
  3736   // Get receiver klass into rdx - also a null check
  3736   // Get receiver klass into rdx - also a null check
  3737   __ restore_locals();  // restore r14
  3737   __ restore_locals();  // restore r14
  3738   __ null_check(rcx, oopDesc::klass_offset_in_bytes());
  3738   __ null_check(rcx, oopDesc::klass_offset_in_bytes());
  3739   __ load_klass(rdx, rcx);
  3739   __ load_klass(rdx, rcx);
  3740 
  3740 
       
  3741   Label no_such_interface, no_such_method;
       
  3742 
       
  3743   // Receiver subtype check against REFC.
       
  3744   // Superklass in rax. Subklass in rdx. Blows rcx, rdi.
       
  3745   __ lookup_interface_method(// inputs: rec. class, interface, itable index
       
  3746                              rdx, rax, noreg,
       
  3747                              // outputs: scan temp. reg, scan temp. reg
       
  3748                              rbcp, rlocals,
       
  3749                              no_such_interface,
       
  3750                              /*return_method=*/false);
       
  3751 
  3741   // profile this call
  3752   // profile this call
       
  3753   __ restore_bcp(); // rbcp was destroyed by receiver type check
  3742   __ profile_virtual_call(rdx, rbcp, rlocals);
  3754   __ profile_virtual_call(rdx, rbcp, rlocals);
  3743 
  3755 
  3744   Label no_such_interface, no_such_method;
  3756   // Get declaring interface class from method, and itable index
       
  3757   __ movptr(rax, Address(rbx, Method::const_offset()));
       
  3758   __ movptr(rax, Address(rax, ConstMethod::constants_offset()));
       
  3759   __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes()));
       
  3760   __ movl(rbx, Address(rbx, Method::itable_index_offset()));
       
  3761   __ subl(rbx, Method::itable_index_max);
       
  3762   __ negl(rbx);
  3745 
  3763 
  3746   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3764   __ lookup_interface_method(// inputs: rec. class, interface, itable index
  3747                              rdx, rax, rbx,
  3765                              rdx, rax, rbx,
  3748                              // outputs: method, scan temp. reg
  3766                              // outputs: method, scan temp. reg
  3749                              rbx, rbcp,
  3767                              rbx, rbcp,