Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java @ 7001:46bec43bdfc3
fixed bug causing tomcat to crash: an UnsafeLoadNode must be pinned to its block when lowered
This is now necessary since UnsafeLoadNode no longer includes a null check (as per the sun.misc.Unsafe API)
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 21 Nov 2012 23:36:06 +0100 |
parents | eec373d34caf |
children | 62818f156081 7d815d842ee0 |
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 */ |
5548
8872bc0eebdf
Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
23 package com.oracle.graal.hotspot.meta; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
25 import static com.oracle.graal.api.code.DeoptimizationAction.*; |
6498
6bc8aa568cb9
moved MemoryBarriers to com.oracle.graal.api.code
Doug Simon <doug.simon@oracle.com>
parents:
6494
diff
changeset
|
26 import static com.oracle.graal.api.code.MemoryBarriers.*; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
27 import static com.oracle.graal.api.meta.DeoptimizationReason.*; |
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:
6500
diff
changeset
|
28 import static com.oracle.graal.api.meta.Value.*; |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
29 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; |
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:
6500
diff
changeset
|
30 import static com.oracle.graal.hotspot.snippets.SystemSnippets.*; |
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:
6500
diff
changeset
|
31 import static com.oracle.graal.java.GraphBuilderPhase.*; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
32 import static com.oracle.graal.nodes.StructuredGraph.*; |
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:
6500
diff
changeset
|
33 import static com.oracle.graal.nodes.UnwindNode.*; |
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:
6500
diff
changeset
|
34 import static com.oracle.graal.nodes.java.RegisterFinalizerNode.*; |
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:
6500
diff
changeset
|
35 import static com.oracle.graal.snippets.Log.*; |
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:
6500
diff
changeset
|
36 import static com.oracle.graal.snippets.MathSnippetsX86.*; |
5167
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
37 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 import java.lang.reflect.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
39 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
41 import com.oracle.graal.api.code.*; |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
42 import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
43 import com.oracle.graal.api.code.CompilationResult.Call; |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
44 import com.oracle.graal.api.code.CompilationResult.DataPatch; |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
45 import com.oracle.graal.api.code.CompilationResult.Mark; |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
46 import com.oracle.graal.api.code.CompilationResult.Safepoint; |
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:
6500
diff
changeset
|
47 import com.oracle.graal.api.code.Register.RegisterFlag; |
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:
6500
diff
changeset
|
48 import com.oracle.graal.api.code.RuntimeCall.Descriptor; |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5506
diff
changeset
|
49 import com.oracle.graal.api.meta.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
50 import com.oracle.graal.graph.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
51 import com.oracle.graal.hotspot.*; |
6462 | 52 import com.oracle.graal.hotspot.bridge.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
53 import com.oracle.graal.hotspot.nodes.*; |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
54 import com.oracle.graal.hotspot.phases.*; |
5379
c862951e769d
moved checkcast lowering into LoweringPhase and added -G:HIRLowerCheckcast option to enable it (disabled by default) as it is not yet stable
Doug Simon <doug.simon@oracle.com>
parents:
5372
diff
changeset
|
55 import com.oracle.graal.hotspot.snippets.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
56 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
57 import com.oracle.graal.nodes.calc.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
58 import com.oracle.graal.nodes.extended.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
59 import com.oracle.graal.nodes.java.*; |
5829
0095a9c235c6
incomplete (non XIR) support for inlining virtual dispatch at call sites - all design questions yet to be addressed
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
60 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; |
5720
46ad94a0574a
moved everything from com.oracle.graal.nodes.cri into com.oracle.graal.nodes.spi
Doug Simon <doug.simon@oracle.com>
parents:
5719
diff
changeset
|
61 import com.oracle.graal.nodes.spi.*; |
5076
01ffb0fc9aec
propagate stamps while lowering
Lukas Stadler <lukas.stadler@jku.at>
parents:
5067
diff
changeset
|
62 import com.oracle.graal.nodes.type.*; |
6525
2c913b643422
rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
63 import com.oracle.graal.phases.*; |
6699
d79098b9db3b
Support for interfaces in the Graal API: Make interfaces implemented by a ResolvedJavaType available; change semantics of ResolvedJavaType.getSuperclass to return null for interfaces (to conform with java.lang.Class); change semantics of ResolvedJavaType.isInstanceClass to return false for interfaces.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6686
diff
changeset
|
64 import com.oracle.graal.printer.*; |
5379
c862951e769d
moved checkcast lowering into LoweringPhase and added -G:HIRLowerCheckcast option to enable it (disabled by default) as it is not yet stable
Doug Simon <doug.simon@oracle.com>
parents:
5372
diff
changeset
|
65 import com.oracle.graal.snippets.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
66 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 /** |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
68 * HotSpot implementation of {@link GraalCodeCacheProvider}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 */ |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
70 public abstract class HotSpotRuntime implements GraalCodeCacheProvider { |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
71 public final HotSpotVMConfig config; |
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:
6500
diff
changeset
|
72 |
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:
6500
diff
changeset
|
73 protected final RegisterConfig regConfig; |
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:
6500
diff
changeset
|
74 protected final RegisterConfig globalStubRegConfig; |
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:
6500
diff
changeset
|
75 protected final HotSpotGraalRuntime graalRuntime; |
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:
6500
diff
changeset
|
76 |
5563
6a2671066204
added NewInstanceSnippets for lowering NewInstanceNodes (currently disabled by default)
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
77 private CheckCastSnippets.Templates checkcastSnippets; |
6302
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5842
diff
changeset
|
78 private InstanceOfSnippets.Templates instanceofSnippets; |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
79 private NewObjectSnippets.Templates newObjectSnippets; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
80 private MonitorSnippets.Templates monitorSnippets; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 |
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:
6500
diff
changeset
|
82 private final Map<Descriptor, RuntimeCall> runtimeCalls = new HashMap<>(); |
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:
6500
diff
changeset
|
83 |
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:
6500
diff
changeset
|
84 protected Value ret(Kind kind) { |
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:
6500
diff
changeset
|
85 if (kind.isVoid()) { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
86 return ILLEGAL; |
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:
6500
diff
changeset
|
87 } |
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:
6500
diff
changeset
|
88 return globalStubRegConfig.getReturnRegister(kind).asValue(kind); |
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:
6500
diff
changeset
|
89 } |
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:
6500
diff
changeset
|
90 |
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:
6500
diff
changeset
|
91 protected Value arg(int index, Kind kind) { |
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:
6500
diff
changeset
|
92 if (kind.isFloat() || kind.isDouble()) { |
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:
6500
diff
changeset
|
93 return globalStubRegConfig.getCallingConventionRegisters(CallingConvention.Type.RuntimeCall, RegisterFlag.FPU)[index].asValue(kind); |
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:
6500
diff
changeset
|
94 } |
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:
6500
diff
changeset
|
95 return globalStubRegConfig.getCallingConventionRegisters(CallingConvention.Type.RuntimeCall, RegisterFlag.CPU)[index].asValue(kind); |
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:
6500
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:
6500
diff
changeset
|
97 |
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:
6500
diff
changeset
|
98 protected Value scratch(Kind kind) { |
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:
6500
diff
changeset
|
99 return globalStubRegConfig.getScratchRegister().asValue(kind); |
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:
6500
diff
changeset
|
100 } |
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:
6500
diff
changeset
|
101 |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
102 public HotSpotRuntime(HotSpotVMConfig config, HotSpotGraalRuntime graalRuntime) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
103 this.config = config; |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
104 this.graalRuntime = graalRuntime; |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
105 regConfig = createRegisterConfig(false); |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
106 globalStubRegConfig = createRegisterConfig(true); |
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:
6500
diff
changeset
|
107 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
108 addRuntimeCall(UNWIND_EXCEPTION, config.unwindExceptionStub, |
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:
6500
diff
changeset
|
109 /* temps */ 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:
6500
diff
changeset
|
110 /* ret */ ret(Kind.Void), |
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:
6500
diff
changeset
|
111 /* arg0: exception */ arg(0, Kind.Object)); |
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:
6500
diff
changeset
|
112 |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
113 addRuntimeCall(OnStackReplacementPhase.OSR_MIGRATION_END, config.osrMigrationEndStub, |
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
114 /* temps */ null, |
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
115 /* ret */ ret(Kind.Void), |
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
116 /* arg0: long */ arg(0, Kind.Long)); |
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
117 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
118 addRuntimeCall(REGISTER_FINALIZER, config.registerFinalizerStub, |
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:
6500
diff
changeset
|
119 /* temps */ 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:
6500
diff
changeset
|
120 /* ret */ ret(Kind.Void), |
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:
6500
diff
changeset
|
121 /* arg0: object */ arg(0, Kind.Object)); |
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:
6500
diff
changeset
|
122 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
123 addRuntimeCall(CREATE_NULL_POINTER_EXCEPTION, config.createNullPointerExceptionStub, |
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:
6500
diff
changeset
|
124 /* temps */ 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:
6500
diff
changeset
|
125 /* ret */ ret(Kind.Object)); |
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:
6500
diff
changeset
|
126 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
127 addRuntimeCall(CREATE_OUT_OF_BOUNDS_EXCEPTION, config.createOutOfBoundsExceptionStub, |
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:
6500
diff
changeset
|
128 /* temps */ 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:
6500
diff
changeset
|
129 /* ret */ ret(Kind.Object), |
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:
6500
diff
changeset
|
130 /* arg0: index */ arg(0, Kind.Int)); |
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:
6500
diff
changeset
|
131 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
132 addRuntimeCall(JAVA_TIME_MILLIS, config.javaTimeMillisStub, |
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:
6500
diff
changeset
|
133 /* temps */ 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:
6500
diff
changeset
|
134 /* ret */ ret(Kind.Long)); |
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:
6500
diff
changeset
|
135 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
136 addRuntimeCall(JAVA_TIME_NANOS, config.javaTimeNanosStub, |
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:
6500
diff
changeset
|
137 /* temps */ 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:
6500
diff
changeset
|
138 /* ret */ ret(Kind.Long)); |
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:
6500
diff
changeset
|
139 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
140 addRuntimeCall(ARITHMETIC_SIN, config.arithmeticSinStub, |
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:
6500
diff
changeset
|
141 /* temps */ 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:
6500
diff
changeset
|
142 /* ret */ ret(Kind.Double), |
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:
6500
diff
changeset
|
143 /* arg0: index */ arg(0, Kind.Double)); |
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:
6500
diff
changeset
|
144 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
145 addRuntimeCall(ARITHMETIC_COS, config.arithmeticCosStub, |
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:
6500
diff
changeset
|
146 /* temps */ 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:
6500
diff
changeset
|
147 /* ret */ ret(Kind.Double), |
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:
6500
diff
changeset
|
148 /* arg0: index */ arg(0, Kind.Double)); |
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:
6500
diff
changeset
|
149 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
150 addRuntimeCall(ARITHMETIC_TAN, config.arithmeticTanStub, |
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:
6500
diff
changeset
|
151 /* temps */ 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:
6500
diff
changeset
|
152 /* ret */ ret(Kind.Double), |
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:
6500
diff
changeset
|
153 /* arg0: index */ arg(0, Kind.Double)); |
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:
6500
diff
changeset
|
154 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
155 addRuntimeCall(LOG_PRIMITIVE, config.logPrimitiveStub, |
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:
6500
diff
changeset
|
156 /* temps */ 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:
6500
diff
changeset
|
157 /* ret */ ret(Kind.Void), |
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:
6500
diff
changeset
|
158 /* arg0: typeChar */ arg(0, Kind.Int), |
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:
6500
diff
changeset
|
159 /* arg1: value */ arg(1, Kind.Long), |
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:
6500
diff
changeset
|
160 /* arg2: newline */ arg(2, Kind.Boolean)); |
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:
6500
diff
changeset
|
161 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
162 addRuntimeCall(LOG_PRINTF, config.logPrintfStub, |
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:
6500
diff
changeset
|
163 /* temps */ 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:
6500
diff
changeset
|
164 /* ret */ ret(Kind.Void), |
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:
6500
diff
changeset
|
165 /* arg0: format */ arg(0, Kind.Object), |
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:
6500
diff
changeset
|
166 /* arg1: value */ arg(1, Kind.Long)); |
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:
6500
diff
changeset
|
167 |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
168 addRuntimeCall(LOG_OBJECT, config.logObjectStub, |
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:
6500
diff
changeset
|
169 /* temps */ 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:
6500
diff
changeset
|
170 /* ret */ ret(Kind.Void), |
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:
6500
diff
changeset
|
171 /* arg0: object */ arg(0, Kind.Object), |
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:
6500
diff
changeset
|
172 /* arg1: flags */ arg(1, Kind.Int)); |
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:
6500
diff
changeset
|
173 } |
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:
6500
diff
changeset
|
174 |
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:
6500
diff
changeset
|
175 |
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:
6500
diff
changeset
|
176 /** |
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:
6500
diff
changeset
|
177 * Registers the details for linking a runtime call. |
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:
6500
diff
changeset
|
178 * |
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:
6500
diff
changeset
|
179 * @param descriptor name and signature of the call |
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:
6500
diff
changeset
|
180 * @param address target address of the call |
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:
6500
diff
changeset
|
181 * @param tempRegs temporary registers used (and killed) by the call (null if none) |
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:
6500
diff
changeset
|
182 * @param ret where the call returns its result |
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:
6500
diff
changeset
|
183 * @param args where arguments are passed to the call |
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:
6500
diff
changeset
|
184 */ |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
185 protected void addRuntimeCall(Descriptor descriptor, long address, Register[] tempRegs, Value ret, Value... args) { |
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:
6500
diff
changeset
|
186 Value[] temps = tempRegs == null || tempRegs.length == 0 ? Value.NONE : new Value[tempRegs.length]; |
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:
6500
diff
changeset
|
187 for (int i = 0; i < temps.length; i++) { |
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:
6500
diff
changeset
|
188 temps[i] = tempRegs[i].asValue(); |
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:
6500
diff
changeset
|
189 } |
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:
6500
diff
changeset
|
190 Kind retKind = ret.getKind(); |
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:
6500
diff
changeset
|
191 if (retKind == Kind.Illegal) { |
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:
6500
diff
changeset
|
192 retKind = Kind.Void; |
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:
6500
diff
changeset
|
193 } |
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:
6500
diff
changeset
|
194 assert retKind.equals(descriptor.getResultKind()) : descriptor + " incompatible with result location " + ret; |
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:
6500
diff
changeset
|
195 Kind[] argKinds = descriptor.getArgumentKinds(); |
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:
6500
diff
changeset
|
196 assert argKinds.length == args.length : descriptor + " incompatible with number of argument locations: " + args.length; |
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:
6500
diff
changeset
|
197 for (int i = 0; i < argKinds.length; i++) { |
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:
6500
diff
changeset
|
198 assert argKinds[i].equals(args[i].getKind()) : descriptor + " incompatible with argument location " + i + ": " + args[i]; |
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:
6500
diff
changeset
|
199 } |
6534
feb579677b58
SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6525
diff
changeset
|
200 HotSpotRuntimeCall runtimeCall = new HotSpotRuntimeCall(descriptor, address, new CallingConvention(temps, 0, ret, args), graalRuntime.getCompilerToVM()); |
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:
6500
diff
changeset
|
201 runtimeCalls.put(descriptor, runtimeCall); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
202 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
203 |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
204 protected abstract RegisterConfig createRegisterConfig(boolean globalStubConfig); |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
205 |
5585
a7ed598130c2
modified snippet installation to avoid using compiler storage for every method (not just the snippets) processed during installation
Doug Simon <doug.simon@oracle.com>
parents:
5584
diff
changeset
|
206 public void installSnippets(SnippetInstaller installer) { |
a7ed598130c2
modified snippet installation to avoid using compiler storage for every method (not just the snippets) processed during installation
Doug Simon <doug.simon@oracle.com>
parents:
5584
diff
changeset
|
207 installer.install(SystemSnippets.class); |
a7ed598130c2
modified snippet installation to avoid using compiler storage for every method (not just the snippets) processed during installation
Doug Simon <doug.simon@oracle.com>
parents:
5584
diff
changeset
|
208 installer.install(UnsafeSnippets.class); |
a7ed598130c2
modified snippet installation to avoid using compiler storage for every method (not just the snippets) processed during installation
Doug Simon <doug.simon@oracle.com>
parents:
5584
diff
changeset
|
209 installer.install(ArrayCopySnippets.class); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
210 |
5585
a7ed598130c2
modified snippet installation to avoid using compiler storage for every method (not just the snippets) processed during installation
Doug Simon <doug.simon@oracle.com>
parents:
5584
diff
changeset
|
211 installer.install(CheckCastSnippets.class); |
6302
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5842
diff
changeset
|
212 installer.install(InstanceOfSnippets.class); |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
213 installer.install(NewObjectSnippets.class); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
214 installer.install(MonitorSnippets.class); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
215 |
5563
6a2671066204
added NewInstanceSnippets for lowering NewInstanceNodes (currently disabled by default)
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
216 checkcastSnippets = new CheckCastSnippets.Templates(this); |
6302
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5842
diff
changeset
|
217 instanceofSnippets = new InstanceOfSnippets.Templates(this); |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
218 newObjectSnippets = new NewObjectSnippets.Templates(this, graalRuntime.getTarget(), config.useTLAB); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
219 monitorSnippets = new MonitorSnippets.Templates(this, config.useFastLocking); |
5379
c862951e769d
moved checkcast lowering into LoweringPhase and added -G:HIRLowerCheckcast option to enable it (disabled by default) as it is not yet stable
Doug Simon <doug.simon@oracle.com>
parents:
5372
diff
changeset
|
220 } |
c862951e769d
moved checkcast lowering into LoweringPhase and added -G:HIRLowerCheckcast option to enable it (disabled by default) as it is not yet stable
Doug Simon <doug.simon@oracle.com>
parents:
5372
diff
changeset
|
221 |
c862951e769d
moved checkcast lowering into LoweringPhase and added -G:HIRLowerCheckcast option to enable it (disabled by default) as it is not yet stable
Doug Simon <doug.simon@oracle.com>
parents:
5372
diff
changeset
|
222 |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
223 public HotSpotGraalRuntime getGraalRuntime() { |
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
224 return graalRuntime; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
225 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
226 |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
227 /** |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
228 * Gets the register holding the current thread. |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
229 */ |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
230 public abstract Register threadRegister(); |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
231 |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
232 /** |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
233 * Gets the stack pointer register. |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
234 */ |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
235 public abstract Register stackPointerRegister(); |
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6475
diff
changeset
|
236 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
237 @Override |
5546
e42c0df7212a
Rename CiTargetMethod => CompilationResult.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
238 public String disassemble(CodeInfo info, CompilationResult tm) { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
239 byte[] code = info.getCode(); |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
240 TargetDescription target = graalRuntime.getTarget(); |
6582
cc32ce37eddc
deleted Architecture.twoOperandMode() and encapsulated all public fields in Architecture with getters
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
241 HexCodeFile hcf = new HexCodeFile(code, info.getStart(), target.arch.getName(), target.wordSize * 8); |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
242 if (tm != null) { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
243 HexCodeFile.addAnnotations(hcf, tm.getAnnotations()); |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
244 addExceptionHandlersComment(tm, hcf); |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
245 Register fp = regConfig.getFrameRegister(); |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
246 RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5548
diff
changeset
|
247 for (Safepoint safepoint : tm.getSafepoints()) { |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
248 if (safepoint instanceof Call) { |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
249 Call call = (Call) safepoint; |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
250 if (call.debugInfo != null) { |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
251 hcf.addComment(call.pcOffset + call.size, CodeUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString()); |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
252 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
253 addOperandComment(hcf, call.pcOffset, "{" + getTargetName(call) + "}"); |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
254 } else { |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
255 if (safepoint.debugInfo != null) { |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
256 hcf.addComment(safepoint.pcOffset, CodeUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString()); |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
257 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
258 addOperandComment(hcf, safepoint.pcOffset, "{safepoint}"); |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
259 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
260 } |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5548
diff
changeset
|
261 for (DataPatch site : tm.getDataReferences()) { |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
262 hcf.addOperandComment(site.pcOffset, "{" + site.constant + "}"); |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
263 } |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5548
diff
changeset
|
264 for (Mark mark : tm.getMarks()) { |
5275
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
265 hcf.addComment(mark.pcOffset, getMarkName(mark)); |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
266 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
267 } |
290b3025b66f
added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents:
5247
diff
changeset
|
268 return hcf.toEmbeddedString(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
269 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
270 |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
271 /** |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
272 * Decodes a call target to a mnemonic if possible. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
273 */ |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
274 private String getTargetName(Call call) { |
5230
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
275 Field[] fields = config.getClass().getDeclaredFields(); |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
276 for (Field f : fields) { |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
277 if (f.getName().endsWith("Stub")) { |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
278 f.setAccessible(true); |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
279 try { |
6475
67b94a9fba57
append global stub address when disassembling a call to a global stub
Doug Simon <doug.simon@oracle.com>
parents:
6463
diff
changeset
|
280 Object address = f.get(config); |
67b94a9fba57
append global stub address when disassembling a call to a global stub
Doug Simon <doug.simon@oracle.com>
parents:
6463
diff
changeset
|
281 if (address.equals(call.target)) { |
67b94a9fba57
append global stub address when disassembling a call to a global stub
Doug Simon <doug.simon@oracle.com>
parents:
6463
diff
changeset
|
282 return f.getName() + ":0x" + Long.toHexString((Long) address); |
5230
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
283 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
284 } catch (Exception e) { |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
285 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
286 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
287 } |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
288 return String.valueOf(call.target); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
289 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
290 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
291 /** |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
292 * Decodes a mark to a mnemonic if possible. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
293 */ |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
294 private static String getMarkName(Mark mark) { |
6462 | 295 Field[] fields = Marks.class.getDeclaredFields(); |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
296 for (Field f : fields) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
297 if (Modifier.isStatic(f.getModifiers()) && f.getName().startsWith("MARK_")) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
298 f.setAccessible(true); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
299 try { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
300 if (f.get(null).equals(mark.id)) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
301 return f.getName(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
302 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
303 } catch (Exception e) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
304 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
305 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
306 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5230
diff
changeset
|
307 return "MARK:" + mark.id; |
5230
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
308 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
309 |
5546
e42c0df7212a
Rename CiTargetMethod => CompilationResult.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
310 private static void addExceptionHandlersComment(CompilationResult tm, HexCodeFile hcf) { |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5548
diff
changeset
|
311 if (!tm.getExceptionHandlers().isEmpty()) { |
4291
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
312 String nl = HexCodeFile.NEW_LINE; |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
313 StringBuilder buf = new StringBuilder("------ Exception Handlers ------").append(nl); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5548
diff
changeset
|
314 for (CompilationResult.ExceptionHandler e : tm.getExceptionHandlers()) { |
4291
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
315 buf.append(" "). |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
316 append(e.pcOffset).append(" -> "). |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
317 append(e.handlerPos). |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
318 append(nl); |
5241
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
319 hcf.addComment(e.pcOffset, "[exception -> " + e.handlerPos + "]"); |
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
320 hcf.addComment(e.handlerPos, "[exception handler for " + e.pcOffset + "]"); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
321 } |
4291
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
322 hcf.addComment(0, buf.toString()); |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
323 } |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
324 } |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
325 |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
326 private static void addOperandComment(HexCodeFile hcf, int pos, String comment) { |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
327 String oldValue = hcf.addOperandComment(pos, comment); |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
328 assert oldValue == null : "multiple comments for operand of instruction at " + pos + ": " + comment + ", " + oldValue; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
329 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
330 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
331 @Override |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
332 public ResolvedJavaType lookupJavaType(Constant constant) { |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
333 return (ResolvedJavaType) graalRuntime.getCompilerToVM().getJavaType(constant); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
334 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
335 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
336 @Override |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
337 public int getSizeOfLockData() { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
338 return config.basicLockSize; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
340 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
341 @Override |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
342 public boolean constantEquals(Constant x, Constant y) { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
343 return x.equals(y); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
344 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
345 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
346 @Override |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
347 public RegisterConfig lookupRegisterConfig(JavaMethod method) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
348 return regConfig; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
349 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
350 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
351 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
352 * HotSpots needs an area suitable for storing a program counter for temporary use during the deoptimization process. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
353 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
354 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
355 public int getCustomStackAreaSize() { |
6450
9214d9ff2fb9
replaced magic constant with configuration value
Doug Simon <doug.simon@oracle.com>
parents:
6442
diff
changeset
|
356 return graalRuntime.getTarget().wordSize; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
357 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
358 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
359 @Override |
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
|
360 public int getMinimumOutgoingSize() { |
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
|
361 return config.runtimeCallStackSize; |
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
|
362 } |
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
|
363 |
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
|
364 @Override |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
365 public int lookupArrayLength(Constant array) { |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
366 return graalRuntime.getCompilerToVM().getArrayLength(array); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
367 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
368 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
369 @Override |
5718
10341299528c
renamings: ExtendedRiRuntime -> GraalCodeCacheProvider, CiLoweringTool -> LoweringTool, RiGraphCache -> GraphCache
Doug Simon <doug.simon@oracle.com>
parents:
5705
diff
changeset
|
370 public void lower(Node n, LoweringTool tool) { |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
371 StructuredGraph graph = (StructuredGraph) n.graph(); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
372 Kind wordKind = graalRuntime.getTarget().wordKind; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
373 if (n instanceof ArrayLengthNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
374 ArrayLengthNode arrayLengthNode = (ArrayLengthNode) n; |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
375 SafeReadNode safeReadArrayLength = safeReadArrayLength(arrayLengthNode.array(), StructuredGraph.INVALID_GRAPH_ID); |
4305
0768bf0a4898
move part of the cfg-modifying operations into one place (currently: StructuredGraph)
Lukas Stadler <lukas.stadler@jku.at>
parents:
4262
diff
changeset
|
376 graph.replaceFixedWithFixed(arrayLengthNode, safeReadArrayLength); |
5822
ec65d0d0c873
moved HIR lowering of Invokes into HotspotRuntime
Doug Simon <doug.simon@oracle.com>
parents:
5780
diff
changeset
|
377 } else if (n instanceof Invoke) { |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
378 Invoke invoke = (Invoke) n; |
6462 | 379 if (invoke.callTarget() instanceof MethodCallTargetNode) { |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
380 MethodCallTargetNode callTarget = invoke.methodCallTarget(); |
5823
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
381 NodeInputList<ValueNode> parameters = callTarget.arguments(); |
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
382 ValueNode receiver = parameters.size() <= 0 ? null : parameters.get(0); |
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
383 if (!callTarget.isStatic() && receiver.kind() == Kind.Object && !receiver.objectStamp().nonNull()) { |
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
384 invoke.node().dependencies().add(tool.createNullCheckGuard(receiver, invoke.leafGraphId())); |
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
385 } |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
386 Kind[] signature = MetaUtil.signatureToKinds(callTarget.targetMethod().getSignature(), callTarget.isStatic() ? null : callTarget.targetMethod().getDeclaringClass().getKind()); |
5823
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
387 |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
388 AbstractCallTargetNode loweredCallTarget = null; |
5829
0095a9c235c6
incomplete (non XIR) support for inlining virtual dispatch at call sites - all design questions yet to be addressed
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
389 if (callTarget.invokeKind() == InvokeKind.Virtual && |
0095a9c235c6
incomplete (non XIR) support for inlining virtual dispatch at call sites - all design questions yet to be addressed
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
390 GraalOptions.InlineVTableStubs && |
0095a9c235c6
incomplete (non XIR) support for inlining virtual dispatch at call sites - all design questions yet to be addressed
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
391 (GraalOptions.AlwaysInlineVTableStubs || invoke.isMegamorphic())) { |
0095a9c235c6
incomplete (non XIR) support for inlining virtual dispatch at call sites - all design questions yet to be addressed
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
392 |
5823
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
393 HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
394 if (!hsMethod.getDeclaringClass().isInterface()) { |
5829
0095a9c235c6
incomplete (non XIR) support for inlining virtual dispatch at call sites - all design questions yet to be addressed
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
395 int vtableEntryOffset = hsMethod.vtableEntryOffset(); |
6686
363968be1018
Do not inline vtable lookup when the method's holder is not yet linked (no vtable offset available)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6677
diff
changeset
|
396 if (vtableEntryOffset > 0) { |
363968be1018
Do not inline vtable lookup when the method's holder is not yet linked (no vtable offset available)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6677
diff
changeset
|
397 // We use LocationNode.ANY_LOCATION for the reads that access the vtable entry and the compiled code entry |
363968be1018
Do not inline vtable lookup when the method's holder is not yet linked (no vtable offset available)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6677
diff
changeset
|
398 // as HotSpot does not guarantee they are final values. |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
399 assert vtableEntryOffset > 0; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
400 LoadHubNode hub = graph.add(new LoadHubNode(receiver, wordKind)); |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
401 ReadNode metaspaceMethod = graph.add(new ReadNode(hub, LocationNode.create(LocationNode.ANY_LOCATION, wordKind, vtableEntryOffset, graph), wordStamp())); |
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
402 ReadNode compiledEntry = graph.add(new ReadNode(metaspaceMethod, LocationNode.create(LocationNode.ANY_LOCATION, wordKind, config.methodCompiledEntryOffset, graph), wordStamp())); |
5841
f84d11672a86
vtable dispatch inlining for megamorphic virtual calls now works and is enabled by default
Doug Simon <doug.simon@oracle.com>
parents:
5829
diff
changeset
|
403 |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
404 loweredCallTarget = graph.add(new HotSpotIndirectCallTargetNode(metaspaceMethod, compiledEntry, parameters, invoke.node().stamp(), signature, callTarget.targetMethod(), CallingConvention.Type.JavaCall)); |
5823
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
405 |
6686
363968be1018
Do not inline vtable lookup when the method's holder is not yet linked (no vtable offset available)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6677
diff
changeset
|
406 graph.addBeforeFixed(invoke.node(), hub); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
407 graph.addAfterFixed(hub, metaspaceMethod); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
408 graph.addAfterFixed(metaspaceMethod, compiledEntry); |
6686
363968be1018
Do not inline vtable lookup when the method's holder is not yet linked (no vtable offset available)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6677
diff
changeset
|
409 } |
5823
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
410 } |
f238fe91dc7f
partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents:
5822
diff
changeset
|
411 } |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
412 |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
413 if (loweredCallTarget == null) { |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
414 loweredCallTarget = graph.add(new HotSpotDirectCallTargetNode(parameters, invoke.node().stamp(), signature, callTarget.targetMethod(), CallingConvention.Type.JavaCall, callTarget.invokeKind())); |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
415 } |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
416 callTarget.replaceAndDelete(loweredCallTarget); |
5822
ec65d0d0c873
moved HIR lowering of Invokes into HotspotRuntime
Doug Simon <doug.simon@oracle.com>
parents:
5780
diff
changeset
|
417 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
418 } else if (n instanceof LoadFieldNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
419 LoadFieldNode field = (LoadFieldNode) n; |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5552
diff
changeset
|
420 int displacement = ((HotSpotResolvedJavaField) field.field()).offset(); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
421 assert field.kind() != Kind.Illegal; |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
422 ReadNode memoryRead = graph.add(new ReadNode(field.object(), LocationNode.create(field.field(), field.field().getKind(), displacement, graph), field.stamp())); |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5401
diff
changeset
|
423 memoryRead.dependencies().add(tool.createNullCheckGuard(field.object(), field.leafGraphId())); |
4305
0768bf0a4898
move part of the cfg-modifying operations into one place (currently: StructuredGraph)
Lukas Stadler <lukas.stadler@jku.at>
parents:
4262
diff
changeset
|
424 graph.replaceFixedWithFixed(field, memoryRead); |
5167
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
425 if (field.isVolatile()) { |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
426 MembarNode preMembar = graph.add(new MembarNode(JMM_PRE_VOLATILE_READ)); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
427 graph.addBeforeFixed(memoryRead, preMembar); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
428 MembarNode postMembar = graph.add(new MembarNode(JMM_POST_VOLATILE_READ)); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
429 graph.addAfterFixed(memoryRead, postMembar); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
430 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
431 } else if (n instanceof StoreFieldNode) { |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
432 StoreFieldNode storeField = (StoreFieldNode) n; |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5552
diff
changeset
|
433 HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) storeField.field(); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
434 WriteNode memoryWrite = graph.add(new WriteNode(storeField.object(), storeField.value(), LocationNode.create(field, field.getKind(), field.offset(), graph))); |
5425
0364a2a874b8
changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5401
diff
changeset
|
435 memoryWrite.dependencies().add(tool.createNullCheckGuard(storeField.object(), storeField.leafGraphId())); |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
436 memoryWrite.setStateAfter(storeField.stateAfter()); |
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
437 graph.replaceFixedWithFixed(storeField, memoryWrite); |
5167
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
438 FixedWithNextNode last = memoryWrite; |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
439 if (field.getKind() == Kind.Object && !memoryWrite.value().objectStamp().alwaysNull()) { |
5167
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
440 FieldWriteBarrier writeBarrier = graph.add(new FieldWriteBarrier(memoryWrite.object())); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
441 graph.addAfterFixed(memoryWrite, writeBarrier); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
442 last = writeBarrier; |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
443 } |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
444 if (storeField.isVolatile()) { |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
445 MembarNode preMembar = graph.add(new MembarNode(JMM_PRE_VOLATILE_WRITE)); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
446 graph.addBeforeFixed(memoryWrite, preMembar); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
447 MembarNode postMembar = graph.add(new MembarNode(JMM_POST_VOLATILE_WRITE)); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
448 graph.addAfterFixed(last, postMembar); |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
449 } |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
450 } else if (n instanceof CompareAndSwapNode) { |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
451 // Separate out GC barrier semantics |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
452 CompareAndSwapNode cas = (CompareAndSwapNode) n; |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
453 ValueNode expected = cas.expected(); |
5831
ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5780
diff
changeset
|
454 if (expected.kind() == Kind.Object && !cas.newValue().objectStamp().alwaysNull()) { |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5540
diff
changeset
|
455 ResolvedJavaType type = cas.object().objectStamp().type(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
456 if (type != null && !type.isArrayClass() && type.toJava() != Object.class) { |
5168
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
457 // Use a field write barrier since it's not an array store |
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
458 FieldWriteBarrier writeBarrier = graph.add(new FieldWriteBarrier(cas.object())); |
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
459 graph.addAfterFixed(cas, writeBarrier); |
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
460 } else { |
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
461 // This may be an array store so use an array write barrier |
5187
9b8c0d1bc2dd
unsafe load/store snippets now require a displacement argument which allows x86 complex addressing modes to be used for tighter encoding of array store/load operations
Doug Simon <doug.simon@oracle.com>
parents:
5177
diff
changeset
|
462 LocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, cas.expected().kind(), cas.displacement(), cas.offset(), graph, false); |
5168
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
463 graph.addAfterFixed(cas, graph.add(new ArrayWriteBarrier(cas.object(), location))); |
519d27db8eb9
made CompareAndSwapNode implement Lowerable to ensure partial HIR -> HIR lowering happens
Doug Simon <doug.simon@oracle.com>
parents:
5167
diff
changeset
|
464 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
465 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
466 } else if (n instanceof LoadIndexedNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
467 LoadIndexedNode loadIndexed = (LoadIndexedNode) n; |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
468 ValueNode boundsCheck = createBoundsCheck(loadIndexed, tool); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
469 Kind elementKind = loadIndexed.elementKind(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
470 LocationNode arrayLocation = createArrayLocation(graph, elementKind, loadIndexed.index()); |
5076
01ffb0fc9aec
propagate stamps while lowering
Lukas Stadler <lukas.stadler@jku.at>
parents:
5067
diff
changeset
|
471 ReadNode memoryRead = graph.add(new ReadNode(loadIndexed.array(), arrayLocation, loadIndexed.stamp())); |
5387
b6aaf6de4053
use dependencies collection instead of explicit guard fields
Lukas Stadler <lukas.stadler@jku.at>
parents:
5372
diff
changeset
|
472 memoryRead.dependencies().add(boundsCheck); |
4305
0768bf0a4898
move part of the cfg-modifying operations into one place (currently: StructuredGraph)
Lukas Stadler <lukas.stadler@jku.at>
parents:
4262
diff
changeset
|
473 graph.replaceFixedWithFixed(loadIndexed, memoryRead); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
474 } else if (n instanceof StoreIndexedNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
475 StoreIndexedNode storeIndexed = (StoreIndexedNode) n; |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
476 ValueNode boundsCheck = createBoundsCheck(storeIndexed, tool); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
477 |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
478 Kind elementKind = storeIndexed.elementKind(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
479 LocationNode arrayLocation = createArrayLocation(graph, elementKind, storeIndexed.index()); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
480 ValueNode value = storeIndexed.value(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
481 ValueNode array = storeIndexed.array(); |
5831
ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5780
diff
changeset
|
482 if (elementKind == Kind.Object && !value.objectStamp().alwaysNull()) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
483 // Store check! |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5540
diff
changeset
|
484 ResolvedJavaType arrayType = array.objectStamp().type(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
485 if (arrayType != null && array.objectStamp().isExactType()) { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
486 ResolvedJavaType elementType = arrayType.getComponentType(); |
6699
d79098b9db3b
Support for interfaces in the Graal API: Make interfaces implemented by a ResolvedJavaType available; change semantics of ResolvedJavaType.getSuperclass to return null for interfaces (to conform with java.lang.Class); change semantics of ResolvedJavaType.isInstanceClass to return false for interfaces.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6686
diff
changeset
|
487 if (!MetaUtil.isJavaLangObject(elementType)) { |
6648
7bf5a6c42db7
factored CheckCastDynamicNode out of CheckCastNode
Doug Simon <doug.simon@oracle.com>
parents:
6582
diff
changeset
|
488 CheckCastNode checkcast = graph.add(new CheckCastNode(elementType, value, null)); |
5372
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
489 graph.addBeforeFixed(storeIndexed, checkcast); |
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
490 value = checkcast; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
491 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
492 } else { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
493 LoadHubNode arrayClass = graph.add(new LoadHubNode(array, wordKind)); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
494 LocationNode location = LocationNode.create(LocationNode.FINAL_LOCATION, wordKind, config.arrayClassElementOffset, graph); |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
495 FloatingReadNode arrayElementKlass = graph.unique(new FloatingReadNode(arrayClass, location, null, wordStamp())); |
6648
7bf5a6c42db7
factored CheckCastDynamicNode out of CheckCastNode
Doug Simon <doug.simon@oracle.com>
parents:
6582
diff
changeset
|
496 CheckCastDynamicNode checkcast = graph.add(new CheckCastDynamicNode(arrayElementKlass, value)); |
5372
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
497 graph.addBeforeFixed(storeIndexed, checkcast); |
6463
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
498 graph.addBeforeFixed(checkcast, arrayClass); |
5372
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
499 value = checkcast; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
500 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
501 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
502 WriteNode memoryWrite = graph.add(new WriteNode(array, value, arrayLocation)); |
5387
b6aaf6de4053
use dependencies collection instead of explicit guard fields
Lukas Stadler <lukas.stadler@jku.at>
parents:
5372
diff
changeset
|
503 memoryWrite.dependencies().add(boundsCheck); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
504 memoryWrite.setStateAfter(storeIndexed.stateAfter()); |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
505 |
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
506 graph.replaceFixedWithFixed(storeIndexed, memoryWrite); |
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
507 |
5831
ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5780
diff
changeset
|
508 if (elementKind == Kind.Object && !value.objectStamp().alwaysNull()) { |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
509 graph.addAfterFixed(memoryWrite, graph.add(new ArrayWriteBarrier(array, arrayLocation))); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
510 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
511 } else if (n instanceof UnsafeLoadNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
512 UnsafeLoadNode load = (UnsafeLoadNode) n; |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
513 assert load.kind() != Kind.Illegal; |
5466
af07e798947d
lifted fast subtype check into checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
5453
diff
changeset
|
514 IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, load.loadKind(), load.displacement(), load.offset(), graph, false); |
5076
01ffb0fc9aec
propagate stamps while lowering
Lukas Stadler <lukas.stadler@jku.at>
parents:
5067
diff
changeset
|
515 ReadNode memoryRead = graph.add(new ReadNode(load.object(), location, load.stamp())); |
7001
46bec43bdfc3
fixed bug causing tomcat to crash: an UnsafeLoadNode must be pinned to its block when lowered
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6996
diff
changeset
|
516 // An unsafe read must not floating outside its block as may float above an explicit null check on its object. |
46bec43bdfc3
fixed bug causing tomcat to crash: an UnsafeLoadNode must be pinned to its block when lowered
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6996
diff
changeset
|
517 memoryRead.dependencies().add(BeginNode.prevBegin(load)); |
4305
0768bf0a4898
move part of the cfg-modifying operations into one place (currently: StructuredGraph)
Lukas Stadler <lukas.stadler@jku.at>
parents:
4262
diff
changeset
|
518 graph.replaceFixedWithFixed(load, memoryRead); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
519 } else if (n instanceof UnsafeStoreNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
520 UnsafeStoreNode store = (UnsafeStoreNode) n; |
5466
af07e798947d
lifted fast subtype check into checkcast snippets
Doug Simon <doug.simon@oracle.com>
parents:
5453
diff
changeset
|
521 IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, store.storeKind(), store.displacement(), store.offset(), graph, false); |
5705
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
522 ValueNode object = store.object(); |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
523 WriteNode write = graph.add(new WriteNode(object, store.value(), location)); |
5192
20993edddd73
write barrier for UnsafeStoreNode must be inserted after associated write node has replaced original store node in the graph
Doug Simon <doug.simon@oracle.com>
parents:
5190
diff
changeset
|
524 write.setStateAfter(store.stateAfter()); |
20993edddd73
write barrier for UnsafeStoreNode must be inserted after associated write node has replaced original store node in the graph
Doug Simon <doug.simon@oracle.com>
parents:
5190
diff
changeset
|
525 graph.replaceFixedWithFixed(store, write); |
5831
ed08c40d67de
Add a alwaysNull property to ObjectStamp (Phi(null, a! A) get a "a A" stamp and not just "a -")
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5780
diff
changeset
|
526 if (write.value().kind() == Kind.Object && !write.value().objectStamp().alwaysNull()) { |
5705
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
527 ResolvedJavaType type = object.objectStamp().type(); |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
528 WriteBarrier writeBarrier; |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
529 if (type != null && !type.isArrayClass() && type.toJava() != Object.class) { |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
530 // Use a field write barrier since it's not an array store |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
531 writeBarrier = graph.add(new FieldWriteBarrier(object)); |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
532 } else { |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
533 // This may be an array store so use an array write barrier |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
534 writeBarrier = graph.add(new ArrayWriteBarrier(object, location)); |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
535 } |
f96e7b39e9fe
Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5663
diff
changeset
|
536 graph.addAfterFixed(write, writeBarrier); |
5190
cb3245503a5e
emit GC write barrier for UnsafeStoreNode only if store kind is Object
Doug Simon <doug.simon@oracle.com>
parents:
5187
diff
changeset
|
537 } |
6460
78e352577028
renamed ReadHubNode to LoadHubNode to be imply higher level operation (c.f. UnsafeLoadNode vs ReadNode)
Doug Simon <doug.simon@oracle.com>
parents:
6459
diff
changeset
|
538 } else if (n instanceof LoadHubNode) { |
78e352577028
renamed ReadHubNode to LoadHubNode to be imply higher level operation (c.f. UnsafeLoadNode vs ReadNode)
Doug Simon <doug.simon@oracle.com>
parents:
6459
diff
changeset
|
539 LoadHubNode loadHub = (LoadHubNode) n; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
540 assert loadHub.kind() == wordKind; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
541 LocationNode location = LocationNode.create(LocationNode.FINAL_LOCATION, wordKind, config.hubOffset, graph); |
6460
78e352577028
renamed ReadHubNode to LoadHubNode to be imply higher level operation (c.f. UnsafeLoadNode vs ReadNode)
Doug Simon <doug.simon@oracle.com>
parents:
6459
diff
changeset
|
542 ValueNode object = loadHub.object(); |
6459
a938e15e3bd7
made ReadHubNode floating
Doug Simon <doug.simon@oracle.com>
parents:
6457
diff
changeset
|
543 ValueNode guard = tool.createNullCheckGuard(object, StructuredGraph.INVALID_GRAPH_ID); |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
544 ReadNode hub = graph.add(new ReadNode(object, location, wordStamp())); |
6463
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
545 hub.dependencies().add(guard); |
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
546 graph.replaceFixed(loadHub, hub); |
5379
c862951e769d
moved checkcast lowering into LoweringPhase and added -G:HIRLowerCheckcast option to enable it (disabled by default) as it is not yet stable
Doug Simon <doug.simon@oracle.com>
parents:
5372
diff
changeset
|
547 } else if (n instanceof CheckCastNode) { |
6462 | 548 checkcastSnippets.lower((CheckCastNode) n, tool); |
6648
7bf5a6c42db7
factored CheckCastDynamicNode out of CheckCastNode
Doug Simon <doug.simon@oracle.com>
parents:
6582
diff
changeset
|
549 } else if (n instanceof CheckCastDynamicNode) { |
7bf5a6c42db7
factored CheckCastDynamicNode out of CheckCastNode
Doug Simon <doug.simon@oracle.com>
parents:
6582
diff
changeset
|
550 checkcastSnippets.lower((CheckCastDynamicNode) n); |
6302
5d7d9a6953bd
added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
5842
diff
changeset
|
551 } else if (n instanceof InstanceOfNode) { |
6462 | 552 instanceofSnippets.lower((InstanceOfNode) n, tool); |
5563
6a2671066204
added NewInstanceSnippets for lowering NewInstanceNodes (currently disabled by default)
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
553 } else if (n instanceof NewInstanceNode) { |
6462 | 554 newObjectSnippets.lower((NewInstanceNode) n, tool); |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
555 } else if (n instanceof NewArrayNode) { |
6462 | 556 newObjectSnippets.lower((NewArrayNode) n, tool); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
557 } else if (n instanceof MonitorEnterNode) { |
6462 | 558 monitorSnippets.lower((MonitorEnterNode) n, tool); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6329
diff
changeset
|
559 } else if (n instanceof MonitorExitNode) { |
6462 | 560 monitorSnippets.lower((MonitorExitNode) n, tool); |
5663
77069a28a983
split lowering of NEW into two separate nodes - one for doing the allocation and one for doing the object formatting. Both of these nodes are in turn lowered via snippets.
Doug Simon <doug.simon@oracle.com>
parents:
5602
diff
changeset
|
561 } else if (n instanceof TLABAllocateNode) { |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
562 newObjectSnippets.lower((TLABAllocateNode) n, tool); |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
563 } else if (n instanceof InitializeObjectNode) { |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
564 newObjectSnippets.lower((InitializeObjectNode) n, tool); |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
565 } else if (n instanceof InitializeArrayNode) { |
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
566 newObjectSnippets.lower((InitializeArrayNode) n, tool); |
6431
2e376f8ea4e2
added snippet for lowering NewMultiArrayNodes
Doug Simon <doug.simon@oracle.com>
parents:
6409
diff
changeset
|
567 } else if (n instanceof NewMultiArrayNode) { |
6462 | 568 newObjectSnippets.lower((NewMultiArrayNode) n, tool); |
5241
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
569 } else { |
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
570 assert false : "Node implementing Lowerable not handled: " + n; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
571 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
572 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
573 |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
574 private static IndexedLocationNode createArrayLocation(Graph graph, Kind elementKind, ValueNode index) { |
6328
6e66d97a16ae
Clean up Kind class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6302
diff
changeset
|
575 return IndexedLocationNode.create(LocationNode.getArrayLocation(elementKind), elementKind, elementKind.getArrayBaseOffset(), index, graph, true); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
576 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
577 |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
578 private SafeReadNode safeReadArrayLength(ValueNode array, long leafGraphId) { |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
579 return safeRead(array.graph(), Kind.Int, array, config.arrayLengthOffset, StampFactory.positiveInt(), leafGraphId); |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
580 } |
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
581 |
5718
10341299528c
renamings: ExtendedRiRuntime -> GraalCodeCacheProvider, CiLoweringTool -> LoweringTool, RiGraphCache -> GraphCache
Doug Simon <doug.simon@oracle.com>
parents:
5705
diff
changeset
|
582 private static ValueNode createBoundsCheck(AccessIndexedNode n, LoweringTool tool) { |
5415
79f12805362b
Use iterative lowering instead of manually applying lowering
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5401
diff
changeset
|
583 StructuredGraph graph = (StructuredGraph) n.graph(); |
79f12805362b
Use iterative lowering instead of manually applying lowering
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5401
diff
changeset
|
584 ArrayLengthNode arrayLength = graph.add(new ArrayLengthNode(n.array())); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
585 ValueNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), BoundsCheckException, InvalidateReprofile, n.leafGraphId()); |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
586 |
5415
79f12805362b
Use iterative lowering instead of manually applying lowering
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5401
diff
changeset
|
587 graph.addBeforeFixed(n, arrayLength); |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
588 return guard; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
589 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
590 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
591 @Override |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5540
diff
changeset
|
592 public StructuredGraph intrinsicGraph(ResolvedJavaMethod caller, int bci, ResolvedJavaMethod method, List<? extends Node> parameters) { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
593 ResolvedJavaType holder = method.getDeclaringClass(); |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
594 String fullName = method.getName() + ((HotSpotSignature) method.getSignature()).asString(); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
595 Kind wordKind = graalRuntime.getTarget().wordKind; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
596 if (holder.toJava() == Object.class) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
597 if (fullName.equals("getClass()Ljava/lang/Class;")) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
598 ValueNode obj = (ValueNode) parameters.get(0); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
599 ObjectStamp stamp = (ObjectStamp) obj.stamp(); |
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
600 if (stamp.nonNull() && stamp.isExactType()) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
601 StructuredGraph graph = new StructuredGraph(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
602 ValueNode result = ConstantNode.forObject(stamp.type().toJava(), this, graph); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
603 ReturnNode ret = graph.add(new ReturnNode(result)); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
604 graph.start().setNext(ret); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
605 return graph; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
606 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
607 StructuredGraph graph = new StructuredGraph(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
608 LocalNode receiver = graph.unique(new LocalNode(0, StampFactory.objectNonNull())); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
609 LoadHubNode hub = graph.add(new LoadHubNode(receiver, wordKind)); |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
610 Stamp resultStamp = StampFactory.declaredNonNull(lookupJavaType(Class.class)); |
6459
a938e15e3bd7
made ReadHubNode floating
Doug Simon <doug.simon@oracle.com>
parents:
6457
diff
changeset
|
611 FloatingReadNode result = graph.unique(new FloatingReadNode(hub, LocationNode.create(LocationNode.FINAL_LOCATION, Kind.Object, config.classMirrorOffset, graph), null, resultStamp)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
612 ReturnNode ret = graph.add(new ReturnNode(result)); |
6463
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
613 graph.start().setNext(hub); |
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
614 hub.setNext(ret); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
615 return graph; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
616 } |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
617 } else if (holder.toJava() == Class.class) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
618 if (fullName.equals("getModifiers()I")) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
619 StructuredGraph graph = new StructuredGraph(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
620 LocalNode receiver = graph.unique(new LocalNode(0, StampFactory.objectNonNull())); |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
621 SafeReadNode klass = safeRead(graph, wordKind, receiver, config.klassOffset, wordStamp(), INVALID_GRAPH_ID); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
622 graph.start().setNext(klass); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
623 LocationNode location = LocationNode.create(LocationNode.FINAL_LOCATION, Kind.Int, config.klassModifierFlagsOffset, graph); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
624 FloatingReadNode readModifiers = graph.unique(new FloatingReadNode(klass, location, null, StampFactory.intValue())); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
625 CompareNode isZero = CompareNode.createCompareNode(Condition.EQ, klass, ConstantNode.defaultForKind(wordKind, graph)); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
626 GuardNode guard = graph.unique(new GuardNode(isZero, graph.start(), NullCheckException, InvalidateReprofile, true, INVALID_GRAPH_ID)); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
627 readModifiers.dependencies().add(guard); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
628 ReturnNode ret = graph.add(new ReturnNode(readModifiers)); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
629 klass.setNext(ret); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
630 return graph; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
631 } |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
632 } else if (holder.toJava() == Thread.class) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
633 if (fullName.equals("currentThread()Ljava/lang/Thread;")) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
634 StructuredGraph graph = new StructuredGraph(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
635 ReturnNode ret = graph.add(new ReturnNode(graph.unique(new CurrentThread(config.threadObjectOffset, this)))); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
636 graph.start().setNext(ret); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
637 return graph; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
638 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
639 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
640 return null; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
641 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
642 |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
643 private static SafeReadNode safeRead(Graph graph, Kind kind, ValueNode value, int offset, Stamp stamp, long leafGraphId) { |
5129
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5079
diff
changeset
|
644 return graph.add(new SafeReadNode(value, LocationNode.create(LocationNode.FINAL_LOCATION, kind, offset, graph), stamp, leafGraphId)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
645 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
646 |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
647 public ResolvedJavaType lookupJavaType(Class<?> clazz) { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
648 return HotSpotResolvedJavaType.fromClass(clazz); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
649 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
650 |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
651 public Object lookupCallTarget(Object target) { |
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:
6500
diff
changeset
|
652 if (target instanceof HotSpotRuntimeCall) { |
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:
6500
diff
changeset
|
653 return ((HotSpotRuntimeCall) target).address; |
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:
6500
diff
changeset
|
654 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
655 return target; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
656 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
657 |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
658 public RuntimeCall lookupRuntimeCall(Descriptor descriptor) { |
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:
6500
diff
changeset
|
659 assert runtimeCalls.containsKey(descriptor) : descriptor; |
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:
6500
diff
changeset
|
660 return runtimeCalls.get(descriptor); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
661 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
662 |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
663 public ResolvedJavaMethod lookupJavaMethod(Method reflectionMethod) { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
664 CompilerToVM c2vm = graalRuntime.getCompilerToVM(); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
665 HotSpotResolvedJavaType[] resultHolder = {null}; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
666 long metaspaceMethod = c2vm.getMetaspaceMethod(reflectionMethod, resultHolder); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
667 assert metaspaceMethod != 0L; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
668 return resultHolder[0].createMethod(metaspaceMethod); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
669 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
670 |
6442
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6431
diff
changeset
|
671 @Override |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6534
diff
changeset
|
672 public ResolvedJavaField lookupJavaField(Field reflectionField) { |
6442
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6431
diff
changeset
|
673 return graalRuntime.getCompilerToVM().getJavaField(reflectionField); |
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6431
diff
changeset
|
674 } |
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6431
diff
changeset
|
675 |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
676 private static HotSpotCodeInfo makeInfo(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info) { |
5360
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
677 HotSpotCodeInfo hsInfo = null; |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
678 if (info != null && info.length > 0) { |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
679 hsInfo = new HotSpotCodeInfo(compResult, (HotSpotResolvedJavaMethod) method); |
5360
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
680 info[0] = hsInfo; |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
681 } |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
682 return hsInfo; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
683 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
684 |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
685 public void installMethod(HotSpotResolvedJavaMethod method, int entryBCI, CompilationResult compResult, CodeInfo[] info) { |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
686 HotSpotCodeInfo hsInfo = makeInfo(method, compResult, info); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
687 graalRuntime.getCompilerToVM().installCode(new HotSpotCompilationResult(method, entryBCI, compResult), null, hsInfo); |
5360
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
688 } |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
689 |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
690 @Override |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
691 public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info) { |
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
692 HotSpotCodeInfo hsInfo = makeInfo(method, compResult, info); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
693 HotSpotResolvedJavaMethod hotspotMethod = (HotSpotResolvedJavaMethod) method; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
694 return graalRuntime.getCompilerToVM().installCode(new HotSpotCompilationResult(hotspotMethod, -1, compResult), new HotSpotInstalledCode(hotspotMethod), hsInfo); |
4319
3c21eee8ab4d
Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents:
4312
diff
changeset
|
695 } |
3c21eee8ab4d
Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents:
4312
diff
changeset
|
696 |
4993
897b7d18bebc
added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents:
4696
diff
changeset
|
697 @Override |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
698 public int encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason) { |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
699 final int actionShift = 0; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
700 final int reasonShift = 3; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
701 |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
702 int actionValue = convertDeoptAction(action); |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
703 int reasonValue = convertDeoptReason(reason); |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
704 return (~(((reasonValue) << reasonShift) + ((actionValue) << actionShift))); |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
705 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
706 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
707 public int convertDeoptAction(DeoptimizationAction action) { |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
708 // This must be kept in sync with the DeoptAction enum defined in deoptimization.hpp |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
709 switch(action) { |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
710 case None: return 0; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
711 case RecompileIfTooManyDeopts: return 1; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
712 case InvalidateReprofile: return 2; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
713 case InvalidateRecompile: return 3; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
714 case InvalidateStopCompiling: return 4; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
715 default: throw GraalInternalError.shouldNotReachHere(); |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
716 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
717 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
718 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5540
diff
changeset
|
719 public int convertDeoptReason(DeoptimizationReason reason) { |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
720 // This must be kept in sync with the DeoptReason enum defined in deoptimization.hpp |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
721 switch(reason) { |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
722 case None: return 0; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
723 case NullCheckException: return 1; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
724 case BoundsCheckException: return 2; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
725 case ClassCastException: return 3; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
726 case ArrayStoreException: return 4; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
727 case UnreachedCode: return 5; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
728 case TypeCheckedInliningViolated: return 6; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
729 case OptimizedTypeCheckViolated: return 7; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
730 case NotCompiledExceptionHandler: return 8; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
731 case Unresolved: return 9; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
732 case JavaSubroutineMismatch: return 10; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
733 case ArithmeticException: return 11; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
734 case RuntimeConstraint: return 12; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
735 default: throw GraalInternalError.shouldNotReachHere(); |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
736 } |
4993
897b7d18bebc
added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents:
4696
diff
changeset
|
737 } |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6954
diff
changeset
|
738 |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6954
diff
changeset
|
739 public boolean needsDataPatch(Constant constant) { |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6954
diff
changeset
|
740 return constant.getPrimitiveAnnotation() instanceof HotSpotResolvedJavaType; |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6954
diff
changeset
|
741 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
742 } |