8172054: Aot tests should include Java assertions into AOT compiled code

Reviewed-by: iveresov
This commit is contained in:
Vladimir Kozlov 2017-01-04 11:44:26 -08:00
parent 1e918ed98c
commit b58bb4740e
3 changed files with 3 additions and 1 deletions

View File

@ -710,7 +710,7 @@ bool AOTCodeHeap::load_klass_data(instanceKlassHandle kh, Thread* thread) {
}
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;
}

View File

@ -93,6 +93,7 @@ public class AotCompiler {
}
}
List<String> args = new ArrayList<>();
args.add("--compile-with-assertions");
args.add("--output");
args.add(libName);
if (file != null) {

View File

@ -44,6 +44,7 @@ public class JaotcTestHelper {
for (String vmOpt : Utils.getTestJavaOpts()) {
launcher.addVMArg(vmOpt);
}
launcher.addToolArg("--compile-with-assertions");
for (String arg : args) {
launcher.addToolArg(arg);
}