Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @ 23996:11f0412408cd
8173912: [JVMCI] fix memory overhead of JVMCI
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 03 Feb 2017 21:08:05 +0100 |
parents | ebce30b702eb |
children | 1439a6614a10 |
rev | line source |
---|---|
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22770
diff
changeset
|
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
25 import static jdk.vm.ci.common.InitTimer.timer; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 |
22626
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
27 import java.io.IOException; |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
28 import java.io.OutputStream; |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
29 import java.io.PrintStream; |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
30 import java.util.Collections; |
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
31 import java.util.HashMap; |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
32 import java.util.List; |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
33 import java.util.Map; |
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
34 import java.util.Objects; |
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
35 import java.util.TreeMap; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
37 import jdk.vm.ci.code.Architecture; |
22770
1fbfcc0334d3
JVMCI PrintCompilation support should reuse CompileBroker logic
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22767
diff
changeset
|
38 import jdk.vm.ci.code.CompilationRequestResult; |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22770
diff
changeset
|
39 import jdk.vm.ci.code.CompiledCode; |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
40 import jdk.vm.ci.code.InstalledCode; |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
41 import jdk.vm.ci.common.InitTimer; |
23392
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23391
diff
changeset
|
42 import jdk.vm.ci.common.JVMCIError; |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23783
diff
changeset
|
43 import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevel; |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
44 import jdk.vm.ci.meta.JavaKind; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
45 import jdk.vm.ci.meta.JavaType; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
46 import jdk.vm.ci.meta.ResolvedJavaType; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
47 import jdk.vm.ci.runtime.JVMCI; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22658
diff
changeset
|
48 import jdk.vm.ci.runtime.JVMCIBackend; |
22697
57646377e480
Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents:
22694
diff
changeset
|
49 import jdk.vm.ci.runtime.JVMCICompiler; |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23783
diff
changeset
|
50 import jdk.vm.ci.runtime.JVMCICompilerFactory; |
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23783
diff
changeset
|
51 import jdk.vm.ci.services.JVMCIServiceLocator; |
22761
f2206f5bb62e
removed @ServiceProvider mechanism (GRAAL-1380)
Doug Simon <doug.simon@oracle.com>
parents:
22758
diff
changeset
|
52 import jdk.vm.ci.services.Services; |
22767
d88299d598d6
Add support for passing back bailout messages
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22761
diff
changeset
|
53 import sun.misc.VM; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
55 /** |
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
56 * HotSpot implementation of a JVMCI runtime. |
22694
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
57 * |
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
58 * The initialization of this class is very fragile since it's initialized both through |
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
59 * {@link JVMCI#initialize()} or through calling {@link HotSpotJVMCIRuntime#runtime()} and |
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
60 * {@link HotSpotJVMCIRuntime#runtime()} is also called by {@link JVMCI#initialize()}. So this class |
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
61 * can't have a static initializer and any required initialization must be done as part of |
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
62 * {@link #runtime()}. This allows the initialization to funnel back through |
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
63 * {@link JVMCI#initialize()} without deadlocking. |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
64 */ |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
65 public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider { |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
66 |
22509
267eecd6d92a
suppressed -Xlint:try warnings
Doug Simon <doug.simon@oracle.com>
parents:
22486
diff
changeset
|
67 @SuppressWarnings("try") |
22462
7a7dd51e7e0b
Ensure that calling HotSpotJVMCIRuntime.runtime() initializes JVMCI correctly
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22454
diff
changeset
|
68 static class DelayedInit { |
7a7dd51e7e0b
Ensure that calling HotSpotJVMCIRuntime.runtime() initializes JVMCI correctly
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22454
diff
changeset
|
69 private static final HotSpotJVMCIRuntime instance; |
7a7dd51e7e0b
Ensure that calling HotSpotJVMCIRuntime.runtime() initializes JVMCI correctly
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22454
diff
changeset
|
70 |
7a7dd51e7e0b
Ensure that calling HotSpotJVMCIRuntime.runtime() initializes JVMCI correctly
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22454
diff
changeset
|
71 static { |
22658
61bb5fa12458
Remove StartupEventListener interface.
Roland Schatz <roland.schatz@oracle.com>
parents:
22657
diff
changeset
|
72 try (InitTimer t = timer("HotSpotJVMCIRuntime.<init>")) { |
61bb5fa12458
Remove StartupEventListener interface.
Roland Schatz <roland.schatz@oracle.com>
parents:
22657
diff
changeset
|
73 instance = new HotSpotJVMCIRuntime(); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
74 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
75 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
76 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
77 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
78 /** |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
79 * Gets the singleton {@link HotSpotJVMCIRuntime} object. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
80 */ |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 public static HotSpotJVMCIRuntime runtime() { |
22694
023981d7f257
Fix deadlock between JVMCI.initialize and HotSpotJVMCIRuntime.runtime
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22672
diff
changeset
|
82 JVMCI.initialize(); |
22462
7a7dd51e7e0b
Ensure that calling HotSpotJVMCIRuntime.runtime() initializes JVMCI correctly
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22454
diff
changeset
|
83 return DelayedInit.instance; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
84 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 |
22758
a130b51efb07
removed @Option mechanism from JVMCI (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
22697
diff
changeset
|
86 /** |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
87 * A list of all supported JVMCI options. |
22758
a130b51efb07
removed @Option mechanism from JVMCI (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
22697
diff
changeset
|
88 */ |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
89 public enum Option { |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
90 // @formatter:off |
23319
c1935b089c01
8151470: [JVMCI] remove up-call to HotSpotJVMCICompilerConfig.selectCompiler
Roland Schatz <roland.schatz@oracle.com>
parents:
23306
diff
changeset
|
91 Compiler(String.class, null, "Selects the system compiler."), |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
92 // Note: The following one is not used (see InitTimer.ENABLED). It is added here |
23783
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
93 // so that -XX:+JVMCIPrintProperties shows the option. |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
94 InitTimer(Boolean.class, false, "Specifies if initialization timing is enabled."), |
23783
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
95 PrintConfig(Boolean.class, false, "Prints VM configuration available via JVMCI."), |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
96 TraceMethodDataFilter(String.class, null, |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
97 "Enables tracing of profiling info when read by JVMCI.", |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
98 "Empty value: trace all methods", |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
99 "Non-empty value: trace methods whose fully qualified name contains the value."); |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
100 // @formatter:on |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
101 |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
102 /** |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
103 * The prefix for system properties that are JVMCI options. |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
104 */ |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
105 private static final String JVMCI_OPTION_PROPERTY_PREFIX = "jvmci."; |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
106 |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
107 /** |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
108 * Marker for uninitialized flags. |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
109 */ |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
110 private static final String UNINITIALIZED = "UNINITIALIZED"; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
111 |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
112 private final Class<?> type; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
113 private Object value; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
114 private final Object defaultValue; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
115 private boolean isDefault; |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
116 private final String[] helpLines; |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
117 |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
118 Option(Class<?> type, Object defaultValue, String... helpLines) { |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
119 assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name(); |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
120 this.type = type; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
121 this.value = UNINITIALIZED; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
122 this.defaultValue = defaultValue; |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
123 this.helpLines = helpLines; |
22758
a130b51efb07
removed @Option mechanism from JVMCI (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
22697
diff
changeset
|
124 } |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
125 |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
126 @SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "sentinel must be String since it's a static final in an enum") |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
127 private Object getValue() { |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
128 if (value == UNINITIALIZED) { |
23779
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
129 String propertyValue = VM.getSavedProperty(getPropertyName()); |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
130 if (propertyValue == null) { |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
131 this.value = defaultValue; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
132 this.isDefault = true; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
133 } else { |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
134 if (type == Boolean.class) { |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
135 this.value = Boolean.parseBoolean(propertyValue); |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
136 } else if (type == String.class) { |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
137 this.value = propertyValue; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
138 } else { |
23392
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23391
diff
changeset
|
139 throw new JVMCIError("Unexpected option type " + type); |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
140 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
141 this.isDefault = false; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
142 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
143 // Saved properties should not be interned - let's be sure |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
144 assert value != UNINITIALIZED; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
145 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
146 return value; |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
147 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
148 |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
149 /** |
23779
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
150 * Gets the name of system property from which this option gets its value. |
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
151 */ |
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
152 public String getPropertyName() { |
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
153 return JVMCI_OPTION_PROPERTY_PREFIX + name(); |
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
154 } |
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
155 |
16b5e00d9196
renamed JVMCIPrintFlags to JVMCIPrintSystemProperties
Doug Simon <doug.simon@oracle.com>
parents:
23778
diff
changeset
|
156 /** |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
157 * Returns the option's value as boolean. |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
158 * |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
159 * @return option's value |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
160 */ |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
161 public boolean getBoolean() { |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
162 return (boolean) getValue(); |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
163 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
164 |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
165 /** |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
166 * Returns the option's value as String. |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
167 * |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
168 * @return option's value |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
169 */ |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
170 public String getString() { |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
171 return (String) getValue(); |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
172 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
173 |
23787
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
174 private static final int PROPERTY_LINE_WIDTH = 80; |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
175 private static final int PROPERTY_HELP_INDENT = 10; |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
176 |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
177 /** |
23783
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
178 * Prints a description of the properties used to configure shared JVMCI code. |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
179 * |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
180 * @param out stream to print to |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
181 */ |
23783
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
182 public static void printProperties(PrintStream out) { |
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
183 out.println("[JVMCI properties]"); |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
184 Option[] values = values(); |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
185 for (Option option : values) { |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
186 Object value = option.getValue(); |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
187 if (value instanceof String) { |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
188 value = '"' + String.valueOf(value) + '"'; |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
189 } |
23787
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
190 |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
191 String name = option.getPropertyName(); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
192 String assign = option.isDefault ? "=" : ":="; |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
193 String typeName = option.type.getSimpleName(); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
194 String linePrefix = String.format("%s %s %s ", name, assign, value); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
195 int typeStartPos = PROPERTY_LINE_WIDTH - typeName.length(); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
196 int linePad = typeStartPos - linePrefix.length(); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
197 if (linePad > 0) { |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
198 out.printf("%s%-" + linePad + "s[%s]%n", linePrefix, "", typeName); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
199 } else { |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
200 out.printf("%s[%s]%n", linePrefix, typeName); |
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
201 } |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
202 for (String line : option.helpLines) { |
23787
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
203 out.printf("%" + PROPERTY_HELP_INDENT + "s%s%n", "", line); |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
204 } |
23306
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
205 } |
7b09dede4552
JVMCI options should not use System.getProperty() directly (JDK-8146820)
Doug Simon <doug.simon@oracle.com>
parents:
22779
diff
changeset
|
206 } |
22758
a130b51efb07
removed @Option mechanism from JVMCI (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
22697
diff
changeset
|
207 } |
a130b51efb07
removed @Option mechanism from JVMCI (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
22697
diff
changeset
|
208 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
209 public static HotSpotJVMCIBackendFactory findFactory(String architecture) { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
210 for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
211 if (factory.getArchitecture().equalsIgnoreCase(architecture)) { |
22429
a1b0a76567c7
Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
22422
diff
changeset
|
212 return factory; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
213 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
214 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
215 |
23392
b3a816d3b844
Backed out changeset: a920338dd4d4
Doug Simon <doug.simon@oracle.com>
parents:
23391
diff
changeset
|
216 throw new JVMCIError("No JVMCI runtime available for the %s architecture", architecture); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
217 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
218 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
219 /** |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
220 * Gets the kind of a word value on the {@linkplain #getHostJVMCIBackend() host} backend. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
221 */ |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22509
diff
changeset
|
222 public static JavaKind getHostWordKind() { |
22567
bfd5fdca1ce9
Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22562
diff
changeset
|
223 return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
224 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
225 |
22546
f95eb4e457af
made HotSpotJVMCIRuntime.compilerToVm final (GRAAL-1255)
Doug Simon <doug.simon@oracle.com>
parents:
22536
diff
changeset
|
226 protected final CompilerToVM compilerToVm; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
227 |
23679
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
228 protected final HotSpotVMConfigStore configStore; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
229 protected final HotSpotVMConfig config; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
230 private final JVMCIBackend hostBackend; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
231 |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
232 private final JVMCICompilerFactory compilerFactory; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
233 private final HotSpotJVMCICompilerFactory hsCompilerFactory; |
22697
57646377e480
Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents:
22694
diff
changeset
|
234 private volatile JVMCICompiler compiler; |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
235 protected final HotSpotJVMCIMetaAccessContext metaAccessContext; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
236 |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
237 /** |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
238 * Stores the result of {@link HotSpotJVMCICompilerFactory#getCompilationLevelAdjustment} so |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
239 * that it can be read from the VM. |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
240 */ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
241 @SuppressWarnings("unused") private final int compilationLevelAdjustment; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
242 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
243 private final Map<Class<? extends Architecture>, JVMCIBackend> backends = new HashMap<>(); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
244 |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
245 private volatile List<HotSpotVMEventListener> vmEventListeners; |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
246 |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
247 private Iterable<HotSpotVMEventListener> getVmEventListeners() { |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
248 if (vmEventListeners == null) { |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
249 synchronized (this) { |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
250 if (vmEventListeners == null) { |
23785
5cf445d2acf6
Exported elements referring to inaccessible types in jdk.vm.ci (JDK-8167180)
Doug Simon <doug.simon@oracle.com>
parents:
23783
diff
changeset
|
251 vmEventListeners = JVMCIServiceLocator.getProviders(HotSpotVMEventListener.class); |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
252 } |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
253 } |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
254 } |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
255 return vmEventListeners; |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
256 } |
21616
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
257 |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
258 /** |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
259 * Stores the result of {@link HotSpotJVMCICompilerFactory#getTrivialPrefixes()} so that it can |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
260 * be read from the VM. |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
261 */ |
22656
d634e615b00d
Lazily initialize compiler on first compilation request.
Roland Schatz <roland.schatz@oracle.com>
parents:
22634
diff
changeset
|
262 @SuppressWarnings("unused") private final String[] trivialPrefixes; |
22575
569c82ebb96e
Replace JVMCICompileWithC1Only with package based controls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22567
diff
changeset
|
263 |
22509
267eecd6d92a
suppressed -Xlint:try warnings
Doug Simon <doug.simon@oracle.com>
parents:
22486
diff
changeset
|
264 @SuppressWarnings("try") |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
265 private HotSpotJVMCIRuntime() { |
22547
10a9e989850e
made CompilertoVM a final concrete class and removed CompilerToVMImpl (GRAAL-1255)
Doug Simon <doug.simon@oracle.com>
parents:
22546
diff
changeset
|
266 compilerToVm = new CompilerToVM(); |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
267 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
268 try (InitTimer t = timer("HotSpotVMConfig<init>")) { |
23679
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
269 configStore = new HotSpotVMConfigStore(compilerToVm); |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
270 config = new HotSpotVMConfig(configStore); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
271 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
272 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
273 String hostArchitecture = config.getHostArchitectureName(); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
274 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
275 HotSpotJVMCIBackendFactory factory; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
276 try (InitTimer t = timer("find factory:", hostArchitecture)) { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
277 factory = findFactory(hostArchitecture); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
278 } |
22429
a1b0a76567c7
Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
22422
diff
changeset
|
279 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
280 try (InitTimer t = timer("create JVMCI backend:", hostArchitecture)) { |
22613
9409f7cec59a
Remove dependency from HotSpotJVMCIRuntime to CompilerFactory.
Roland Schatz <roland.schatz@oracle.com>
parents:
22593
diff
changeset
|
281 hostBackend = registerBackend(factory.createJVMCIBackend(this, null)); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
282 } |
21616
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
283 |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23392
diff
changeset
|
284 metaAccessContext = new HotSpotJVMCIMetaAccessContext(); |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
285 |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
286 compilerFactory = HotSpotJVMCICompilerConfig.getCompilerFactory(); |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
287 if (compilerFactory instanceof HotSpotJVMCICompilerFactory) { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
288 hsCompilerFactory = (HotSpotJVMCICompilerFactory) compilerFactory; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
289 trivialPrefixes = hsCompilerFactory.getTrivialPrefixes(); |
23679
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
290 switch (hsCompilerFactory.getCompilationLevelAdjustment()) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
291 case None: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
292 compilationLevelAdjustment = config.compLevelAdjustmentNone; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
293 break; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
294 case ByHolder: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
295 compilationLevelAdjustment = config.compLevelAdjustmentByHolder; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
296 break; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
297 case ByFullSignature: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
298 compilationLevelAdjustment = config.compLevelAdjustmentByFullSignature; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
299 break; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
300 default: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
301 compilationLevelAdjustment = config.compLevelAdjustmentNone; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
302 break; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
303 } |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
304 } else { |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
305 hsCompilerFactory = null; |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
306 trivialPrefixes = null; |
23679
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
307 compilationLevelAdjustment = config.compLevelAdjustmentNone; |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
308 } |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
309 |
23783
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
310 if (config.getFlag("JVMCIPrintProperties", Boolean.class)) { |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
311 PrintStream out = new PrintStream(getLogStream()); |
23783
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
312 Option.printProperties(out); |
1523f2f7832f
renamed JVMCIPrintSystemProperties to JVMCIPrintProperties
Doug Simon <doug.simon@oracle.com>
parents:
23781
diff
changeset
|
313 compilerFactory.printProperties(out); |
23787
fcffda51e6fe
-XX:+JVMCIPrintProperties should exit after printing (JDK-8168295)
Doug Simon <doug.simon@oracle.com>
parents:
23785
diff
changeset
|
314 System.exit(0); |
23777
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
315 } |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
316 |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
317 if (Option.PrintConfig.getBoolean()) { |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
318 printConfig(configStore, compilerToVm); |
6c8eaf47db9a
added -XX:+JVMCIPrintFlags to support printing of JVMCI flags without having to know how to trigger JVMCI initialization
Doug Simon <doug.simon@oracle.com>
parents:
23740
diff
changeset
|
319 } |
22422
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
320 } |
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
321 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
322 private JVMCIBackend registerBackend(JVMCIBackend backend) { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
323 Class<? extends Architecture> arch = backend.getCodeCache().getTarget().arch.getClass(); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
324 JVMCIBackend oldValue = backends.put(arch, backend); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
325 assert oldValue == null : "cannot overwrite existing backend for architecture " + arch.getSimpleName(); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
326 return backend; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
327 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
328 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
329 public ResolvedJavaType fromClass(Class<?> javaClass) { |
22422
a98a02bad801
Add simple interface to control caching policy for ResolvedJavaTypes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
330 return metaAccessContext.fromClass(javaClass); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
331 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
332 |
23679
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
333 public HotSpotVMConfigStore getConfigStore() { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
334 return configStore; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
335 } |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
336 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
337 public HotSpotVMConfig getConfig() { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
338 return config; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
339 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
340 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
341 public CompilerToVM getCompilerToVM() { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
342 return compilerToVm; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
343 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
344 |
22697
57646377e480
Rename Compiler to JVMCICompiler and expose it from JVMCIRuntime.
Roland Schatz <roland.schatz@oracle.com>
parents:
22694
diff
changeset
|
345 public JVMCICompiler getCompiler() { |
22656
d634e615b00d
Lazily initialize compiler on first compilation request.
Roland Schatz <roland.schatz@oracle.com>
parents:
22634
diff
changeset
|
346 if (compiler == null) { |
22657
9203f93ffeb0
Fix race condition in lazy compiler initialization.
Roland Schatz <roland.schatz@oracle.com>
parents:
22656
diff
changeset
|
347 synchronized (this) { |
9203f93ffeb0
Fix race condition in lazy compiler initialization.
Roland Schatz <roland.schatz@oracle.com>
parents:
22656
diff
changeset
|
348 if (compiler == null) { |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
349 compiler = compilerFactory.createCompiler(this); |
22657
9203f93ffeb0
Fix race condition in lazy compiler initialization.
Roland Schatz <roland.schatz@oracle.com>
parents:
22656
diff
changeset
|
350 } |
9203f93ffeb0
Fix race condition in lazy compiler initialization.
Roland Schatz <roland.schatz@oracle.com>
parents:
22656
diff
changeset
|
351 } |
22656
d634e615b00d
Lazily initialize compiler on first compilation request.
Roland Schatz <roland.schatz@oracle.com>
parents:
22634
diff
changeset
|
352 } |
22429
a1b0a76567c7
Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
22422
diff
changeset
|
353 return compiler; |
a1b0a76567c7
Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
22422
diff
changeset
|
354 } |
a1b0a76567c7
Select default compiler from jvmci.compiler system property.
Roland Schatz <roland.schatz@oracle.com>
parents:
22422
diff
changeset
|
355 |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
356 public JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve) { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
357 Objects.requireNonNull(accessingType, "cannot resolve type without an accessing class"); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
358 // If the name represents a primitive type we can short-circuit the lookup. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
359 if (name.length() == 1) { |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22509
diff
changeset
|
360 JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0)); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
361 return fromClass(kind.toJavaClass()); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
362 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
363 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
364 // Resolve non-primitive types in the VM. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
365 HotSpotResolvedObjectTypeImpl hsAccessingType = (HotSpotResolvedObjectTypeImpl) accessingType; |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22429
diff
changeset
|
366 final HotSpotResolvedObjectTypeImpl klass = compilerToVm.lookupType(name, hsAccessingType.mirror(), resolve); |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
367 |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22429
diff
changeset
|
368 if (klass == null) { |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
369 assert resolve == false; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
370 return HotSpotUnresolvedJavaType.create(this, name); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
371 } |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22429
diff
changeset
|
372 return klass; |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
373 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
374 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
375 public JVMCIBackend getHostJVMCIBackend() { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
376 return hostBackend; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
377 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
378 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
379 public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch) { |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
380 assert arch != Architecture.class; |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
381 return backends.get(arch); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
382 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
383 |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
384 public Map<Class<? extends Architecture>, JVMCIBackend> getJVMCIBackends() { |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
385 return Collections.unmodifiableMap(backends); |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
386 } |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
387 |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
388 /** |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
389 * Called from the VM. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
390 */ |
21616
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
391 @SuppressWarnings({"unused"}) |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
392 private int adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, int level) { |
23679
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
393 CompilationLevel curLevel; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
394 if (level == config.compilationLevelNone) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
395 curLevel = CompilationLevel.None; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
396 } else if (level == config.compilationLevelSimple) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
397 curLevel = CompilationLevel.Simple; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
398 } else if (level == config.compilationLevelLimitedProfile) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
399 curLevel = CompilationLevel.LimitedProfile; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
400 } else if (level == config.compilationLevelFullProfile) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
401 curLevel = CompilationLevel.FullProfile; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
402 } else if (level == config.compilationLevelFullOptimization) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
403 curLevel = CompilationLevel.FullOptimization; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
404 } else { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
405 throw JVMCIError.shouldNotReachHere(); |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
406 } |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
407 |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
408 switch (hsCompilerFactory.adjustCompilationLevel(declaringClass, name, signature, isOsr, curLevel)) { |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
409 case None: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
410 return config.compilationLevelNone; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
411 case Simple: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
412 return config.compilationLevelSimple; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
413 case LimitedProfile: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
414 return config.compilationLevelLimitedProfile; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
415 case FullProfile: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
416 return config.compilationLevelFullProfile; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
417 case FullOptimization: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
418 return config.compilationLevelFullOptimization; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
419 default: |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
420 return level; |
b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
Doug Simon <doug.simon@oracle.com>
parents:
23394
diff
changeset
|
421 } |
23379
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
422 } |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
423 |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
424 /** |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
425 * Called from the VM. |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
426 */ |
24505bf61633
allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
Doug Simon <doug.simon@oracle.com>
parents:
23363
diff
changeset
|
427 @SuppressWarnings({"unused"}) |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
428 private HotSpotCompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { |
22779
b41377216cf9
JVMCICompiler.compileMethod should always return non-null
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22773
diff
changeset
|
429 CompilationRequestResult result = getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id)); |
b41377216cf9
JVMCICompiler.compileMethod should always return non-null
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22773
diff
changeset
|
430 assert result != null : "compileMethod must always return something"; |
23394
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
431 HotSpotCompilationRequestResult hsResult; |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
432 if (result instanceof HotSpotCompilationRequestResult) { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
433 hsResult = (HotSpotCompilationRequestResult) result; |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
434 } else { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
435 Object failure = result.getFailure(); |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
436 if (failure != null) { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
437 boolean retry = false; // Be conservative with unknown compiler |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
438 hsResult = HotSpotCompilationRequestResult.failure(failure.toString(), retry); |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
439 } else { |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
440 int inlinedBytecodes = -1; |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
441 hsResult = HotSpotCompilationRequestResult.success(inlinedBytecodes); |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
442 } |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
443 } |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
444 |
7743f81f8c4a
clean up and minimize JVMCI (JDK-8156835) - part 2
Doug Simon <doug.simon@oracle.com>
parents:
23393
diff
changeset
|
445 return hsResult; |
21616
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
446 } |
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
447 |
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
448 /** |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
449 * Shuts down the runtime. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
450 * |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
451 * Called from the VM. |
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
452 */ |
21616
4c146c9367b6
recast VM compilation request via JVMCI to be a HotSpot JVMCI event, removing the last direct reference to a Graal class in the VM (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
453 @SuppressWarnings({"unused"}) |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
454 private void shutdown() throws Exception { |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
455 for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) { |
21780
3d15183f3c93
Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21675
diff
changeset
|
456 vmEventListener.notifyShutdown(); |
3d15183f3c93
Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21675
diff
changeset
|
457 } |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
458 } |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
459 |
22593
cabc2b8bc3f1
Make HotSpotCodeCacheProvider.installMethod throw an exception if code installation fails
twisti
parents:
22581
diff
changeset
|
460 /** |
23383
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
461 * Notify on completion of a bootstrap. |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
462 * |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
463 * Called from the VM. |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
464 */ |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
465 @SuppressWarnings({"unused"}) |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
466 private void bootstrapFinished() throws Exception { |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
467 for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) { |
23383
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
468 vmEventListener.notifyBootstrapFinished(); |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
469 } |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
470 } |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
471 |
0226d6bcb0d2
Notify the compiler on completion of a bootstrap (JDK-8156034)
Josef Eisl <josef.eisl@jku.at>
parents:
23379
diff
changeset
|
472 /** |
22593
cabc2b8bc3f1
Make HotSpotCodeCacheProvider.installMethod throw an exception if code installation fails
twisti
parents:
22581
diff
changeset
|
473 * Notify on successful install into the CodeCache. |
cabc2b8bc3f1
Make HotSpotCodeCacheProvider.installMethod throw an exception if code installation fails
twisti
parents:
22581
diff
changeset
|
474 * |
cabc2b8bc3f1
Make HotSpotCodeCacheProvider.installMethod throw an exception if code installation fails
twisti
parents:
22581
diff
changeset
|
475 * @param hotSpotCodeCacheProvider |
cabc2b8bc3f1
Make HotSpotCodeCacheProvider.installMethod throw an exception if code installation fails
twisti
parents:
22581
diff
changeset
|
476 * @param installedCode |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22770
diff
changeset
|
477 * @param compiledCode |
22593
cabc2b8bc3f1
Make HotSpotCodeCacheProvider.installMethod throw an exception if code installation fails
twisti
parents:
22581
diff
changeset
|
478 */ |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22770
diff
changeset
|
479 void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) { |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
480 for (HotSpotVMEventListener vmEventListener : getVmEventListeners()) { |
22773
9273bb6ba33e
Simplify code installation interface: Use CompiledCode class instead of CompilationResult and DataSection.
Roland Schatz <roland.schatz@oracle.com>
parents:
22770
diff
changeset
|
481 vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compiledCode); |
22299
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
482 } |
7b4a47fcc4c0
Move most of jdk.internal.jvmci.debug back into com.oracle.graal.debug
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
483 } |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
484 |
23700
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
485 @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING", justification = "no localization here please!") |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
486 private static void printConfigLine(CompilerToVM vm, String format, Object... args) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
487 String line = String.format(format, args); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
488 byte[] lineBytes = line.getBytes(); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
489 vm.writeDebugOutput(lineBytes, 0, lineBytes.length); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
490 vm.flushDebugOutput(); |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
491 } |
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
492 |
23700
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
493 private static void printConfig(HotSpotVMConfigStore store, CompilerToVM vm) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
494 TreeMap<String, VMField> fields = new TreeMap<>(store.getFields()); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
495 for (VMField field : fields.values()) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
496 if (!field.isStatic()) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
497 printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
498 } else { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
499 String value = field.value == null ? "null" : String.format("%d[0x%x]", field.value, field.value); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
500 printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address); |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
501 } |
23700
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
502 } |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
503 TreeMap<String, VMFlag> flags = new TreeMap<>(store.getFlags()); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
504 for (VMFlag flag : flags.values()) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
505 printConfigLine(vm, "[vmconfig:flag] %s %s = %s%n", flag.type, flag.name, flag.value); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
506 } |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
507 TreeMap<String, Long> addresses = new TreeMap<>(store.getAddresses()); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
508 for (Map.Entry<String, Long> e : addresses.entrySet()) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
509 printConfigLine(vm, "[vmconfig:address] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
510 } |
23700
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
511 TreeMap<String, Long> constants = new TreeMap<>(store.getConstants()); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
512 for (Map.Entry<String, Long> e : constants.entrySet()) { |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
513 printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); |
9e1235406b59
[Findbugs] various warnings reported for JVMCI sources (JDK-8159613)
Doug Simon <doug.simon@oracle.com>
parents:
23679
diff
changeset
|
514 } |
23740
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
515 for (VMIntrinsicMethod e : store.getIntrinsics()) { |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
516 printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor); |
724fbad94ee3
expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI compilers (JDK-8164358)
Doug Simon <doug.simon@oracle.com>
parents:
23721
diff
changeset
|
517 } |
22562
28fe5850735e
removed HotSpotVMEventListener.completeInitialization; moved implementation of -Djvmci.printconfig=true to JVMCI; moved javadoc to method from static initializer
Doug Simon <doug.simon@oracle.com>
parents:
22550
diff
changeset
|
518 } |
22626
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
519 |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
520 public OutputStream getLogStream() { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
521 return new OutputStream() { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
522 |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
523 @Override |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
524 public void write(byte[] b, int off, int len) throws IOException { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
525 if (b == null) { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
526 throw new NullPointerException(); |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
527 } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
528 throw new IndexOutOfBoundsException(); |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
529 } else if (len == 0) { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
530 return; |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
531 } |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
532 compilerToVm.writeDebugOutput(b, off, len); |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
533 } |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
534 |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
535 @Override |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
536 public void write(int b) throws IOException { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
537 write(new byte[]{(byte) b}, 0, 1); |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
538 } |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
539 |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
540 @Override |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
541 public void flush() throws IOException { |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
542 compilerToVm.flushDebugOutput(); |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
543 } |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
544 }; |
b6b46b741102
added HotSpotJVMCIRuntimeProvider.getLogStream() and made CompilerToVM.writeDebugOutput and CompilerToVm.flushDebugOutput package-private
Doug Simon <doug.simon@oracle.com>
parents:
22623
diff
changeset
|
545 } |
22634
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
546 |
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
547 /** |
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
548 * Collects the current values of all JVMCI benchmark counters, summed up over all threads. |
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
549 */ |
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
550 public long[] collectCounters() { |
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
551 return compilerToVm.collectCounters(); |
02d95720c455
added HotSpotJVMCIRuntimeProvider.collectCounters and made CompilerToVM.collectCounters package-private
Doug Simon <doug.simon@oracle.com>
parents:
22626
diff
changeset
|
552 } |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
553 } |