8172054: Aot tests should include Java assertions into AOT compiled code
authorkvn
Wed, 04 Jan 2017 11:44:26 -0800
changeset 43425 c5dc48e6d9e6
parent 43424 5c5d1360b2d3
child 43426 f949081d8be8
8172054: Aot tests should include Java assertions into AOT compiled code Reviewed-by: iveresov
hotspot/src/share/vm/aot/aotCodeHeap.cpp
hotspot/test/compiler/aot/AotCompiler.java
hotspot/test/compiler/aot/cli/jaotc/JaotcTestHelper.java
--- a/hotspot/src/share/vm/aot/aotCodeHeap.cpp	Wed Jan 04 10:57:26 2017 -0500
+++ b/hotspot/src/share/vm/aot/aotCodeHeap.cpp	Wed Jan 04 11:44:26 2017 -0800
@@ -710,7 +710,7 @@
   }
 
   if (_lib->config()->_omitAssertions && JavaAssertions::enabled(kh->name()->as_C_string(), kh->class_loader() == NULL)) {
-    // Assertions are omitted in the compiled code, but are enabled right now. Bail out.
+    log_trace(aot, class, load)("class  %s  in  %s does not have java assertions in compiled code, but assertions are enabled for this execution.", kh->internal_name(), _lib->name());
     sweep_dependent_methods(klass_data);
     return false;
   }
--- a/hotspot/test/compiler/aot/AotCompiler.java	Wed Jan 04 10:57:26 2017 -0500
+++ b/hotspot/test/compiler/aot/AotCompiler.java	Wed Jan 04 11:44:26 2017 -0800
@@ -93,6 +93,7 @@
             }
         }
         List<String> args = new ArrayList<>();
+        args.add("--compile-with-assertions");
         args.add("--output");
         args.add(libName);
         if (file != null) {
--- a/hotspot/test/compiler/aot/cli/jaotc/JaotcTestHelper.java	Wed Jan 04 10:57:26 2017 -0500
+++ b/hotspot/test/compiler/aot/cli/jaotc/JaotcTestHelper.java	Wed Jan 04 11:44:26 2017 -0800
@@ -44,6 +44,7 @@
         for (String vmOpt : Utils.getTestJavaOpts()) {
             launcher.addVMArg(vmOpt);
         }
+        launcher.addToolArg("--compile-with-assertions");
         for (String arg : args) {
             launcher.addToolArg(arg);
         }