author | bpittore |
Wed, 24 Jun 2015 12:12:25 -0400 | |
changeset 31592 | 43f48e165466 |
parent 31371 | 311143309e73 |
child 31959 | 34180370555e |
child 31995 | aa4049b4184a |
permissions | -rw-r--r-- |
31371
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
1 |
/* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
4 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
8 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
13 |
* accompanied this code). |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
14 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
18 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
21 |
* questions. |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
22 |
* |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
23 |
*/ |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
24 |
|
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
26 |
#include "runtime/arguments.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
27 |
#include "runtime/commandLineFlagConstraintsCompiler.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
28 |
#include "runtime/globals.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
29 |
#include "utilities/defaultStream.hpp" |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
30 |
|
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
31 |
Flag::Error AliasLevelConstraintFunc(bool verbose, intx* value) { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
32 |
if (CommandLineFlags::finishedInitializing() == true) { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
33 |
if ((*value <= 1) && (Arguments::mode() == Arguments::_comp)) { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
34 |
if (verbose == true) { |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
35 |
jio_fprintf(defaultStream::error_stream(), |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
36 |
"AliasLevel (" INTX_FORMAT ") is not compatible " |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
37 |
"with -Xcomp \n", |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
38 |
*value); |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
39 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
40 |
return Flag::VIOLATES_CONSTRAINT; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
41 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
42 |
} |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
43 |
return Flag::SUCCESS; |
311143309e73
8122937: [JEP 245] Validate JVM Command-Line Flag Arguments.
gziemski
parents:
diff
changeset
|
44 |
} |