8086068: VM crashes with "-Xint -XX:+UseCompiler" options

Prevent incompatible compiler flag combination.

Reviewed-by: zmajo, kvn, ddmitriev
This commit is contained in:
Tobias Hartmann 2016-04-21 10:52:00 +02:00
parent 04dd07454a
commit 257c8ccafc
3 changed files with 45 additions and 1 deletions

View File

@ -336,7 +336,7 @@ bool CodeCache::heap_available(int code_blob_type) {
if (!SegmentedCodeCache) {
// No segmentation: use a single code heap
return (code_blob_type == CodeBlobType::All);
} else if (Arguments::mode() == Arguments::_int) {
} else if (Arguments::is_interpreter_only()) {
// Interpreter only: we don't need any method code heaps
return (code_blob_type == CodeBlobType::NonNMethod);
} else if (TieredCompilation && (TieredStopAtLevel > CompLevel_simple)) {

View File

@ -2620,6 +2620,12 @@ bool Arguments::check_vm_args_consistency() {
}
FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
}
if (UseCompiler && is_interpreter_only()) {
if (!FLAG_IS_DEFAULT(UseCompiler)) {
warning("UseCompiler disabled due to -Xint.");
}
FLAG_SET_CMDLINE(bool, UseCompiler, false);
}
return status;
}

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test TestUseCompiler
* @bug 8086068
* @summary Tests execution with inconsistent UseCompiler flag combination.
* @run main/othervm -Xint -XX:+UseCompiler TestUseCompiler
* @run main/othervm -XX:+UseCompiler -Xint TestUseCompiler
*/
public class TestUseCompiler {
public static void main(String args[]) {
System.out.println("Passed");
}
}