8216180: [AOT] compiler/intrinsics/bigInteger/TestMulAdd.java crashed with AOT enabled
authoriignatyev
Wed, 23 Jan 2019 16:36:45 -0800
changeset 53494 8fd43dacaef7
parent 53493 376f0e4e6fba
child 53495 b693b0d2053d
8216180: [AOT] compiler/intrinsics/bigInteger/TestMulAdd.java crashed with AOT enabled Reviewed-by: kvn
src/hotspot/share/prims/whitebox.cpp
test/hotspot/jtreg/TEST.ROOT
test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java
test/jtreg-ext/requires/VMProps.java
test/lib/sun/hotspot/WhiteBox.java
--- a/src/hotspot/share/prims/whitebox.cpp	Wed Jan 23 16:25:40 2019 -0800
+++ b/src/hotspot/share/prims/whitebox.cpp	Wed Jan 23 16:36:45 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, 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
@@ -93,6 +93,9 @@
 #include "services/memTracker.hpp"
 #include "utilities/nativeCallStack.hpp"
 #endif // INCLUDE_NMT
+#if INCLUDE_AOT
+#include "aot/aotLoader.hpp"
+#endif // INCLUDE_AOT
 
 #ifdef LINUX
 #include "osContainer_linux.hpp"
@@ -2118,6 +2121,14 @@
   return (jint) SystemDictionary::pd_cache_table()->removed_entries_count();
 WB_END
 
+WB_ENTRY(jint, WB_AotLibrariesCount(JNIEnv* env, jobject o))
+  jint result = 0;
+#if INCLUDE_AOT
+  result = (jint) AOTLoader::heaps_count();
+#endif
+  return result;
+WB_END
+
 #define CC (char*)
 
 static JNINativeMethod methods[] = {
@@ -2350,6 +2361,7 @@
   {CC"disableElfSectionCache",    CC"()V",            (void*)&WB_DisableElfSectionCache },
   {CC"resolvedMethodRemovedCount",     CC"()I",       (void*)&WB_ResolvedMethodRemovedCount },
   {CC"protectionDomainRemovedCount",   CC"()I",       (void*)&WB_ProtectionDomainRemovedCount },
+  {CC"aotLibrariesCount", CC"()I",                    (void*)&WB_AotLibrariesCount },
 };
 
 
--- a/test/hotspot/jtreg/TEST.ROOT	Wed Jan 23 16:25:40 2019 -0800
+++ b/test/hotspot/jtreg/TEST.ROOT	Wed Jan 23 16:36:45 2019 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2019, 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
@@ -59,6 +59,7 @@
     vm.rtm.cpu \
     vm.rtm.compiler \
     vm.aot \
+    vm.aot.enabled \
     vm.cds \
     vm.cds.custom.loaders \
     vm.cds.archived.java.heap \
--- a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java	Wed Jan 23 16:25:40 2019 -0800
+++ b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java	Wed Jan 23 16:36:45 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,6 +25,8 @@
  * @test
  * @bug 8081778
  * @summary Add C2 x86 intrinsic for BigInteger::mulAdd() method
+ * @comment the test disables intrinsics, so it can't be run w/ AOT'ed java.base
+ * @requires !vm.aot.enabled
  *
  * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch
  *      -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-UseSquareToLenIntrinsic -XX:-UseMultiplyToLenIntrinsic
--- a/test/jtreg-ext/requires/VMProps.java	Wed Jan 23 16:25:40 2019 -0800
+++ b/test/jtreg-ext/requires/VMProps.java	Wed Jan 23 16:36:45 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, 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
@@ -86,6 +86,7 @@
         map.put("vm.rtm.cpu", vmRTMCPU());
         map.put("vm.rtm.compiler", vmRTMCompiler());
         map.put("vm.aot", vmAOT());
+        map.put("vm.aot.enabled", vmAotEnabled());
         // vm.cds is true if the VM is compiled with cds support.
         map.put("vm.cds", vmCDS());
         map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders());
@@ -334,6 +335,13 @@
         return "" + Files.exists(jaotc);
     }
 
+    /*
+     * @return true if there is at least one loaded AOT'ed library.
+     */
+    protected String vmAotEnabled() {
+        return "" + (WB.aotLibrariesCount() > 0);
+    }
+
     /**
      * Check for CDS support.
      *
--- a/test/lib/sun/hotspot/WhiteBox.java	Wed Jan 23 16:25:40 2019 -0800
+++ b/test/lib/sun/hotspot/WhiteBox.java	Wed Jan 23 16:36:45 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, 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
@@ -549,4 +549,7 @@
 
   // Protection Domain Table
   public native int protectionDomainRemovedCount();
+
+  // Number of loaded AOT libraries
+  public native int aotLibrariesCount();
 }