changeset 60502:0a2e12c3e6e3

8240976: [JVMCI] MethodProfileWidth flag is broken Summary: remove JVMCI code which is not used Reviewed-by: thartmann, redestad
author kvn
date Tue, 17 Mar 2020 10:38:40 -0700
parents 0daa6b52ba56
children b5237a11d0dc
files src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp src/hotspot/cpu/ppc/templateTable_ppc_64.cpp src/hotspot/cpu/sparc/interp_masm_sparc.cpp src/hotspot/cpu/sparc/interp_masm_sparc.hpp src/hotspot/cpu/sparc/templateTable_sparc.cpp src/hotspot/cpu/x86/interp_masm_x86.cpp src/hotspot/cpu/x86/interp_masm_x86.hpp src/hotspot/cpu/x86/templateTable_x86.cpp src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp src/hotspot/share/jvmci/jvmci_globals.cpp src/hotspot/share/jvmci/jvmci_globals.hpp src/hotspot/share/oops/methodData.cpp src/hotspot/share/oops/methodData.hpp src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
diffstat 17 files changed, 2 insertions(+), 206 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -1153,38 +1153,10 @@
     bind(skip_receiver_profile);
 
     // The method data pointer needs to be updated to reflect the new target.
-#if INCLUDE_JVMCI
-    if (MethodProfileWidth == 0) {
-      update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
-    }
-#else // INCLUDE_JVMCI
-    update_mdp_by_constant(mdp,
-                           in_bytes(VirtualCallData::
-                                    virtual_call_data_size()));
-#endif // INCLUDE_JVMCI
-    bind(profile_continue);
-  }
-}
-
-#if INCLUDE_JVMCI
-void InterpreterMacroAssembler::profile_called_method(Register method, Register mdp, Register reg2) {
-  assert_different_registers(method, mdp, reg2);
-  if (ProfileInterpreter && MethodProfileWidth > 0) {
-    Label profile_continue;
-
-    // If no method data exists, go to profile_continue.
-    test_method_data_pointer(mdp, profile_continue);
-
-    Label done;
-    record_item_in_profile_helper(method, mdp, reg2, 0, done, MethodProfileWidth,
-      &VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset()));
-    bind(done);
-
     update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
     bind(profile_continue);
   }
 }
-#endif // INCLUDE_JVMCI
 
 // This routine creates a state machine for updating the multi-row
 // type profile at a virtual call site (or other type-sensitive bytecode).
--- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp	Tue Mar 17 10:38:40 2020 -0700
@@ -262,7 +262,6 @@
   void profile_virtual_call(Register receiver, Register mdp,
                             Register scratch2,
                             bool receiver_can_be_null = false);
-  void profile_called_method(Register method, Register mdp, Register reg2) NOT_JVMCI_RETURN;
   void profile_ret(Register return_bci, Register mdp);
   void profile_null_seen(Register mdp);
   void profile_typecheck(Register mdp, Register klass, Register scratch);
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -3664,7 +3664,6 @@
   // Found entry. Jump off!
   // Argument and return type profiling.
   __ profile_arguments_type(Rmethod2, Rscratch1, Rscratch2, true);
-  //__ profile_called_method(Rindex, Rscratch1);
   __ call_from_interpreter(Rmethod2, Rret_addr, Rscratch1, Rscratch2);
 
   // Vtable entry was NULL => Throw abstract method error.
--- a/src/hotspot/cpu/sparc/interp_masm_sparc.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/sparc/interp_masm_sparc.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -1646,36 +1646,10 @@
     bind(skip_receiver_profile);
 
     // The method data pointer needs to be updated to reflect the new target.
-#if INCLUDE_JVMCI
-    if (MethodProfileWidth == 0) {
-      update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
-    }
-#else
-    update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
-#endif
-    bind(profile_continue);
-  }
-}
-
-#if INCLUDE_JVMCI
-void InterpreterMacroAssembler::profile_called_method(Register method, Register scratch) {
-  assert_different_registers(method, scratch);
-  if (ProfileInterpreter && MethodProfileWidth > 0) {
-    Label profile_continue;
-
-    // If no method data exists, go to profile_continue.
-    test_method_data_pointer(profile_continue);
-
-    Label done;
-    record_item_in_profile_helper(method, scratch, 0, done, MethodProfileWidth,
-      &VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset()));
-    bind(done);
-
     update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
     bind(profile_continue);
   }
 }
-#endif // INCLUDE_JVMCI
 
 void InterpreterMacroAssembler::record_klass_in_profile_helper(Register receiver, Register scratch,
                                                                Label& done, bool is_virtual_call) {
--- a/src/hotspot/cpu/sparc/interp_masm_sparc.hpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/sparc/interp_masm_sparc.hpp	Tue Mar 17 10:38:40 2020 -0700
@@ -302,7 +302,6 @@
   void profile_call(Register scratch);
   void profile_final_call(Register scratch);
   void profile_virtual_call(Register receiver, Register scratch, bool receiver_can_be_null = false);
-  void profile_called_method(Register method, Register scratch) NOT_JVMCI_RETURN;
   void profile_ret(TosState state, Register return_bci, Register scratch);
   void profile_null_seen(Register scratch);
   void profile_typecheck(Register klass, Register scratch);
--- a/src/hotspot/cpu/sparc/templateTable_sparc.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/sparc/templateTable_sparc.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -3028,7 +3028,6 @@
   // get target Method* & entry point
   __ lookup_virtual_method(Rrecv, Rindex, G5_method);
   __ profile_arguments_type(G5_method, Rcall, Gargs, true);
-  __ profile_called_method(G5_method, Rtemp);
   __ call_from_interpreter(Rcall, Gargs, Rret);
 }
 
@@ -3299,7 +3298,6 @@
   assert_different_registers(Rcall, G5_method, Gargs, Rret);
 
   __ profile_arguments_type(G5_method, Rcall, Gargs, true);
-  __ profile_called_method(G5_method, Rscratch);
   __ call_from_interpreter(Rcall, Gargs, Rret);
 
   __ bind(L_no_such_interface);
--- a/src/hotspot/cpu/x86/interp_masm_x86.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -1621,38 +1621,10 @@
     bind(skip_receiver_profile);
 
     // The method data pointer needs to be updated to reflect the new target.
-#if INCLUDE_JVMCI
-    if (MethodProfileWidth == 0) {
-      update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
-    }
-#else // INCLUDE_JVMCI
-    update_mdp_by_constant(mdp,
-                           in_bytes(VirtualCallData::
-                                    virtual_call_data_size()));
-#endif // INCLUDE_JVMCI
-    bind(profile_continue);
-  }
-}
-
-#if INCLUDE_JVMCI
-void InterpreterMacroAssembler::profile_called_method(Register method, Register mdp, Register reg2) {
-  assert_different_registers(method, mdp, reg2);
-  if (ProfileInterpreter && MethodProfileWidth > 0) {
-    Label profile_continue;
-
-    // If no method data exists, go to profile_continue.
-    test_method_data_pointer(mdp, profile_continue);
-
-    Label done;
-    record_item_in_profile_helper(method, mdp, reg2, 0, done, MethodProfileWidth,
-      &VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset()));
-    bind(done);
-
     update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
     bind(profile_continue);
   }
 }
-#endif // INCLUDE_JVMCI
 
 // This routine creates a state machine for updating the multi-row
 // type profile at a virtual call site (or other type-sensitive bytecode).
--- a/src/hotspot/cpu/x86/interp_masm_x86.hpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/x86/interp_masm_x86.hpp	Tue Mar 17 10:38:40 2020 -0700
@@ -269,7 +269,6 @@
   void profile_virtual_call(Register receiver, Register mdp,
                             Register scratch2,
                             bool receiver_can_be_null = false);
-  void profile_called_method(Register method, Register mdp, Register reg2) NOT_JVMCI_RETURN;
   void profile_ret(Register return_bci, Register mdp);
   void profile_null_seen(Register mdp);
   void profile_typecheck(Register mdp, Register klass, Register scratch);
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -3743,7 +3743,6 @@
   __ profile_virtual_call(rax, rlocals, rdx);
   // get target Method* & entry point
   __ lookup_virtual_method(rax, index, method);
-  __ profile_called_method(method, rdx, rbcp);
 
   __ profile_arguments_type(rdx, method, rbcp, true);
   __ jump_from_interpreted(method, rdx);
@@ -3895,7 +3894,6 @@
   __ testptr(rbx, rbx);
   __ jcc(Assembler::zero, no_such_method);
 
-  __ profile_called_method(rbx, rbcp, rdx);
   __ profile_arguments_type(rdx, rbx, rbcp, true);
 
   // do the call
--- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -210,7 +210,6 @@
   do_intx_flag(JVMCICounterSize)                                           \
   do_bool_flag(JVMCIPrintProperties)                                       \
   do_bool_flag(JVMCIUseFastLocking)                                        \
-  do_intx_flag(MethodProfileWidth)                                         \
   do_intx_flag(ObjectAlignmentInBytes)                                     \
   do_bool_flag(PrintInlining)                                              \
   do_bool_flag(ReduceInitialCardMarks)                                     \
--- a/src/hotspot/share/jvmci/jvmci_globals.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/share/jvmci/jvmci_globals.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -108,7 +108,6 @@
   CHECK_NOT_SET(JVMCICountersExcludeCompiler, EnableJVMCI)
   CHECK_NOT_SET(JVMCIUseFastLocking,          EnableJVMCI)
   CHECK_NOT_SET(JVMCINMethodSizeLimit,        EnableJVMCI)
-  CHECK_NOT_SET(MethodProfileWidth,           EnableJVMCI)
   CHECK_NOT_SET(JVMCIPrintProperties,         EnableJVMCI)
   CHECK_NOT_SET(UseJVMCINativeLibrary,        EnableJVMCI)
   CHECK_NOT_SET(JVMCILibPath,                 EnableJVMCI)
--- a/src/hotspot/share/jvmci/jvmci_globals.hpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/share/jvmci/jvmci_globals.hpp	Tue Mar 17 10:38:40 2020 -0700
@@ -107,9 +107,6 @@
   experimental(intx, JVMCINMethodSizeLimit, (80*K)*wordSize,                \
           "Maximum size of a compiled method.")                             \
                                                                             \
-  experimental(intx, MethodProfileWidth, 0,                                 \
-          "Number of methods to record in call profile")                    \
-                                                                            \
   experimental(ccstr, JVMCILibPath, NULL,                                   \
           "LD path for loading the JVMCI shared library")                   \
                                                                             \
--- a/src/hotspot/share/oops/methodData.cpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/share/oops/methodData.cpp	Tue Mar 17 10:38:40 2020 -0700
@@ -409,28 +409,6 @@
   }
 }
 
-#if INCLUDE_JVMCI
-void VirtualCallData::clean_weak_klass_links(bool always_clean) {
-  ReceiverTypeData::clean_weak_klass_links(always_clean);
-  for (uint row = 0; row < method_row_limit(); row++) {
-    Method* p = method(row);
-    if (p != NULL && (always_clean || !p->method_holder()->is_loader_alive())) {
-      clear_method_row(row);
-    }
-  }
-}
-
-void VirtualCallData::clean_weak_method_links() {
-  ReceiverTypeData::clean_weak_method_links();
-  for (uint row = 0; row < method_row_limit(); row++) {
-    Method* p = method(row);
-    if (p != NULL && p->is_old()) {
-      clear_method_row(row);
-    }
-  }
-}
-#endif // INCLUDE_JVMCI
-
 void ReceiverTypeData::print_receiver_data_on(outputStream* st) const {
   uint row;
   int entries = 0;
@@ -461,35 +439,9 @@
   print_receiver_data_on(st);
 }
 
-#if INCLUDE_JVMCI
-void VirtualCallData::print_method_data_on(outputStream* st) const {
-  uint row;
-  int entries = 0;
-  for (row = 0; row < method_row_limit(); row++) {
-    if (method(row) != NULL) entries++;
-  }
-  tab(st);
-  st->print_cr("method_entries(%u)", entries);
-  int total = count();
-  for (row = 0; row < method_row_limit(); row++) {
-    if (method(row) != NULL) {
-      total += method_count(row);
-    }
-  }
-  for (row = 0; row < method_row_limit(); row++) {
-    if (method(row) != NULL) {
-      tab(st);
-      method(row)->print_value_on(st);
-      st->print_cr("(%u %4.2f)", method_count(row), (float) method_count(row) / (float) total);
-    }
-  }
-}
-#endif // INCLUDE_JVMCI
-
 void VirtualCallData::print_data_on(outputStream* st, const char* extra) const {
   print_shared(st, "VirtualCallData", extra);
   print_receiver_data_on(st);
-  print_method_data_on(st);
 }
 
 // ==================================================================
--- a/src/hotspot/share/oops/methodData.hpp	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/hotspot/share/oops/methodData.hpp	Tue Mar 17 10:38:40 2020 -0700
@@ -1229,7 +1229,7 @@
   static int static_cell_count() {
     // At this point we could add more profile state, e.g., for arguments.
     // But for now it's the same size as the base record type.
-    return ReceiverTypeData::static_cell_count() JVMCI_ONLY(+ (uint) MethodProfileWidth * receiver_type_row_cell_count);
+    return ReceiverTypeData::static_cell_count();
   }
 
   virtual int cell_count() const {
@@ -1241,61 +1241,6 @@
     return cell_offset(static_cell_count());
   }
 
-#if INCLUDE_JVMCI
-  static ByteSize method_offset(uint row) {
-    return cell_offset(method_cell_index(row));
-  }
-  static ByteSize method_count_offset(uint row) {
-    return cell_offset(method_count_cell_index(row));
-  }
-  static int method_cell_index(uint row) {
-    return receiver0_offset + (row + TypeProfileWidth) * receiver_type_row_cell_count;
-  }
-  static int method_count_cell_index(uint row) {
-    return count0_offset + (row + TypeProfileWidth) * receiver_type_row_cell_count;
-  }
-  static uint method_row_limit() {
-    return MethodProfileWidth;
-  }
-
-  Method* method(uint row) const {
-    assert(row < method_row_limit(), "oob");
-
-    Method* method = (Method*)intptr_at(method_cell_index(row));
-    assert(method == NULL || method->is_method(), "must be");
-    return method;
-  }
-
-  uint method_count(uint row) const {
-    assert(row < method_row_limit(), "oob");
-    return uint_at(method_count_cell_index(row));
-  }
-
-  void set_method(uint row, Method* m) {
-    assert((uint)row < method_row_limit(), "oob");
-    set_intptr_at(method_cell_index(row), (uintptr_t)m);
-  }
-
-  void set_method_count(uint row, uint count) {
-    assert(row < method_row_limit(), "oob");
-    set_uint_at(method_count_cell_index(row), count);
-  }
-
-  void clear_method_row(uint row) {
-    assert(row < method_row_limit(), "oob");
-    // Clear total count - indicator of polymorphic call site (see comment for clear_row() in ReceiverTypeData).
-    set_nonprofiled_count(0);
-    set_method(row, NULL);
-    set_method_count(row, 0);
-  }
-
-  // GC support
-  virtual void clean_weak_klass_links(bool always_clean);
-
-  // Redefinition support
-  virtual void clean_weak_method_links();
-#endif // INCLUDE_JVMCI
-
   void print_method_data_on(outputStream* st) const NOT_JVMCI_RETURN;
   void print_data_on(outputStream* st, const char* extra = NULL) const;
 };
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java	Tue Mar 17 10:38:40 2020 -0700
@@ -36,7 +36,6 @@
 public class MethodData extends Metadata implements MethodDataInterface<Klass,Method> {
   static int TypeProfileWidth = 2;
   static int BciProfileWidth = 2;
-  static int MethodProfileWidth = 0;
   static int CompileThreshold;
 
   static int Reason_many;                 // indicates presence of several reasons
@@ -143,8 +142,6 @@
         TypeProfileWidth = (int)flag.getIntx();
       } else if (flag.getName().equals("BciProfileWidth")) {
         BciProfileWidth = (int)flag.getIntx();
-      } else if (flag.getName().equals("MethodProfileWidth")) {
-        MethodProfileWidth = (int)flag.getIntx();
       } else if (flag.getName().equals("CompileThreshold")) {
         CompileThreshold = (int)flag.getIntx();
       }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java	Tue Mar 17 10:38:40 2020 -0700
@@ -45,9 +45,6 @@
     // At this point we could add more profile state, e.g., for arguments.
     // But for now it's the same size as the base record type.
     int cellCount = ReceiverTypeData.staticCellCount();
-    if (INCLUDE_JVMCI == 1) {
-      cellCount += MethodData.MethodProfileWidth * receiverTypeRowCellCount;
-    }
     return cellCount;
   }
 
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java	Tue Mar 17 14:13:52 2020 +0000
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java	Tue Mar 17 10:38:40 2020 -0700
@@ -313,7 +313,7 @@
 
     final int bciProfileWidth = getFlag("BciProfileWidth", Integer.class);
     final int typeProfileWidth = getFlag("TypeProfileWidth", Integer.class);
-    final int methodProfileWidth = getFlag("MethodProfileWidth", Integer.class);
+    final int methodProfileWidth = getFlag("MethodProfileWidth", Integer.class, 0);
 
     final int deoptReasonNone = getConstant("Deoptimization::Reason_none", Integer.class);
     final int deoptReasonNullCheck = getConstant("Deoptimization::Reason_null_check", Integer.class);