annotate jvmci/jdk.internal.jvmci.compiler/src/jdk/internal/jvmci/compiler/CompilerFactory.java @ 22575:569c82ebb96e

Replace JVMCICompileWithC1Only with package based controls
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 17 Sep 2015 18:25:08 -0700
parents ec96f33a101d
children 9409f7cec59a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
1 /*
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
4 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
8 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
13 * accompanied this code).
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
14 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
18 *
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
21 * questions.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
22 */
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
23 package jdk.internal.jvmci.compiler;
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
24
22569
ec96f33a101d updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents: 22429
diff changeset
25 import jdk.internal.jvmci.code.Architecture;
ec96f33a101d updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents: 22429
diff changeset
26 import jdk.internal.jvmci.runtime.JVMCIRuntime;
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
27
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
28 /**
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
29 * Factory for a JVMCI compiler.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
30 */
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
31 public interface CompilerFactory {
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
32
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
33 /**
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
34 * Get the name of this compiler. The compiler will be selected when the jvmci.compiler system
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
35 * property is equal to this name.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
36 */
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
37 String getCompilerName();
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
38
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
39 /**
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
40 * Initialize an {@link Architecture}. The compiler has the opportunity to extend the
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
41 * {@link Architecture} description with a custom subclass.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
42 */
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
43 Architecture initializeArchitecture(Architecture arch);
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
44
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
45 /**
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
46 * Create a new instance of the {@link Compiler}.
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
47 */
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
48 Compiler createCompiler(JVMCIRuntime runtime);
22575
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
49
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
50 /**
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
51 * In a tiered system it might be advantageous for startup to keep the JVMCI compiler from
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
52 * compiling itself so provide a hook to request that certain packages are compiled only by an
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
53 * optimizing first tier. The prefixes should class or package names using / as the separator,
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
54 * i.e. jdk/internal/jvmci for instance.
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
55 *
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
56 * @return 0 or more Strings identifying packages that should by compiled by the first tier
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
57 * only.
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
58 */
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
59 default String[] getTrivialPrefixes() {
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
60 return null;
569c82ebb96e Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22569
diff changeset
61 }
22429
a1b0a76567c7 Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
62 }