changeset 57588:80d8e00ec63a

8235934: gc/g1/TestGCLogMessages.java fails with 'DerivedPointerTable Update' found Summary: Fix determining whether C2 or JVMCI are enabled in the test. Reviewed-by: sjohanss, kbarrett
author tschatzl
date Wed, 08 Jan 2020 14:36:48 +0100
parents 6e51a868361e
children decd3d2953b6 70a3551fea52
files src/hotspot/share/prims/whitebox.cpp test/hotspot/jtreg/gc/g1/TestGCLogMessages.java test/lib/sun/hotspot/WhiteBox.java test/lib/sun/hotspot/code/Compiler.java
diffstat 4 files changed, 25 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/prims/whitebox.cpp	Tue Jan 07 17:28:42 2020 -0500
+++ b/src/hotspot/share/prims/whitebox.cpp	Wed Jan 08 14:36:48 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1986,6 +1986,14 @@
 #endif // INCLUDE_CDS
 WB_END
 
+WB_ENTRY(jboolean, WB_isC2OrJVMCIIncludedInVmBuild(JNIEnv* env))
+#if COMPILER2_OR_JVMCI
+  return true;
+#else
+  return false;
+#endif
+WB_END
+
 WB_ENTRY(jboolean, WB_IsJavaHeapArchiveSupported(JNIEnv* env))
   return HeapShared::is_heap_object_archiving_allowed();
 WB_END
@@ -2411,6 +2419,7 @@
   {CC"areOpenArchiveHeapObjectsMapped",   CC"()Z",    (void*)&WB_AreOpenArchiveHeapObjectsMapped},
   {CC"isCDSIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsCDSIncludedInVmBuild },
   {CC"isJFRIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsJFRIncludedInVmBuild },
+  {CC"isC2OrJVMCIIncludedInVmBuild",      CC"()Z",    (void*)&WB_isC2OrJVMCIIncludedInVmBuild },
   {CC"isJavaHeapArchiveSupported",        CC"()Z",    (void*)&WB_IsJavaHeapArchiveSupported },
   {CC"cdsMemoryMappingFailed",            CC"()Z",    (void*)&WB_CDSMemoryMappingFailed },
 
--- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java	Tue Jan 07 17:28:42 2020 -0500
+++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java	Wed Jan 08 14:36:48 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@
         }
 
         public boolean isAvailable() {
-            return Compiler.isC2Enabled() || Compiler.isGraalEnabled();
+            return Compiler.isC2OrJVMCIIncludedInVmBuild();
         }
     }
 
--- a/test/lib/sun/hotspot/WhiteBox.java	Tue Jan 07 17:28:42 2020 -0500
+++ b/test/lib/sun/hotspot/WhiteBox.java	Wed Jan 08 14:36:48 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -227,6 +227,8 @@
   public native void NMTArenaMalloc(long arena, long size);
 
   // Compiler
+  public native boolean isC2OrJVMCIIncludedInVmBuild();
+
   public native int     matchesMethod(Executable method, String pattern);
   public native int     matchesInline(Executable method, String pattern);
   public native boolean shouldPrintAssembly(Executable method, int comp_level);
--- a/test/lib/sun/hotspot/code/Compiler.java	Tue Jan 07 17:28:42 2020 -0500
+++ b/test/lib/sun/hotspot/code/Compiler.java	Wed Jan 08 14:36:48 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,15 @@
     private static final WhiteBox WB = WhiteBox.getWhiteBox();
 
     /**
+     * Check if C2 or JVMCI were included in the VM build
+     *
+     * @return true if either C2 or JVMCI were included in the VM build.
+     */
+    public static boolean isC2OrJVMCIIncludedInVmBuild() {
+        return WB.isC2OrJVMCIIncludedInVmBuild();
+    }
+
+    /**
      * Check if Graal is used as JIT compiler.
      *
      * Graal is enabled if following conditions are true: