# HG changeset patch # User fzhinkin # Date 1458197400 -10800 # Thu Mar 17 09:50:00 2016 +0300 # Node ID 24f7a1f1640a471c65f16ece2fb8f84b38ce2389 # Parent 3256d42042919b7f19d38ceb12f2a50ad8838170 8152004: CTW crashes with failed assertion after 8150646 integration Reviewed-by: kvn, neliasso diff --git a/src/share/vm/ci/ciReplay.cpp b/src/share/vm/ci/ciReplay.cpp --- a/src/share/vm/ci/ciReplay.cpp +++ b/src/share/vm/ci/ciReplay.cpp @@ -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 diff --git a/src/share/vm/classfile/classLoader.cpp b/src/share/vm/classfile/classLoader.cpp --- a/src/share/vm/classfile/classLoader.cpp +++ b/src/share/vm/classfile/classLoader.cpp @@ -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 diff --git a/src/share/vm/compiler/compileBroker.cpp b/src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp +++ b/src/share/vm/compiler/compileBroker.cpp @@ -1169,7 +1169,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 diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -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; }