annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java @ 8150:b66f831ac5ab

Fix CFG printer output. Clean up after making the compiler class all-static.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Mar 2013 15:17:51 +0100
parents a202f72872a4
children 488a5f694786
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
4181
319860ae697a Simplify FrameMap: make offsets of spill slots and outgoing parameters independent so that they can be allocated at the same time, eliminating the separate phases. This makes the separate StackBlock unnecesary. Change CiStackSlot to use byte offsets instead of spill slot index. This makes CiTarget.spillSlotSize unnecessary.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.hotspot;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
7784
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7714
diff changeset
25 import static com.oracle.graal.graph.UnsafeAccess.*;
7037
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
26
5186
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
27 import java.lang.reflect.*;
7156
29ee920b35dd make the output produced by -Dgraal.printconfig=true sorted
Doug Simon <doug.simon@oracle.com>
parents: 7152
diff changeset
28 import java.util.*;
6462
b3f5dc099f9d removed XIR
Doug Simon <doug.simon@oracle.com>
parents: 6404
diff changeset
29
5510
426c605c9d3c Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
30 import com.oracle.graal.api.code.*;
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5503
diff changeset
31 import com.oracle.graal.api.meta.*;
6540
31aa76ffd3bb Rename project graal.api to graal.api.runtime
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6525
diff changeset
32 import com.oracle.graal.api.runtime.*;
7836
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
33 import com.oracle.graal.compiler.target.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
34 import com.oracle.graal.hotspot.bridge.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
35 import com.oracle.graal.hotspot.logging.*;
5548
8872bc0eebdf Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5547
diff changeset
36 import com.oracle.graal.hotspot.meta.*;
5720
46ad94a0574a moved everything from com.oracle.graal.nodes.cri into com.oracle.graal.nodes.spi
Doug Simon <doug.simon@oracle.com>
parents: 5718
diff changeset
37 import com.oracle.graal.nodes.spi.*;
6525
2c913b643422 rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
38 import com.oracle.graal.phases.*;
7220
fcae6d960acd added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7098
diff changeset
39 import com.oracle.graal.snippets.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 /**
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
42 * Singleton class holding the instance of the {@link GraalRuntime}.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
43 *
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
44 * The platform specific subclass is created by a call from the C++ HotSpot code.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 */
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
46 public abstract class HotSpotGraalRuntime implements GraalRuntime {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
48 private static HotSpotGraalRuntime instance;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
50 /**
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
51 * Gets the singleton runtime instance object.
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
52 */
5534
e0f7a49129f2 Renamed HotSpotCompilerImpl => HotSpotGraalRuntime.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5533
diff changeset
53 public static HotSpotGraalRuntime getInstance() {
5532
82f2bb47c97e Clean up on HotSpotCompilerImpl class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5526
diff changeset
54 return instance;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
57 /**
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
58 * Called by the platform specific class exactly once to register the singleton instance.
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
59 */
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
60 protected static void setInstance(HotSpotGraalRuntime runtime) {
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
61 assert instance == null : "runtime already registered";
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
62 instance = runtime;
7152
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
63
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
64 // Do deferred initialization
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
65
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
66 // Proxies for the VM/Compiler interfaces cannot be initialized
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
67 // in the constructor as proxy creation causes static
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
68 // initializers to be executed for all the types involved in the
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
69 // proxied methods. Some of these static initializers (e.g. in
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
70 // HotSpotMethodData) rely on the above instance field being set
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
71 // to retrieve config details.
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
72 VMToCompiler toCompiler = runtime.vmToCompiler;
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
73 CompilerToVM toVM = runtime.compilerToVm;
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
74
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
75 if (CountingProxy.ENABLED) {
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
76 toCompiler = CountingProxy.getProxy(VMToCompiler.class, toCompiler);
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
77 toVM = CountingProxy.getProxy(CompilerToVM.class, toVM);
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
78 }
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
79 if (Logger.ENABLED) {
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
80 toCompiler = LoggingProxy.getProxy(VMToCompiler.class, toCompiler);
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
81 toVM = LoggingProxy.getProxy(CompilerToVM.class, toVM);
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
82 }
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
83
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
84 runtime.vmToCompiler = toCompiler;
e86ac899c5be fixed issues triggered when using the CountingProxy (i.e., -Dgraal.countcalls=true) or LoggingProxy (i.e., -Dgraal.debug=true) to analyze traffic across the VM/compiler boundary
Doug Simon <doug.simon@oracle.com>
parents: 7098
diff changeset
85 runtime.compilerToVm = toVM;
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
86 }
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
87
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
88 private static Kind wordKind;
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
89
6954
0e20ad1ea98b removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
90 /**
0e20ad1ea98b removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
91 * Gets the kind of a word value.
0e20ad1ea98b removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents: 6950
diff changeset
92 */
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
93 public static Kind wordKind() {
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
94 assert wordKind != null;
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
95 return wordKind;
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
96 }
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
97
7037
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
98 /**
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
99 * Reads a word value from a given address.
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
100 */
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
101 public static long unsafeReadWord(long address) {
7098
e23980f4a890 Cleanup of Kind class: remove isXxx methods
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7084
diff changeset
102 if (wordKind == Kind.Long) {
7037
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
103 return unsafe.getLong(address);
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
104 }
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
105 return unsafe.getInt(address);
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
106 }
dd81042f4eb1 added unit tests for ResolvedJavaType
Doug Simon <doug.simon@oracle.com>
parents: 7034
diff changeset
107
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
108 protected/* final */CompilerToVM compilerToVm;
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
109 protected/* final */VMToCompiler vmToCompiler;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
110
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
111 protected final HotSpotRuntime runtime;
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
112 protected final TargetDescription target;
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
113
5747
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
114 private HotSpotRuntimeInterpreterInterface runtimeInterpreterInterface;
5308
820fce52a244 moved GraphCache to platform specific part, solved class unloading problem
Lukas Stadler <lukas.stadler@jku.at>
parents: 5292
diff changeset
115 private volatile HotSpotGraphCache cache;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
117 protected final HotSpotVMConfig config;
7836
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
118 private final HotSpotBackend backend;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
119
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
120 protected HotSpotGraalRuntime() {
5532
82f2bb47c97e Clean up on HotSpotCompilerImpl class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5526
diff changeset
121 CompilerToVM toVM = new CompilerToVMImpl();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122
5289
6519cf82d390 remove on more vmExits instance
Lukas Stadler <lukas.stadler@jku.at>
parents: 5278
diff changeset
123 // initialize VmToCompiler
6519cf82d390 remove on more vmExits instance
Lukas Stadler <lukas.stadler@jku.at>
parents: 5278
diff changeset
124 VMToCompiler toCompiler = new VMToCompilerImpl(this);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125
5278
74dfa6f86879 removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents: 5233
diff changeset
126 compilerToVm = toVM;
5289
6519cf82d390 remove on more vmExits instance
Lukas Stadler <lukas.stadler@jku.at>
parents: 5278
diff changeset
127 vmToCompiler = toCompiler;
6363
a73fcf1639fc HotSpotVMConfig object is now allocated in Java
Doug Simon <doug.simon@oracle.com>
parents: 5848
diff changeset
128 config = new HotSpotVMConfig();
a73fcf1639fc HotSpotVMConfig object is now allocated in Java
Doug Simon <doug.simon@oracle.com>
parents: 5848
diff changeset
129 compilerToVm.initializeConfiguration(config);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130 config.check();
5186
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
131
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
132 if (Boolean.valueOf(System.getProperty("graal.printconfig"))) {
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
133 printConfig(config);
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
134 }
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
135
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
136 target = createTarget();
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
137 assert wordKind == null || wordKind.equals(target.wordKind);
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
138 wordKind = target.wordKind;
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6505
diff changeset
139
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
140 runtime = createRuntime();
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
141
7836
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
142 backend = createBackend();
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
143 GraalOptions.StackShadowPages = config.stackShadowPages;
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
144 if (GraalOptions.CacheGraphs) {
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
145 cache = new HotSpotGraphCache();
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
146 }
5186
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
147 }
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
148
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
149 private static void printConfig(HotSpotVMConfig config) {
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
150 Field[] fields = config.getClass().getDeclaredFields();
7156
29ee920b35dd make the output produced by -Dgraal.printconfig=true sorted
Doug Simon <doug.simon@oracle.com>
parents: 7152
diff changeset
151 Map<String, Field> sortedFields = new TreeMap<>();
5186
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
152 for (Field f : fields) {
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
153 f.setAccessible(true);
7156
29ee920b35dd make the output produced by -Dgraal.printconfig=true sorted
Doug Simon <doug.simon@oracle.com>
parents: 7152
diff changeset
154 sortedFields.put(f.getName(), f);
29ee920b35dd make the output produced by -Dgraal.printconfig=true sorted
Doug Simon <doug.simon@oracle.com>
parents: 7152
diff changeset
155 }
29ee920b35dd make the output produced by -Dgraal.printconfig=true sorted
Doug Simon <doug.simon@oracle.com>
parents: 7152
diff changeset
156 for (Field f : sortedFields.values()) {
5186
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
157 try {
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
158 Logger.info(String.format("%9s %-40s = %s", f.getType().getSimpleName(), f.getName(), Logger.pretty(f.get(config))));
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
159 } catch (Exception e) {
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
160 }
b00e56aa159d added printing of HotSpot config if graal.printconfig system property is true
Doug Simon <doug.simon@oracle.com>
parents: 5177
diff changeset
161 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
162 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
164 protected abstract TargetDescription createTarget();
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
165
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
166 protected abstract HotSpotBackend createBackend();
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
167
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
168 protected abstract HotSpotRuntime createRuntime();
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
169
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
170 public HotSpotVMConfig getConfig() {
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
171 return config;
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
172 }
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
173
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
174 public TargetDescription getTarget() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
175 return target;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
176 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
177
5308
820fce52a244 moved GraphCache to platform specific part, solved class unloading problem
Lukas Stadler <lukas.stadler@jku.at>
parents: 5292
diff changeset
178 public HotSpotGraphCache getCache() {
5177
a26b6248d398 added graph caching (-G:+CacheGraphs)
Lukas Stadler <lukas.stadler@jku.at>
parents: 5061
diff changeset
179 return cache;
a26b6248d398 added graph caching (-G:+CacheGraphs)
Lukas Stadler <lukas.stadler@jku.at>
parents: 5061
diff changeset
180 }
a26b6248d398 added graph caching (-G:+CacheGraphs)
Lukas Stadler <lukas.stadler@jku.at>
parents: 5061
diff changeset
181
5278
74dfa6f86879 removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents: 5233
diff changeset
182 public CompilerToVM getCompilerToVM() {
74dfa6f86879 removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents: 5233
diff changeset
183 return compilerToVm;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
184 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
185
5278
74dfa6f86879 removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents: 5233
diff changeset
186 public VMToCompiler getVMToCompiler() {
74dfa6f86879 removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents: 5233
diff changeset
187 return vmToCompiler;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
188 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
189
7084
9ba90252ce08 HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7037
diff changeset
190 public JavaType lookupType(String name, HotSpotResolvedObjectType accessingClass, boolean eagerResolve) {
6588
b89b5038ad7e removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 6543
diff changeset
191 if (name.length() == 1 && vmToCompiler instanceof VMToCompilerImpl) {
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
192 VMToCompilerImpl impl = (VMToCompilerImpl) vmToCompiler;
6588
b89b5038ad7e removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 6543
diff changeset
193 Kind kind = Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7226
diff changeset
194 switch (kind) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
195 case Boolean:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
196 return impl.typeBoolean;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
197 case Byte:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
198 return impl.typeByte;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
199 case Char:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
200 return impl.typeChar;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
201 case Double:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
202 return impl.typeDouble;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
203 case Float:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
204 return impl.typeFloat;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 case Illegal:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 break;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207 case Int:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
208 return impl.typeInt;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209 case Long:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
210 return impl.typeLong;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 case Object:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 break;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213 case Short:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
214 return impl.typeShort;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215 case Void:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
216 return impl.typeVoid;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
217 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
218 }
6588
b89b5038ad7e removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 6543
diff changeset
219 return compilerToVm.lookupType(name, accessingClass, eagerResolve);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
221
5747
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
222 public HotSpotRuntimeInterpreterInterface getRuntimeInterpreterInterface() {
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
223 if (runtimeInterpreterInterface == null) {
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
224 runtimeInterpreterInterface = new HotSpotRuntimeInterpreterInterface(getRuntime());
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
225 }
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
226 return runtimeInterpreterInterface;
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
227 }
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5720
diff changeset
228
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
229 public HotSpotRuntime getRuntime() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
230 return runtime;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
231 }
5292
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
232
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
233 public void evictDeoptedGraphs() {
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
234 if (cache != null) {
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
235 long[] deoptedGraphs = getCompilerToVM().getDeoptedLeafGraphIds();
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
236 if (deoptedGraphs != null) {
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
237 if (deoptedGraphs.length == 0) {
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
238 cache.clear();
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
239 } else {
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
240 cache.removeGraphs(deoptedGraphs);
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
241 }
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
242 }
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
243 }
796917d3bfc9 move cached graph eviction out of GraalCompiler
Lukas Stadler <lukas.stadler@jku.at>
parents: 5289
diff changeset
244 }
5526
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
245
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
246 @Override
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
247 public String getName() {
6505
1ecf984d490c fixed an ordering issue in the initialization and retrieval of the platform specific HotSpotGraalRuntime instance
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
248 return getClass().getSimpleName();
5526
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
249 }
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
250
5533
c5c13f3ed5c4 Remove GraalAccess class, replace usages new GraalVM API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5532
diff changeset
251 @SuppressWarnings("unchecked")
5526
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
252 @Override
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
253 public <T> T getCapability(Class<T> clazz) {
7714
6f02b7e3360b add CodeCacheProvider to HotSpotGraalRuntime.getCapability
Roland Schatz <roland.schatz@oracle.com>
parents: 7688
diff changeset
254 if (clazz == GraalCodeCacheProvider.class || clazz == CodeCacheProvider.class || clazz == MetaAccessProvider.class || clazz == SnippetProvider.class) {
5533
c5c13f3ed5c4 Remove GraalAccess class, replace usages new GraalVM API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5532
diff changeset
255 return (T) getRuntime();
c5c13f3ed5c4 Remove GraalAccess class, replace usages new GraalVM API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5532
diff changeset
256 }
7784
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7714
diff changeset
257 if (clazz == DisassemblerProvider.class || clazz == BytecodeDisassemblerProvider.class) {
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7714
diff changeset
258 return (T) getRuntime();
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7714
diff changeset
259 }
7835
72971ec0d7ae Remove usage of GraalCompiler.target field.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7816
diff changeset
260 if (clazz == HotSpotRuntime.class) {
72971ec0d7ae Remove usage of GraalCompiler.target field.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7816
diff changeset
261 return (T) runtime;
72971ec0d7ae Remove usage of GraalCompiler.target field.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7816
diff changeset
262 }
7836
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
263 if (clazz == Backend.class) {
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
264 return (T) getBackend();
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
265 }
5526
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
266 return null;
87e4aed94b26 Remove HotSpotCompiler interface, let HotSpotCompilerImpl implement GraalRuntime (in preparation of renaming).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5514
diff changeset
267 }
7836
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
268
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
269 public HotSpotBackend getBackend() {
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
270 return backend;
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
271 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
272 }