8152004: CTW crashes with failed assertion after 8150646 integration
Reviewed-by: kvn, neliasso
--- a/hotspot/src/share/vm/ci/ciReplay.cpp Thu Mar 17 16:10:58 2016 -1000
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp Thu Mar 17 09:50:00 2016 +0300
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2013, 2016, 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
@@ -1057,8 +1057,6 @@
int ciReplay::replay_impl(TRAPS) {
HandleMark hm;
ResourceMark rm;
- // Make sure we don't run with background compilation
- BackgroundCompilation = false;
if (ReplaySuppressInitializers > 2) {
// ReplaySuppressInitializers > 2 means that we want to allow
--- a/hotspot/src/share/vm/classfile/classLoader.cpp Thu Mar 17 16:10:58 2016 -1000
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp Thu Mar 17 09:50:00 2016 +0300
@@ -1358,8 +1358,7 @@
EXCEPTION_MARK;
HandleMark hm(THREAD);
ResourceMark rm(THREAD);
- // Make sure we don't run with background compilation
- BackgroundCompilation = false;
+
// Find bootstrap loader
Handle system_class_loader (THREAD, SystemDictionary::java_system_loader());
// Iterate over all bootstrap class path entries
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Thu Mar 17 16:10:58 2016 -1000
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Thu Mar 17 09:50:00 2016 +0300
@@ -1170,7 +1170,8 @@
CompilationPolicy::policy()->delay_compilation(method());
return NULL;
}
- compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, comment, !directive->BackgroundCompilationOption, THREAD);
+ bool is_blocking = !directive->BackgroundCompilationOption || CompileTheWorld || ReplayCompiles;
+ compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, comment, is_blocking, THREAD);
}
// return requested nmethod
--- a/hotspot/src/share/vm/runtime/arguments.cpp Thu Mar 17 16:10:58 2016 -1000
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Thu Mar 17 09:50:00 2016 +0300
@@ -2484,6 +2484,13 @@
warning("Reserved Stack Area not supported on this platform");
}
#endif
+
+ if (BackgroundCompilation && (CompileTheWorld || ReplayCompiles)) {
+ if (!FLAG_IS_DEFAULT(BackgroundCompilation)) {
+ warning("BackgroundCompilation disabled due to CompileTheWorld or ReplayCompiles options.");
+ }
+ FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
+ }
return status;
}