diff src/cpu/x86/vm/templateTable_x86.cpp @ 12967:c031bb257839

Removing invokedirect
author fparain
date Fri, 28 Apr 2017 09:43:04 -0400
parents d16eda688d5d
children dc6b2e52b5ea
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateTable_x86.cpp	Thu Apr 27 13:04:18 2017 -0400
+++ b/src/cpu/x86/vm/templateTable_x86.cpp	Fri Apr 28 09:43:04 2017 -0400
@@ -3661,12 +3661,11 @@
   const bool is_invokedynamic    = code == Bytecodes::_invokedynamic;
   const bool is_invokehandle     = code == Bytecodes::_invokehandle;
   const bool is_invokevirtual    = code == Bytecodes::_invokevirtual;
-  const bool is_invokedirect     = code == Bytecodes::_invokedirect;
   const bool is_invokespecial    = code == Bytecodes::_invokespecial;
   const bool load_receiver       = (recv  != noreg);
   const bool save_flags          = (flags != noreg);
   assert(load_receiver == (code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic), "");
-  assert(save_flags    == (is_invokeinterface || is_invokevirtual || is_invokedirect), "need flags for vfinal");
+  assert(save_flags    == (is_invokeinterface || is_invokevirtual), "need flags for vfinal");
   assert(flags == noreg || flags == rdx, "");
   assert(recv  == noreg || recv  == rcx, "");
 
@@ -3678,9 +3677,7 @@
   // save 'interpreter return address'
   __ save_bcp();
 
-  load_invoke_cp_cache_entry(byte_no, method, index, flags,
-                             is_invokevirtual || is_invokedirect,
-                             false, is_invokedynamic);
+  load_invoke_cp_cache_entry(byte_no, method, index, flags, is_invokevirtual, false, is_invokedynamic);
 
   // maybe push appendix to arguments (just before return address)
   if (is_invokedynamic || is_invokehandle) {
@@ -3800,36 +3797,6 @@
   invokevirtual_helper(rbx, rcx, rdx);
 }
 
-/*
- * The invokedirect bytecode is implemented as an invokevirtual bytecode:
- * The implementation blindly uses resolve_invokevirtual() and assumes
- * that a final call will be picked at the end. (Currently unsure about interfaces,
- * default methods, and about where "Value.equals(QValue;)Z" should live.)
- */
-void TemplateTable::invokedirect(int byte_no) {
-  transition(vtos, vtos);
-  assert(byte_no == f2_byte, "use this argument");
-  prepare_invoke(byte_no,
-      rbx,       // method (and not vtable index, as the method to be invoked should be final)
-      noreg,
-      rcx, rdx); // recv, flags
-
-  // Check if the method is final
-  Label notFinal;
-  __ movl(rax, rdx);
-  __ andl(rax, (1 << ConstantPoolCacheEntry::is_vfinal_shift));
-  __ jcc(Assembler::zero, notFinal);
-
-  __ verify_oop(rcx);
-  __ null_check(rcx);
-  __ profile_final_call(rax);
-  __ profile_arguments_type(rax, rbx, rbcp, true);
-  __ jump_from_interpreted(rbx, rax);
-
-  __ bind(notFinal);
-  __ stop("Interpreter observed a non-final method as a target of an invokedirect instruction");
-}
-
 void TemplateTable::invokespecial(int byte_no) {
   transition(vtos, vtos);
   assert(byte_no == f1_byte, "use this argument");