8173679: Disable ProfileTrap code and UseRTMLocking in emulated client Win32
authorjcm
Fri, 03 Feb 2017 19:26:35 -0800
changeset 43936 093cd5bea2e2
parent 43935 51c3deea6cdc
child 43937 def72508767d
8173679: Disable ProfileTrap code and UseRTMLocking in emulated client Win32 Summary: Disabled mdo trap count update on deopt, and made +UseRTMLocking to exit. Reviewed-by: kvn
hotspot/src/cpu/x86/vm/vm_version_x86.cpp
hotspot/src/share/vm/runtime/deoptimization.cpp
hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java
hotspot/test/compiler/types/correctness/OffTest.java
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Fri Feb 03 12:26:10 2017 +0100
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Fri Feb 03 19:26:35 2017 -0800
@@ -850,6 +850,12 @@
 
 #if INCLUDE_RTM_OPT
   if (UseRTMLocking) {
+    if (is_client_compilation_mode_vm()) {
+      // Only C2 does RTM locking optimization.
+      // Can't continue because UseRTMLocking affects UseBiasedLocking flag
+      // setting during arguments processing. See use_biased_locking().
+      vm_exit_during_initialization("RTM locking optimization is not supported in emulated client VM");
+    }
     if (is_intel_family_core()) {
       if ((_model == CPU_MODEL_HASWELL_E3) ||
           (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) ||
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Feb 03 12:26:10 2017 +0100
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Fri Feb 03 19:26:35 2017 -0800
@@ -1813,7 +1813,7 @@
     // aggressive optimization.
     bool inc_recompile_count = false;
     ProfileData* pdata = NULL;
-    if (ProfileTraps && update_trap_state && trap_mdo != NULL) {
+    if (ProfileTraps && !is_client_compilation_mode_vm() && update_trap_state && trap_mdo != NULL) {
       assert(trap_mdo == get_method_data(thread, profiled_method, false), "sanity");
       uint this_trap_count = 0;
       bool maybe_prior_trap = false;
--- a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java	Fri Feb 03 12:26:10 2017 +0100
+++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java	Fri Feb 03 19:26:35 2017 -0800
@@ -30,6 +30,6 @@
 public class SupportedVM implements BooleanSupplier {
     @Override
     public boolean getAsBoolean() {
-        return Platform.isServer();
+        return Platform.isServer() && !Platform.isEmulatedClient();
     }
 }
--- a/hotspot/test/compiler/types/correctness/OffTest.java	Fri Feb 03 12:26:10 2017 +0100
+++ b/hotspot/test/compiler/types/correctness/OffTest.java	Fri Feb 03 19:26:35 2017 -0800
@@ -24,6 +24,7 @@
 /*
  * @test CorrectnessTest
  * @bug 8038418
+ * @requires vm.flavor == "server" & !vm.emulatedClient
  * @library /test/lib /
  * @modules java.base/jdk.internal.misc
  *          java.management