8172054: Aot tests should include Java assertions into AOT compiled code
Reviewed-by: iveresov
--- 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);
}