Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java @ 9636:ff4e8218d3dd
Remove hasVtableEntry, use isInVirtualMethodTable instead
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 10 May 2013 12:55:34 +0200 |
parents | 5e3c8dd80632 |
children | 183d33c76419 53cbcd9ff217 |
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 |
7558
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
25 import static com.oracle.graal.api.code.CallingConvention.Type.*; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
26 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
|
27 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
|
28 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
|
29 import static com.oracle.graal.api.meta.Value.*; |
7672
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
30 import static com.oracle.graal.graph.UnsafeAccess.*; |
9455
62af2ee39bc5
moved initialization of UNCOMMON_TRAP descriptor from AMD64 code to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9425
diff
changeset
|
31 import static com.oracle.graal.hotspot.HotSpotBackend.*; |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
32 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; |
9461
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
33 import static com.oracle.graal.hotspot.nodes.IdentityHashCodeStubCall.*; |
9590
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
34 import static com.oracle.graal.hotspot.nodes.MonitorEnterStubCall.*; |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
35 import static com.oracle.graal.hotspot.nodes.MonitorExitStubCall.*; |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
36 import static com.oracle.graal.hotspot.nodes.NewArrayStubCall.*; |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
37 import static com.oracle.graal.hotspot.nodes.NewInstanceStubCall.*; |
9355
4e260c2ced0e
removed new_multi_array assembler stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9339
diff
changeset
|
38 import static com.oracle.graal.hotspot.nodes.NewMultiArrayStubCall.*; |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
39 import static com.oracle.graal.hotspot.nodes.ThreadIsInterruptedStubCall.*; |
9594
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
40 import static com.oracle.graal.hotspot.nodes.VMErrorNode.*; |
9574
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9564
diff
changeset
|
41 import static com.oracle.graal.hotspot.nodes.VerifyOopStubCall.*; |
9595
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
42 import static com.oracle.graal.hotspot.nodes.WriteBarrierPostStubCall.*; |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
43 import static com.oracle.graal.hotspot.nodes.WriteBarrierPreStubCall.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8412
diff
changeset
|
44 import static com.oracle.graal.hotspot.replacements.SystemSubstitutions.*; |
9591
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
45 import static com.oracle.graal.hotspot.stubs.CreateNullPointerExceptionStub.*; |
9592
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
46 import static com.oracle.graal.hotspot.stubs.CreateOutOfBoundsExceptionStub.*; |
9532
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
47 import static com.oracle.graal.hotspot.stubs.ExceptionHandlerStub.*; |
9461
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
48 import static com.oracle.graal.hotspot.stubs.IdentityHashCodeStub.*; |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
49 import static com.oracle.graal.hotspot.stubs.LogObjectStub.*; |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
50 import static com.oracle.graal.hotspot.stubs.LogPrimitiveStub.*; |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
51 import static com.oracle.graal.hotspot.stubs.LogPrintfStub.*; |
9590
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
52 import static com.oracle.graal.hotspot.stubs.MonitorEnterStub.*; |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
53 import static com.oracle.graal.hotspot.stubs.MonitorExitStub.*; |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
54 import static com.oracle.graal.hotspot.stubs.NewArrayStub.*; |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
55 import static com.oracle.graal.hotspot.stubs.NewInstanceStub.*; |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
56 import static com.oracle.graal.hotspot.stubs.NewMultiArrayStub.*; |
9594
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
57 import static com.oracle.graal.hotspot.stubs.OSRMigrationEndStub.*; |
9419
640d86a6bf4a
replaced register_finalizer assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9418
diff
changeset
|
58 import static com.oracle.graal.hotspot.stubs.RegisterFinalizerStub.*; |
9618
bd4a7d657dcc
moved static methods out of Stub into StubUtil
Doug Simon <doug.simon@oracle.com>
parents:
9616
diff
changeset
|
59 import static com.oracle.graal.hotspot.stubs.StubUtil.*; |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
60 import static com.oracle.graal.hotspot.stubs.ThreadIsInterruptedStub.*; |
9562
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
61 import static com.oracle.graal.hotspot.stubs.UnwindExceptionToCallerStub.*; |
9594
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
62 import static com.oracle.graal.hotspot.stubs.VMErrorStub.*; |
9595
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
63 import static com.oracle.graal.hotspot.stubs.WriteBarrierPostStub.*; |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
64 import static com.oracle.graal.hotspot.stubs.WriteBarrierPreStub.*; |
7558
223f645acb9b
added compilation rate measurements on top of existing metric/timer facility - enabled with -Dgraal.benchmark.compilation=true
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
65 import static com.oracle.graal.java.GraphBuilderPhase.RuntimeCalls.*; |
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
|
66 import static com.oracle.graal.nodes.java.RegisterFinalizerNode.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8412
diff
changeset
|
67 import static com.oracle.graal.replacements.Log.*; |
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8412
diff
changeset
|
68 import static com.oracle.graal.replacements.MathSubstitutionsX86.*; |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
69 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 import java.lang.reflect.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
71 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
73 import sun.misc.*; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
74 |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
75 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
|
76 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
|
77 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
|
78 import com.oracle.graal.api.code.CompilationResult.DataPatch; |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
79 import com.oracle.graal.api.code.CompilationResult.Infopoint; |
5760
87e8baf5447c
added snippets for lowering array creation and initialization (in NewObjectSnippets)
Doug Simon <doug.simon@oracle.com>
parents:
5728
diff
changeset
|
80 import com.oracle.graal.api.code.CompilationResult.Mark; |
7144
ae69cd8c08a9
rename: RuntimeCall -> RuntimeCallTarget
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
81 import com.oracle.graal.api.code.RuntimeCallTarget.Descriptor; |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5506
diff
changeset
|
82 import com.oracle.graal.api.meta.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
83 import com.oracle.graal.graph.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
84 import com.oracle.graal.hotspot.*; |
6462 | 85 import com.oracle.graal.hotspot.bridge.*; |
7113
38076efb9062
Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7104
diff
changeset
|
86 import com.oracle.graal.hotspot.bridge.CompilerToVM.CodeInstallResult; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
87 import com.oracle.graal.hotspot.nodes.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8412
diff
changeset
|
88 import com.oracle.graal.hotspot.replacements.*; |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7130
diff
changeset
|
89 import com.oracle.graal.hotspot.stubs.*; |
7784
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
90 import com.oracle.graal.java.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
91 import com.oracle.graal.nodes.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
92 import com.oracle.graal.nodes.calc.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
93 import com.oracle.graal.nodes.extended.*; |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
94 import com.oracle.graal.nodes.extended.WriteNode.WriteBarrierType; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
95 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
|
96 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
|
97 import com.oracle.graal.nodes.spi.*; |
5076
01ffb0fc9aec
propagate stamps while lowering
Lukas Stadler <lukas.stadler@jku.at>
parents:
5067
diff
changeset
|
98 import com.oracle.graal.nodes.type.*; |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
99 import com.oracle.graal.nodes.virtual.*; |
6525
2c913b643422
rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
100 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
|
101 import com.oracle.graal.printer.*; |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
102 import com.oracle.graal.replacements.*; |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
103 import com.oracle.graal.word.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
104 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 /** |
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
|
106 * HotSpot implementation of {@link GraalCodeCacheProvider}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
107 */ |
8412
488a5f694786
removed unnecessary interface
Doug Simon <doug.simon@oracle.com>
parents:
8410
diff
changeset
|
108 public abstract class HotSpotRuntime implements GraalCodeCacheProvider, DisassemblerProvider, BytecodeDisassemblerProvider { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
109 |
9532
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
110 public static final Descriptor OSR_MIGRATION_END = new Descriptor("OSR_migration_end", true, void.class, long.class); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
111 |
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
|
112 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
|
113 |
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
|
114 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
|
115 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
|
116 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
|
117 |
5563
6a2671066204
added NewInstanceSnippets for lowering NewInstanceNodes (currently disabled by default)
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
118 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
|
119 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
|
120 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
|
121 private MonitorSnippets.Templates monitorSnippets; |
8488
225c984588ee
-Snippetization of CMS write barriers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7784
diff
changeset
|
122 private WriteBarrierSnippets.Templates writeBarrierSnippets; |
8913
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
123 private BoxingSnippets.Templates boxingSnippets; |
8643
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8642
diff
changeset
|
124 private LoadExceptionObjectSnippets.Templates exceptionObjectSnippets; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 |
7144
ae69cd8c08a9
rename: RuntimeCall -> RuntimeCallTarget
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
126 private final Map<Descriptor, HotSpotRuntimeCallTarget> runtimeCalls = new HashMap<>(); |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7130
diff
changeset
|
127 |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7130
diff
changeset
|
128 /** |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
129 * The offset from the origin of an array to the first element. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
130 * |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
131 * @return the offset in bytes |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
132 */ |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
133 public static int getArrayBaseOffset(Kind kind) { |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
134 switch (kind) { |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
135 case Boolean: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
136 return Unsafe.ARRAY_BOOLEAN_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
137 case Byte: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
138 return Unsafe.ARRAY_BYTE_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
139 case Char: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
140 return Unsafe.ARRAY_CHAR_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
141 case Short: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
142 return Unsafe.ARRAY_SHORT_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
143 case Int: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
144 return Unsafe.ARRAY_INT_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
145 case Long: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
146 return Unsafe.ARRAY_LONG_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
147 case Float: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
148 return Unsafe.ARRAY_FLOAT_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
149 case Double: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
150 return Unsafe.ARRAY_DOUBLE_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
151 case Object: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
152 return Unsafe.ARRAY_OBJECT_BASE_OFFSET; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
153 default: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
154 throw GraalInternalError.shouldNotReachHere(); |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
155 } |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
156 } |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
157 |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
158 /** |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
159 * The scale used for the index when accessing elements of an array of this kind. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
160 * |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
161 * @return the scale in order to convert the index into a byte offset |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
162 */ |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
163 public static int getArrayIndexScale(Kind kind) { |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
164 switch (kind) { |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
165 case Boolean: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
166 return Unsafe.ARRAY_BOOLEAN_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
167 case Byte: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
168 return Unsafe.ARRAY_BYTE_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
169 case Char: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
170 return Unsafe.ARRAY_CHAR_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
171 case Short: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
172 return Unsafe.ARRAY_SHORT_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
173 case Int: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
174 return Unsafe.ARRAY_INT_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
175 case Long: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
176 return Unsafe.ARRAY_LONG_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
177 case Float: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
178 return Unsafe.ARRAY_FLOAT_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
179 case Double: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
180 return Unsafe.ARRAY_DOUBLE_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
181 case Object: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
182 return Unsafe.ARRAY_OBJECT_INDEX_SCALE; |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
183 default: |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
184 throw GraalInternalError.shouldNotReachHere(); |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
185 } |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
186 } |
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7098
diff
changeset
|
187 |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
188 protected AllocatableValue ret(Kind kind) { |
7098
e23980f4a890
Cleanup of Kind class: remove isXxx methods
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7096
diff
changeset
|
189 if (kind == Kind.Void) { |
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
|
190 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
|
191 } |
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 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
|
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 |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
195 protected AllocatableValue[] javaCallingConvention(Kind... arguments) { |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
196 return callingConvention(arguments, RuntimeCall); |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
197 } |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
198 |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
199 protected AllocatableValue[] nativeCallingConvention(Kind... arguments) { |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
200 return callingConvention(arguments, NativeCall); |
7364
1489cd4eabe7
added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents:
7363
diff
changeset
|
201 } |
1489cd4eabe7
added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents:
7363
diff
changeset
|
202 |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
203 private AllocatableValue[] callingConvention(Kind[] arguments, CallingConvention.Type type) { |
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
204 AllocatableValue[] result = new AllocatableValue[arguments.length]; |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
205 |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
206 TargetDescription target = graalRuntime.getTarget(); |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
207 int currentStackOffset = 0; |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
208 for (int i = 0; i < arguments.length; i++) { |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
209 Kind kind = arguments[i]; |
9425
3ec29630cfb4
Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents:
9423
diff
changeset
|
210 Register[] ccRegs = globalStubRegConfig.getCallingConventionRegisters(type, kind); |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
211 if (i < ccRegs.length) { |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
212 result[i] = ccRegs[i].asValue(kind); |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
213 } else { |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
214 result[i] = StackSlot.get(kind.getStackKind(), currentStackOffset, false); |
9423
3426008293e7
Move getSizeInBytes method to Architecture class.
Roland Schatz <roland.schatz@oracle.com>
parents:
9421
diff
changeset
|
215 currentStackOffset += Math.max(target.arch.getSizeInBytes(kind), target.wordSize); |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
216 } |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
217 } |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
218 return result; |
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
|
219 } |
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
|
220 |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
221 public HotSpotRuntime(HotSpotVMConfig config, HotSpotGraalRuntime graalRuntime) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
222 this.config = config; |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
223 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
|
224 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
|
225 globalStubRegConfig = createRegisterConfig(true); |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
226 Kind word = graalRuntime.getTarget().wordKind; |
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
|
227 |
7522
4cc0efe5cffe
disabled auto-formatting of manually formatted code
Doug Simon <doug.simon@oracle.com>
parents:
7393
diff
changeset
|
228 // @formatter:off |
4cc0efe5cffe
disabled auto-formatting of manually formatted code
Doug Simon <doug.simon@oracle.com>
parents:
7393
diff
changeset
|
229 |
9574
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9564
diff
changeset
|
230 addStubCall(VERIFY_OOP, |
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9564
diff
changeset
|
231 /* ret */ ret(Kind.Object), |
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9564
diff
changeset
|
232 /* arg0: object */ javaCallingConvention(Kind.Object)); |
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9564
diff
changeset
|
233 |
9577
ffd3d85e055f
replaced OSR_migration_end assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9574
diff
changeset
|
234 addStubCall(OSR_MIGRATION_END, |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
235 /* ret */ ret(Kind.Void), |
9577
ffd3d85e055f
replaced OSR_migration_end assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9574
diff
changeset
|
236 /* arg0: buffer */ javaCallingConvention(word)); |
ffd3d85e055f
replaced OSR_migration_end assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9574
diff
changeset
|
237 |
9594
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
238 addCRuntimeCall(OSR_MIGRATION_END_C, config.osrMigrationEndAddress, |
9577
ffd3d85e055f
replaced OSR_migration_end assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9574
diff
changeset
|
239 /* ret */ ret(Kind.Void), |
ffd3d85e055f
replaced OSR_migration_end assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9574
diff
changeset
|
240 /* arg0: buffer */ nativeCallingConvention(word)); |
6677
3dddb311395f
hotspot infrastructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6674
diff
changeset
|
241 |
9455
62af2ee39bc5
moved initialization of UNCOMMON_TRAP descriptor from AMD64 code to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9425
diff
changeset
|
242 addRuntimeCall(UNCOMMON_TRAP, config.uncommonTrapStub, |
62af2ee39bc5
moved initialization of UNCOMMON_TRAP descriptor from AMD64 code to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9425
diff
changeset
|
243 /* temps */ null, |
62af2ee39bc5
moved initialization of UNCOMMON_TRAP descriptor from AMD64 code to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9425
diff
changeset
|
244 /* ret */ ret(Kind.Void)); |
62af2ee39bc5
moved initialization of UNCOMMON_TRAP descriptor from AMD64 code to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9425
diff
changeset
|
245 |
9562
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
246 addCRuntimeCall(EXCEPTION_HANDLER_FOR_PC, config.exceptionHandlerForPcAddress, |
9471
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
247 /* ret */ ret(word), |
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
248 /* arg0: thread */ nativeCallingConvention(word)); |
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
249 |
9562
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
250 addStubCall(UNWIND_EXCEPTION_TO_CALLER, |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
251 /* ret */ ret(Kind.Void), |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
252 /* arg0: exception */ javaCallingConvention(Kind.Object, |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
253 /* arg1: returnAddress */ word)); |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
254 |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
255 addCRuntimeCall(EXCEPTION_HANDLER_FOR_RETURN_ADDRESS, config.exceptionHandlerForReturnAddressAddress, |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
256 /* ret */ ret(word), |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
257 /* arg0: thread */ nativeCallingConvention(word, |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
258 /* arg1: returnAddress */ word)); |
9419
640d86a6bf4a
replaced register_finalizer assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9418
diff
changeset
|
259 addStubCall(REGISTER_FINALIZER, |
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
|
260 /* ret */ ret(Kind.Void), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
261 /* arg0: object */ javaCallingConvention(Kind.Object)); |
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
|
262 |
9419
640d86a6bf4a
replaced register_finalizer assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9418
diff
changeset
|
263 addCRuntimeCall(REGISTER_FINALIZER_C, config.registerFinalizerAddress, |
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
|
264 /* ret */ ret(Kind.Void), |
9419
640d86a6bf4a
replaced register_finalizer assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9418
diff
changeset
|
265 /* arg0: thread */ nativeCallingConvention(word, |
640d86a6bf4a
replaced register_finalizer assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9418
diff
changeset
|
266 /* arg1: object */ Kind.Object)); |
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
|
267 |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
268 addStubCall(NEW_ARRAY, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
269 /* ret */ ret(Kind.Object), |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
270 /* arg0: hub */ javaCallingConvention(word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
271 /* arg1: length */ Kind.Int)); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
272 |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
273 addCRuntimeCall(NEW_ARRAY_C, config.newArrayAddress, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
274 /* ret */ ret(Kind.Void), |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
275 /* arg0: thread */ nativeCallingConvention(word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
276 /* arg1: hub */ word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
277 /* arg2: length */ Kind.Int)); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
278 |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
279 addStubCall(NEW_INSTANCE, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
280 /* ret */ ret(Kind.Object), |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
281 /* arg0: hub */ javaCallingConvention(word)); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
282 |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
283 addCRuntimeCall(NEW_INSTANCE_C, config.newInstanceAddress, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
284 /* ret */ ret(Kind.Void), |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
285 /* arg0: thread */ nativeCallingConvention(word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
286 /* arg1: hub */ word)); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
287 |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
288 addStubCall(NEW_MULTI_ARRAY, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
289 /* ret */ ret(Kind.Object), |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
290 /* arg0: hub */ javaCallingConvention(word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
291 /* arg1: rank */ Kind.Int, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
292 /* arg2: dims */ word)); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
293 |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
294 addCRuntimeCall(NEW_MULTI_ARRAY_C, config.newMultiArrayAddress, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
295 /* ret */ ret(Kind.Void), |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
296 /* arg0: thread */ nativeCallingConvention(word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
297 /* arg1: hub */ word, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
298 /* arg2: rank */ Kind.Int, |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
299 /* arg3: dims */ word)); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
300 |
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
|
301 addRuntimeCall(JAVA_TIME_MILLIS, config.javaTimeMillisStub, |
8979
b87f042d1f29
Set correct temp registers for runtime calls that directly call C methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8966
diff
changeset
|
302 /* temps */ this.regConfig.getCallerSaveRegisters(), |
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
|
303 /* 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
|
304 |
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
|
305 addRuntimeCall(JAVA_TIME_NANOS, config.javaTimeNanosStub, |
8979
b87f042d1f29
Set correct temp registers for runtime calls that directly call C methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8966
diff
changeset
|
306 /* temps */ this.regConfig.getCallerSaveRegisters(), |
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
|
307 /* 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
|
308 |
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
|
309 addRuntimeCall(ARITHMETIC_SIN, config.arithmeticSinStub, |
8980
92b00825c037
Fixing more runtime call registrations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8979
diff
changeset
|
310 /* temps */ this.regConfig.getCallerSaveRegisters(), |
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
|
311 /* ret */ ret(Kind.Double), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
312 /* arg0: index */ javaCallingConvention(Kind.Double)); |
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
|
313 |
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
|
314 addRuntimeCall(ARITHMETIC_COS, config.arithmeticCosStub, |
8980
92b00825c037
Fixing more runtime call registrations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8979
diff
changeset
|
315 /* temps */ this.regConfig.getCallerSaveRegisters(), |
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
|
316 /* ret */ ret(Kind.Double), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
317 /* arg0: index */ javaCallingConvention(Kind.Double)); |
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
|
318 |
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
|
319 addRuntimeCall(ARITHMETIC_TAN, config.arithmeticTanStub, |
8980
92b00825c037
Fixing more runtime call registrations.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8979
diff
changeset
|
320 /* temps */ this.regConfig.getCallerSaveRegisters(), |
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
|
321 /* ret */ ret(Kind.Double), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
322 /* arg0: index */ javaCallingConvention(Kind.Double)); |
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
|
323 |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
324 addStubCall(LOG_PRIMITIVE, |
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
|
325 /* ret */ ret(Kind.Void), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
326 /* arg0: typeChar */ javaCallingConvention(Kind.Int, |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
327 /* arg1: value */ Kind.Long, |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
328 /* arg2: newline */ Kind.Boolean)); |
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
|
329 |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
330 addCRuntimeCall(LOG_PRIMITIVE_C, config.logPrimitiveAddress, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
331 /* ret */ ret(Kind.Void), |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
332 /* arg0: thread */ nativeCallingConvention(word, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
333 /* arg1: typeChar */ Kind.Char, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
334 /* arg2: value */ Kind.Long, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
335 /* arg3: newline */ Kind.Boolean)); |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
336 |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
337 addStubCall(LOG_PRINTF, |
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
|
338 /* ret */ ret(Kind.Void), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
339 /* arg0: format */ javaCallingConvention(Kind.Object, |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
340 /* arg1: value */ Kind.Long, |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
341 /* arg2: value */ Kind.Long, |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
342 /* arg3: value */ Kind.Long)); |
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
|
343 |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
344 addCRuntimeCall(LOG_PRINTF_C, config.logObjectAddress, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
345 /* ret */ ret(Kind.Void), |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
346 /* arg0: thread */ nativeCallingConvention(word, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
347 /* arg1: format */ Kind.Object, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
348 /* arg2: v1 */ Kind.Long, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
349 /* arg3: v2 */ Kind.Long, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
350 /* arg4: v3 */ Kind.Long)); |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
351 |
9491
789cfd153265
a compiled stub can now specify whether it needs to preserve registers. If a stub does not preserve registers and assertions are enabled, then all non-temporary registers are zapped after a C runtime call from the stub.
Doug Simon <doug.simon@oracle.com>
parents:
9480
diff
changeset
|
352 addCRuntimeCall(VM_MESSAGE_C, config.vmMessageAddress, |
9232
bb2447c64055
strings used in compiled stubs are lowered to malloc'ed C strings so that there are no embedded oops (for the strings) in the resulting installed code
Doug Simon <doug.simon@oracle.com>
parents:
9203
diff
changeset
|
353 /* ret */ ret(Kind.Void), |
9471
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
354 /* arg0: vmError */ nativeCallingConvention(Kind.Boolean, |
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
355 /* arg1: format */ word, |
9457
3e7d22d31f7e
replaced stub_printf assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9456
diff
changeset
|
356 /* arg2: value */ Kind.Long, |
9471
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
357 /* arg3: value */ Kind.Long, |
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
358 /* arg4: value */ Kind.Long)); |
9232
bb2447c64055
strings used in compiled stubs are lowered to malloc'ed C strings so that there are no embedded oops (for the strings) in the resulting installed code
Doug Simon <doug.simon@oracle.com>
parents:
9203
diff
changeset
|
359 |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
360 addStubCall(LOG_OBJECT, |
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
|
361 /* ret */ ret(Kind.Void), |
7393
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
362 /* arg0: object */ javaCallingConvention(Kind.Object, |
5f00bf5a530d
windows-specific bugfix
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7384
diff
changeset
|
363 /* arg1: flags */ Kind.Int)); |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
364 |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
365 addCRuntimeCall(LOG_OBJECT_C, config.logObjectAddress, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
366 /* ret */ ret(Kind.Void), |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
367 /* arg0: thread */ nativeCallingConvention(word, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
368 /* arg1: object */ Kind.Object, |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
369 /* arg2: flags */ Kind.Int)); |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
370 |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
371 addStubCall(THREAD_IS_INTERRUPTED, |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
372 /* ret */ ret(Kind.Boolean), |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
373 /* arg0: thread */ javaCallingConvention(Kind.Object, |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
374 /* arg1: clearInterrupted */ Kind.Boolean)); |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
375 |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
376 addCRuntimeCall(THREAD_IS_INTERRUPTED_C, config.threadIsInterruptedAddress, |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
377 /* ret */ ret(Kind.Boolean), |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
378 /* arg0: thread */ nativeCallingConvention(word, |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
379 /* arg1: receiverThread */ Kind.Object, |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
380 /* arg1: clearInterrupted */ Kind.Boolean)); |
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
381 |
9456
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
382 addRuntimeCall(DEOPT_HANDLER, config.handleDeoptStub, |
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
383 /* temps */ null, |
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
384 /* ret */ ret(Kind.Void)); |
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
385 |
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
386 addRuntimeCall(IC_MISS_HANDLER, config.inlineCacheMissStub, |
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
387 /* temps */ null, |
21ccdce289b2
moved declaration of EXCEPTION_HANDLER, DEOPT_HANDLER and IC_MISS_HANDLER descriptors to platform independent code
Doug Simon <doug.simon@oracle.com>
parents:
9455
diff
changeset
|
388 /* ret */ ret(Kind.Void)); |
9463 | 389 |
9461
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
390 addStubCall(IDENTITY_HASHCODE, |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
391 /* ret */ ret(Kind.Int), |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
392 /* arg0: obj */ javaCallingConvention(Kind.Object)); |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
393 |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
394 addCRuntimeCall(IDENTITY_HASH_CODE_C, config.identityHashCodeAddress, |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
395 /* ret */ ret(Kind.Int), |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
396 /* arg0: thread */ nativeCallingConvention(word, |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
397 /* arg1: object */ Kind.Object)); |
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
398 |
9590
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
399 addStubCall(MONITORENTER, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
400 /* ret */ ret(Kind.Void), |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
401 /* arg0: object */ javaCallingConvention(Kind.Object, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
402 /* arg1: lock */ word)); |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
403 |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
404 addCRuntimeCall(MONITORENTER_C, config.monitorenterAddress, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
405 /* ret */ ret(Kind.Void), |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
406 /* arg0: thread */ nativeCallingConvention(word, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
407 /* arg1: object */ Kind.Object, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
408 /* arg1: lock */ word)); |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
409 |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
410 addStubCall(MONITOREXIT, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
411 /* ret */ ret(Kind.Void), |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
412 /* arg0: object */ javaCallingConvention(Kind.Object, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
413 /* arg1: lock */ word)); |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
414 |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
415 addCRuntimeCall(MONITOREXIT_C, config.monitorexitAddress, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
416 /* ret */ ret(Kind.Void), |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
417 /* arg0: thread */ nativeCallingConvention(word, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
418 /* arg1: object */ Kind.Object, |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
419 /* arg1: lock */ word)); |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9577
diff
changeset
|
420 |
9591
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
421 addStubCall(CREATE_NULL_POINTER_EXCEPTION, |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
422 /* ret */ ret(Kind.Object)); |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
423 |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
424 addCRuntimeCall(CREATE_NULL_POINTER_EXCEPTION_C, config.createNullPointerExceptionAddress, |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
425 /* ret */ ret(Kind.Void), |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
426 /* arg0: thread */ nativeCallingConvention(word)); |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
427 |
9592
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
428 addStubCall(CREATE_OUT_OF_BOUNDS_EXCEPTION, |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
429 /* ret */ ret(Kind.Object), |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
430 /* arg0: index */ javaCallingConvention(Kind.Int)); |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
431 |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
432 addCRuntimeCall(CREATE_OUT_OF_BOUNDS_C, config.createOutOfBoundsExceptionAddress, |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
433 /* ret */ ret(Kind.Void), |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
434 /* arg0: thread */ nativeCallingConvention(word, |
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
435 /* arg1: index */ Kind.Int)); |
9594
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
436 |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
437 addStubCall(VM_ERROR, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
438 /* ret */ ret(Kind.Void), |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
439 /* arg0: where */ javaCallingConvention(Kind.Object, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
440 /* arg1: format */ Kind.Object, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
441 /* arg2: value */ Kind.Long)); |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
442 |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
443 addCRuntimeCall(VM_ERROR_C, config.vmErrorAddress, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
444 /* ret */ ret(Kind.Void), |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
445 /* arg0: thread */ nativeCallingConvention(word, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
446 /* arg0: where */ Kind.Object, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
447 /* arg1: format */ Kind.Object, |
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
448 /* arg2: value */ Kind.Long)); |
9595
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
449 |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
450 addStubCall(WRITE_BARRIER_PRE, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
451 /* ret */ ret(Kind.Void), |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
452 /* arg0: object */ javaCallingConvention(Kind.Object)); |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
453 |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
454 addCRuntimeCall(WRITE_BARRIER_PRE_C, config.writeBarrierPreAddress, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
455 /* ret */ ret(Kind.Void), |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
456 /* arg0: thread */ nativeCallingConvention(word, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
457 /* arg1: object */ Kind.Object)); |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
458 |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
459 addStubCall(WRITE_BARRIER_POST, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
460 /* ret */ ret(Kind.Void), |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
461 /* arg0: object */ javaCallingConvention(Kind.Object, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
462 /* arg1: card */ word)); |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
463 |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
464 addCRuntimeCall(WRITE_BARRIER_POST_C, config.writeBarrierPostAddress, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
465 /* ret */ ret(Kind.Void), |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
466 /* arg0: thread */ nativeCallingConvention(word, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
467 /* arg1: object */ Kind.Object, |
db2125285960
replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9594
diff
changeset
|
468 /* arg2: card */ word)); |
7522
4cc0efe5cffe
disabled auto-formatting of manually formatted code
Doug Simon <doug.simon@oracle.com>
parents:
7393
diff
changeset
|
469 // @formatter:on |
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
|
470 } |
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
|
471 |
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
|
472 /** |
9200
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
473 * Registers the details for linking a call to a compiled {@link Stub}. |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
474 * |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
475 * @param descriptor name and signature of the call |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
476 * @param ret where the call returns its result |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
477 * @param args where arguments are passed to the call |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
478 */ |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
479 protected RuntimeCallTarget addStubCall(Descriptor descriptor, AllocatableValue ret, AllocatableValue... args) { |
9200
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
480 return addRuntimeCall(descriptor, 0L, null, ret, args); |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
481 } |
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
482 |
9562
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
483 /** |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
484 * Registers the details for a jump to a target that has a signature (i.e. expects arguments in |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
485 * specified locations). |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
486 * |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
487 * @param descriptor name and signature of the jump target |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
488 * @param args where arguments are passed to the call |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
489 */ |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
490 protected RuntimeCallTarget addJump(Descriptor descriptor, AllocatableValue... args) { |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
491 return addRuntimeCall(descriptor, HotSpotRuntimeCallTarget.JUMP_ADDRESS, null, ret(Kind.Void), args); |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
492 } |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
493 |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
494 /** |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
495 * Registers the details for a call to a runtime C/C++ function. |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
496 * |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
497 * @param descriptor name and signature of the call |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
498 * @param args where arguments are passed to the call |
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9504
diff
changeset
|
499 */ |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
500 protected RuntimeCallTarget addCRuntimeCall(Descriptor descriptor, long address, AllocatableValue ret, AllocatableValue... args) { |
9591
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
501 assert descriptor.getResultType().isPrimitive() || Word.class.isAssignableFrom(descriptor.getResultType()) : "C runtime call cannot have Object return type - objects must be returned via thread local storage: " + |
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
502 descriptor; |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
503 return addRuntimeCall(descriptor, address, true, null, ret, args); |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
504 } |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
505 |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
506 protected RuntimeCallTarget addRuntimeCall(Descriptor descriptor, long address, Register[] tempRegs, AllocatableValue ret, AllocatableValue... args) { |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
507 return addRuntimeCall(descriptor, address, false, tempRegs, ret, args); |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
508 } |
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
509 |
9200
9be78aeab2e1
temporaries are recorded for compiled stubs, allowing for better register allocation around calls to such stubs (GRAAL-210)
Doug Simon <doug.simon@oracle.com>
parents:
9183
diff
changeset
|
510 /** |
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
|
511 * Registers the details for linking a runtime call. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
512 * |
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
|
513 * @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
|
514 * @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
|
515 * @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
|
516 * @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
|
517 * @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
|
518 */ |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
519 protected RuntimeCallTarget addRuntimeCall(Descriptor descriptor, long address, boolean isCRuntimeCall, Register[] tempRegs, AllocatableValue ret, AllocatableValue... args) { |
9296
1342574c4f7d
Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents:
9232
diff
changeset
|
520 AllocatableValue[] temps = tempRegs == null || tempRegs.length == 0 ? AllocatableValue.NONE : new AllocatableValue[tempRegs.length]; |
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
|
521 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
|
522 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
|
523 } |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
524 assert checkAssignable(descriptor.getResultType(), ret) : descriptor + " incompatible with result location " + ret; |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
525 Class[] argTypes = descriptor.getArgumentTypes(); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
526 assert argTypes.length == args.length : descriptor + " incompatible with number of argument locations: " + args.length; |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
527 for (int i = 0; i < argTypes.length; i++) { |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
528 assert checkAssignable(argTypes[i], args[i]) : descriptor + " incompatible with argument location " + i + ": " + args[i]; |
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
|
529 } |
9418
8d3a7fb9eb5f
moved binding of parameter locations to runtime call descriptors from platform specific code to shared code for stubs that are now compiled stubs
Doug Simon <doug.simon@oracle.com>
parents:
9380
diff
changeset
|
530 HotSpotRuntimeCallTarget runtimeCall = new HotSpotRuntimeCallTarget(descriptor, address, isCRuntimeCall, 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
|
531 runtimeCalls.put(descriptor, runtimeCall); |
8979
b87f042d1f29
Set correct temp registers for runtime calls that directly call C methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8966
diff
changeset
|
532 return runtimeCall; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
533 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
534 |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
535 private boolean checkAssignable(Class spec, Value value) { |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
536 Kind kind = value.getKind(); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
537 if (kind == Kind.Illegal) { |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
538 kind = Kind.Void; |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
539 } |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
540 if (WordBase.class.isAssignableFrom(spec)) { |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
541 return kind == graalRuntime.getTarget().wordKind; |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
542 } |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
543 return kind == Kind.fromJavaClass(spec); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
544 } |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
545 |
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
|
546 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
|
547 |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
548 public void registerReplacements(Replacements replacements) { |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
549 if (GraalOptions.IntrinsifyObjectMethods) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
550 replacements.registerSubstitutions(ObjectSubstitutions.class); |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
551 } |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
552 if (GraalOptions.IntrinsifySystemMethods) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
553 replacements.registerSubstitutions(SystemSubstitutions.class); |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
554 } |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
555 if (GraalOptions.IntrinsifyThreadMethods) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
556 replacements.registerSubstitutions(ThreadSubstitutions.class); |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
557 } |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
558 if (GraalOptions.IntrinsifyUnsafeMethods) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
559 replacements.registerSubstitutions(UnsafeSubstitutions.class); |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
560 } |
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
561 if (GraalOptions.IntrinsifyClassMethods) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
562 replacements.registerSubstitutions(ClassSubstitutions.class); |
7220
fcae6d960acd
added more compiler intrinsics
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7113
diff
changeset
|
563 } |
7384
d0fbdf2f7a0e
added com.sun.crypto.provider.CipherBlockChaining intrinsifications
Doug Simon <doug.simon@oracle.com>
parents:
7373
diff
changeset
|
564 if (GraalOptions.IntrinsifyAESMethods) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
565 replacements.registerSubstitutions(AESCryptSubstitutions.class); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
566 replacements.registerSubstitutions(CipherBlockChainingSubstitutions.class); |
7363
f4f3d63d35e6
AESCrypt intrinsification - disabled by default as it doesn't yet work
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
567 } |
9416 | 568 if (GraalOptions.IntrinsifyReflectionMethods) { |
569 replacements.registerSubstitutions(ReflectionSubstitutions.class); | |
570 } | |
8913
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
571 |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
572 checkcastSnippets = new CheckCastSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
573 instanceofSnippets = new InstanceOfSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
574 newObjectSnippets = new NewObjectSnippets.Templates(this, replacements, graalRuntime.getTarget(), config.useTLAB); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
575 monitorSnippets = new MonitorSnippets.Templates(this, replacements, graalRuntime.getTarget(), config.useFastLocking); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
576 writeBarrierSnippets = new WriteBarrierSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
8913
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
577 boxingSnippets = new BoxingSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
8643
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8642
diff
changeset
|
578 exceptionObjectSnippets = new LoadExceptionObjectSnippets.Templates(this, replacements, graalRuntime.getTarget()); |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7130
diff
changeset
|
579 |
9616
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
580 link(new NewInstanceStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_INSTANCE))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
581 link(new NewArrayStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_ARRAY))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
582 link(new NewMultiArrayStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(NEW_MULTI_ARRAY))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
583 link(new RegisterFinalizerStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(REGISTER_FINALIZER))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
584 link(new ThreadIsInterruptedStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(THREAD_IS_INTERRUPTED))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
585 link(new IdentityHashCodeStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(IDENTITY_HASHCODE))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
586 link(new ExceptionHandlerStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(EXCEPTION_HANDLER))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
587 link(new UnwindExceptionToCallerStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(UNWIND_EXCEPTION_TO_CALLER))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
588 link(new VerifyOopStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(VERIFY_OOP))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
589 link(new OSRMigrationEndStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(OSR_MIGRATION_END))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
590 link(new MonitorEnterStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(MONITORENTER))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
591 link(new MonitorExitStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(MONITOREXIT))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
592 link(new CreateNullPointerExceptionStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(CREATE_NULL_POINTER_EXCEPTION))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
593 link(new CreateOutOfBoundsExceptionStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(CREATE_OUT_OF_BOUNDS_EXCEPTION))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
594 link(new LogPrimitiveStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(LOG_PRIMITIVE))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
595 link(new LogObjectStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(LOG_OBJECT))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
596 link(new LogPrintfStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(LOG_PRINTF))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
597 link(new VMErrorStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(VM_ERROR))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
598 link(new WriteBarrierPreStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(WRITE_BARRIER_PRE))); |
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
599 link(new WriteBarrierPostStub(this, replacements, graalRuntime.getTarget(), runtimeCalls.get(WRITE_BARRIER_POST))); |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
600 } |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
601 |
9616
ff62d13ad3e7
removed mapping from methods to stubs in HotSpotRuntime in preparation for stubs that are not associated with a method
Doug Simon <doug.simon@oracle.com>
parents:
9605
diff
changeset
|
602 private static void link(Stub stub) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
603 stub.getLinkage().setStub(stub); |
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
|
604 } |
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
|
605 |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
606 public HotSpotGraalRuntime getGraalRuntime() { |
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
607 return graalRuntime; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
608 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
609 |
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
|
610 /** |
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
|
611 * 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
|
612 */ |
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
|
613 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
|
614 |
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
|
615 /** |
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
|
616 * 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
|
617 */ |
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
|
618 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
|
619 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
620 @Override |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
621 public String disassemble(CompilationResult compResult, InstalledCode installedCode) { |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
622 byte[] code = installedCode == null ? Arrays.copyOf(compResult.getTargetCode(), compResult.getTargetCodeSize()) : installedCode.getCode(); |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
623 long start = installedCode == null ? 0L : installedCode.getStart(); |
5780
64257cbef60c
removed compile method from GraalCodeCacheProvider interface
Doug Simon <doug.simon@oracle.com>
parents:
5776
diff
changeset
|
624 TargetDescription target = graalRuntime.getTarget(); |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
625 HexCodeFile hcf = new HexCodeFile(code, start, target.arch.getName(), target.wordSize * 8); |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
626 if (compResult != null) { |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
627 HexCodeFile.addAnnotations(hcf, compResult.getAnnotations()); |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
628 addExceptionHandlersComment(compResult, hcf); |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
629 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
|
630 RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8895
diff
changeset
|
631 for (Infopoint infopoint : compResult.getInfopoints()) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8895
diff
changeset
|
632 if (infopoint instanceof Call) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8895
diff
changeset
|
633 Call call = (Call) infopoint; |
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
|
634 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
|
635 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
|
636 } |
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
|
637 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
|
638 } else { |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8895
diff
changeset
|
639 if (infopoint.debugInfo != null) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8895
diff
changeset
|
640 hcf.addComment(infopoint.pcOffset, CodeUtil.append(new StringBuilder(100), infopoint.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
|
641 } |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8895
diff
changeset
|
642 addOperandComment(hcf, infopoint.pcOffset, "{infopoint: " + infopoint.reason + "}"); |
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
|
643 } |
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
|
644 } |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
645 for (DataPatch site : compResult.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
|
646 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
|
647 } |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
648 for (Mark mark : compResult.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
|
649 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
|
650 } |
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
|
651 } |
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
|
652 return hcf.toEmbeddedString(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
653 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
654 |
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
|
655 /** |
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
|
656 * 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
|
657 */ |
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
|
658 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
|
659 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
|
660 for (Field f : fields) { |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
661 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
|
662 f.setAccessible(true); |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
663 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
|
664 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
|
665 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
|
666 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
|
667 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
668 } catch (Exception e) { |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
669 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
670 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
671 } |
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
|
672 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
|
673 } |
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
|
674 |
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
|
675 /** |
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
|
676 * 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
|
677 */ |
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
|
678 private static String getMarkName(Mark mark) { |
6462 | 679 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
|
680 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
|
681 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
|
682 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
|
683 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
|
684 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
|
685 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
|
686 } |
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
|
687 } 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
|
688 } |
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
|
689 } |
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
|
690 } |
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
|
691 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
|
692 } |
333930100018
enhanced disassembly to decode stub addresses for runtime calls
Doug Simon <doug.simon@oracle.com>
parents:
5213
diff
changeset
|
693 |
9301
ba441e21796f
rename variable that reflected legacy type name
Doug Simon <doug.simon@oracle.com>
parents:
9232
diff
changeset
|
694 private static void addExceptionHandlersComment(CompilationResult compResult, HexCodeFile hcf) { |
ba441e21796f
rename variable that reflected legacy type name
Doug Simon <doug.simon@oracle.com>
parents:
9232
diff
changeset
|
695 if (!compResult.getExceptionHandlers().isEmpty()) { |
4291
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
696 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
|
697 StringBuilder buf = new StringBuilder("------ Exception Handlers ------").append(nl); |
9301
ba441e21796f
rename variable that reflected legacy type name
Doug Simon <doug.simon@oracle.com>
parents:
9232
diff
changeset
|
698 for (CompilationResult.ExceptionHandler e : compResult.getExceptionHandlers()) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
699 buf.append(" ").append(e.pcOffset).append(" -> ").append(e.handlerPos).append(nl); |
5241
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
700 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
|
701 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
|
702 } |
4291
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
703 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
|
704 } |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
705 } |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
706 |
015c53fefd3a
Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4262
diff
changeset
|
707 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
|
708 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
|
709 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
|
710 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
711 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
712 @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
|
713 public ResolvedJavaType lookupJavaType(Constant constant) { |
7098
e23980f4a890
Cleanup of Kind class: remove isXxx methods
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7096
diff
changeset
|
714 if (constant.getKind() != Kind.Object || constant.isNull()) { |
7015
62818f156081
added ResolvedJavaType.isClass(Class c) to replace some uses of ResolvedJavaType.toJava()
Doug Simon <doug.simon@oracle.com>
parents:
7001
diff
changeset
|
715 return null; |
62818f156081
added ResolvedJavaType.isClass(Class c) to replace some uses of ResolvedJavaType.toJava()
Doug Simon <doug.simon@oracle.com>
parents:
7001
diff
changeset
|
716 } |
62818f156081
added ResolvedJavaType.isClass(Class c) to replace some uses of ResolvedJavaType.toJava()
Doug Simon <doug.simon@oracle.com>
parents:
7001
diff
changeset
|
717 Object o = constant.asObject(); |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7083
diff
changeset
|
718 return HotSpotResolvedObjectType.fromClass(o.getClass()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
719 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
720 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
721 @Override |
7359
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
722 public Signature parseMethodDescriptor(String signature) { |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
723 return new HotSpotSignature(signature); |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
724 } |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
725 |
6a16788a29a6
added API method for parsing a valid Method Descriptor string (JVMS 4.3.3) into a Signature object
Doug Simon <doug.simon@oracle.com>
parents:
7356
diff
changeset
|
726 @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
|
727 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
|
728 return x.equals(y); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
729 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
730 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
731 @Override |
7838
a063308816d9
Complete first PTX unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7836
diff
changeset
|
732 public RegisterConfig lookupRegisterConfig() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
733 return regConfig; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
734 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
735 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
736 @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
|
737 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
|
738 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
|
739 } |
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
|
740 |
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
|
741 @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
|
742 public int lookupArrayLength(Constant array) { |
7098
e23980f4a890
Cleanup of Kind class: remove isXxx methods
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7096
diff
changeset
|
743 if (array.getKind() != Kind.Object || array.isNull() || !array.asObject().getClass().isArray()) { |
7015
62818f156081
added ResolvedJavaType.isClass(Class c) to replace some uses of ResolvedJavaType.toJava()
Doug Simon <doug.simon@oracle.com>
parents:
7001
diff
changeset
|
744 throw new IllegalArgumentException(array + " is not an array"); |
62818f156081
added ResolvedJavaType.isClass(Class c) to replace some uses of ResolvedJavaType.toJava()
Doug Simon <doug.simon@oracle.com>
parents:
7001
diff
changeset
|
745 } |
62818f156081
added ResolvedJavaType.isClass(Class c) to replace some uses of ResolvedJavaType.toJava()
Doug Simon <doug.simon@oracle.com>
parents:
7001
diff
changeset
|
746 return Array.getLength(array.asObject()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
747 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
748 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
749 @Override |
5718
10341299528c
renamings: ExtendedRiRuntime -> GraalCodeCacheProvider, CiLoweringTool -> LoweringTool, RiGraphCache -> GraphCache
Doug Simon <doug.simon@oracle.com>
parents:
5705
diff
changeset
|
750 public void lower(Node n, LoweringTool tool) { |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
751 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
|
752 Kind wordKind = graalRuntime.getTarget().wordKind; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
753 if (n instanceof ArrayLengthNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
754 ArrayLengthNode arrayLengthNode = (ArrayLengthNode) n; |
8543
354d729ae588
remove SafeAccessNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
8521
diff
changeset
|
755 ValueNode array = arrayLengthNode.array(); |
9203
f78437ffb8d3
Restructure class hierarchy of LocationNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
9200
diff
changeset
|
756 ReadNode arrayLengthRead = graph.add(new ReadNode(array, ConstantLocationNode.create(LocationNode.FINAL_LOCATION, Kind.Int, config.arrayLengthOffset, graph), StampFactory.positiveInt())); |
9376
ee75b4f569ed
Don't create null check guard if object is kown to be non-null.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9355
diff
changeset
|
757 tool.createNullCheckGuard(arrayLengthRead.dependencies(), array); |
8543
354d729ae588
remove SafeAccessNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
8521
diff
changeset
|
758 graph.replaceFixedWithFixed(arrayLengthNode, arrayLengthRead); |
5822
ec65d0d0c873
moved HIR lowering of Invokes into HotspotRuntime
Doug Simon <doug.simon@oracle.com>
parents:
5780
diff
changeset
|
759 } 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
|
760 Invoke invoke = (Invoke) n; |
6462 | 761 if (invoke.callTarget() instanceof MethodCallTargetNode) { |
9147
07f05f2a8149
Remove methodCallTarget() method from the Invoke interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9106
diff
changeset
|
762 MethodCallTargetNode callTarget = (MethodCallTargetNode) invoke.callTarget(); |
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
|
763 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
|
764 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
|
765 if (!callTarget.isStatic() && receiver.kind() == Kind.Object && !receiver.objectStamp().nonNull()) { |
9376
ee75b4f569ed
Don't create null check guard if object is kown to be non-null.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9355
diff
changeset
|
766 tool.createNullCheckGuard(invoke.asNode().dependencies(), receiver); |
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
|
767 } |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7278
diff
changeset
|
768 JavaType[] signature = MetaUtil.signatureToTypes(callTarget.targetMethod().getSignature(), callTarget.isStatic() ? null : callTarget.targetMethod().getDeclaringClass()); |
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
|
769 |
9147
07f05f2a8149
Remove methodCallTarget() method from the Invoke interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9106
diff
changeset
|
770 LoweredCallTargetNode loweredCallTarget = null; |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
771 if (callTarget.invokeKind() == InvokeKind.Virtual && GraalOptions.InlineVTableStubs && (GraalOptions.AlwaysInlineVTableStubs || invoke.isPolymorphic())) { |
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
|
772 |
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
|
773 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
|
774 if (!hsMethod.getDeclaringClass().isInterface()) { |
9636
ff4e8218d3dd
Remove hasVtableEntry, use isInVirtualMethodTable instead
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9619
diff
changeset
|
775 if (hsMethod.isInVirtualMethodTable()) { |
9610
ae17e540c5d2
More asserts while getting vtable offsets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9608
diff
changeset
|
776 int vtableEntryOffset = hsMethod.vtableEntryOffset(); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
777 assert vtableEntryOffset > 0; |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
778 ReadNode hub = this.createReadHub(tool, graph, wordKind, receiver); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
779 ReadNode metaspaceMethod = createReadVirtualMethod(graph, wordKind, hub, hsMethod); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
780 // We use LocationNode.ANY_LOCATION for the reads that access the |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
781 // compiled code entry as HotSpot does not guarantee they are final |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
782 // values. |
9203
f78437ffb8d3
Restructure class hierarchy of LocationNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
9200
diff
changeset
|
783 ReadNode compiledEntry = graph.add(new ReadNode(metaspaceMethod, ConstantLocationNode.create(LocationNode.ANY_LOCATION, wordKind, config.methodCompiledEntryOffset, graph), |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
784 StampFactory.forKind(wordKind()))); |
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
|
785 |
9089
5ab06146e985
Rename "node()" methods in interfaces to "asNode"
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9027
diff
changeset
|
786 loweredCallTarget = graph.add(new HotSpotIndirectCallTargetNode(metaspaceMethod, compiledEntry, parameters, invoke.asNode().stamp(), signature, callTarget.targetMethod(), |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
787 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
|
788 |
9089
5ab06146e985
Rename "node()" methods in interfaces to "asNode"
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9027
diff
changeset
|
789 graph.addBeforeFixed(invoke.asNode(), hub); |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
790 graph.addAfterFixed(hub, metaspaceMethod); |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
791 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
|
792 } |
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
|
793 } |
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
|
794 } |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
795 |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
796 if (loweredCallTarget == null) { |
9089
5ab06146e985
Rename "node()" methods in interfaces to "asNode"
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9027
diff
changeset
|
797 loweredCallTarget = graph.add(new HotSpotDirectCallTargetNode(parameters, invoke.asNode().stamp(), signature, callTarget.targetMethod(), CallingConvention.Type.JavaCall, |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
798 callTarget.invokeKind())); |
6409
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
799 } |
823a2978e7ba
Lowering of call targets to direct / indirect call targets
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6404
diff
changeset
|
800 callTarget.replaceAndDelete(loweredCallTarget); |
5822
ec65d0d0c873
moved HIR lowering of Invokes into HotspotRuntime
Doug Simon <doug.simon@oracle.com>
parents:
5780
diff
changeset
|
801 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
802 } else if (n instanceof LoadFieldNode) { |
7104
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
803 LoadFieldNode loadField = (LoadFieldNode) n; |
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
804 HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) loadField.field(); |
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
805 ValueNode object = loadField.isStatic() ? ConstantNode.forObject(field.getDeclaringClass().mirror(), this, graph) : loadField.object(); |
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
806 assert loadField.kind() != Kind.Illegal; |
9500
9cc37ce426cc
factor out createFieldLocation in HotSpotRuntime
Lukas Stadler <lukas.stadler@jku.at>
parents:
9491
diff
changeset
|
807 ReadNode memoryRead = graph.add(new ReadNode(object, createFieldLocation(graph, field), loadField.stamp())); |
9376
ee75b4f569ed
Don't create null check guard if object is kown to be non-null.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9355
diff
changeset
|
808 tool.createNullCheckGuard(memoryRead.dependencies(), object); |
8502
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
809 |
7104
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
810 graph.replaceFixedWithFixed(loadField, memoryRead); |
8502
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
811 |
7104
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
812 if (loadField.isVolatile()) { |
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
|
813 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
|
814 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
|
815 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
|
816 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
|
817 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
818 } else if (n instanceof StoreFieldNode) { |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
819 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
|
820 HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) storeField.field(); |
7104
5c25483b5515
Remove the ResolvedJavaType.Representation for static fields. It is not necessary to emit the constant holder for static fields in the GraphBuilder. Only the VM-specific lowering needs to create the constants, and it can access the VM-specific metadata objects directly.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7099
diff
changeset
|
821 ValueNode object = storeField.isStatic() ? ConstantNode.forObject(field.getDeclaringClass().mirror(), this, graph) : storeField.object(); |
9174
f6a8efb8d104
Better naming for WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9147
diff
changeset
|
822 WriteBarrierType barrierType = getFieldStoreBarrierType(storeField); |
9500
9cc37ce426cc
factor out createFieldLocation in HotSpotRuntime
Lukas Stadler <lukas.stadler@jku.at>
parents:
9491
diff
changeset
|
823 WriteNode memoryWrite = graph.add(new WriteNode(object, storeField.value(), createFieldLocation(graph, field), barrierType)); |
9376
ee75b4f569ed
Don't create null check guard if object is kown to be non-null.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9355
diff
changeset
|
824 tool.createNullCheckGuard(memoryWrite.dependencies(), object); |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
825 memoryWrite.setStateAfter(storeField.stateAfter()); |
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
826 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
|
827 FixedWithNextNode last = memoryWrite; |
8501
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8498
diff
changeset
|
828 FixedWithNextNode first = memoryWrite; |
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8498
diff
changeset
|
829 |
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
|
830 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
|
831 MembarNode preMembar = graph.add(new MembarNode(JMM_PRE_VOLATILE_WRITE)); |
8501
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8498
diff
changeset
|
832 graph.addBeforeFixed(first, preMembar); |
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
|
833 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
|
834 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
|
835 } |
591f8231aa82
removed XIR & LIR code for nodes that are completely lowered in HotspotRuntime.lower()
Doug Simon <doug.simon@oracle.com>
parents:
5160
diff
changeset
|
836 } 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
|
837 // 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
|
838 CompareAndSwapNode cas = (CompareAndSwapNode) n; |
9183
34eba4e78a0a
Attach LocationNode to CompareAndSwapNode
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9175
diff
changeset
|
839 LocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, cas.expected().kind(), cas.displacement(), cas.offset(), graph, 1); |
34eba4e78a0a
Attach LocationNode to CompareAndSwapNode
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9175
diff
changeset
|
840 cas.setLocation(location); |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
841 cas.setWriteBarrierType(getCompareAndSwapBarrier(cas)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
842 } else if (n instanceof LoadIndexedNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
843 LoadIndexedNode loadIndexed = (LoadIndexedNode) n; |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
844 ValueNode boundsCheck = createBoundsCheck(loadIndexed, tool); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
845 Kind elementKind = loadIndexed.elementKind(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
846 LocationNode arrayLocation = createArrayLocation(graph, elementKind, loadIndexed.index()); |
5076
01ffb0fc9aec
propagate stamps while lowering
Lukas Stadler <lukas.stadler@jku.at>
parents:
5067
diff
changeset
|
847 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
|
848 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
|
849 graph.replaceFixedWithFixed(loadIndexed, memoryRead); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
850 } else if (n instanceof StoreIndexedNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
851 StoreIndexedNode storeIndexed = (StoreIndexedNode) n; |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
852 ValueNode boundsCheck = createBoundsCheck(storeIndexed, tool); |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
853 Kind elementKind = storeIndexed.elementKind(); |
8521
6aa080855d7c
-Bug fixes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8517
diff
changeset
|
854 LocationNode arrayLocation = createArrayLocation(graph, elementKind, storeIndexed.index()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
855 ValueNode value = storeIndexed.value(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
856 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
|
857 if (elementKind == Kind.Object && !value.objectStamp().alwaysNull()) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
858 // 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
|
859 ResolvedJavaType arrayType = array.objectStamp().type(); |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5426
diff
changeset
|
860 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
|
861 ResolvedJavaType elementType = arrayType.getComponentType(); |
7096
585fc9f79ebc
Remove ResolvedJavaType.isClass()
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7090
diff
changeset
|
862 if (!MetaUtil.isJavaLangObject(elementType)) { |
9478
fb22b4d5f475
Allow distinction between ClassCastException and ArrayStoreException. Add more canonicalizations for check casts.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9460
diff
changeset
|
863 CheckCastNode checkcast = graph.add(new CheckCastNode(elementType, value, null, true)); |
5372
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
864 graph.addBeforeFixed(storeIndexed, checkcast); |
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
865 value = checkcast; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
866 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
867 } else { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
868 LoadHubNode arrayClass = graph.add(new LoadHubNode(array, wordKind)); |
9203
f78437ffb8d3
Restructure class hierarchy of LocationNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
9200
diff
changeset
|
869 LocationNode location = ConstantLocationNode.create(LocationNode.FINAL_LOCATION, wordKind, config.arrayClassElementOffset, graph); |
7034
89df4e71940a
More flexible handling of stamp for word type: Define a singleton Stamp instance for words that is then re-written to the target-specific primitive word stamp by the WordTypeRewriterPhase. This allows nodes to have a word stamp without any dependency on global or static state.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7017
diff
changeset
|
870 FloatingReadNode arrayElementKlass = graph.unique(new FloatingReadNode(arrayClass, location, null, StampFactory.forKind(wordKind()))); |
9478
fb22b4d5f475
Allow distinction between ClassCastException and ArrayStoreException. Add more canonicalizations for check casts.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9460
diff
changeset
|
871 CheckCastDynamicNode checkcast = graph.add(new CheckCastDynamicNode(arrayElementKlass, value, true)); |
5372
4485e0edd1af
made CheckCastNode be a FixedNode instead of a BooleanNode
Doug Simon <doug.simon@oracle.com>
parents:
5360
diff
changeset
|
872 graph.addBeforeFixed(storeIndexed, checkcast); |
6463
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
873 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
|
874 value = checkcast; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
875 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
876 } |
9174
f6a8efb8d104
Better naming for WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9147
diff
changeset
|
877 WriteBarrierType barrierType = getArrayStoreBarrierType(storeIndexed); |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
878 WriteNode memoryWrite = graph.add(new WriteNode(array, value, arrayLocation, barrierType)); |
5387
b6aaf6de4053
use dependencies collection instead of explicit guard fields
Lukas Stadler <lukas.stadler@jku.at>
parents:
5372
diff
changeset
|
879 memoryWrite.dependencies().add(boundsCheck); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
880 memoryWrite.setStateAfter(storeIndexed.stateAfter()); |
4309
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
881 graph.replaceFixedWithFixed(storeIndexed, memoryWrite); |
4a609a685fa4
changes to Node structures:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4305
diff
changeset
|
882 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
883 } else if (n instanceof UnsafeLoadNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
884 UnsafeLoadNode load = (UnsafeLoadNode) n; |
5540
a891c53a295b
Renaming RiKind => Kind.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
885 assert load.kind() != Kind.Illegal; |
7827
961ad124cb21
Convert indexScalingEnabled boolean into an indexScaling integer value. This change removed the dependency on TargetDescription in large parts of the system.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7814
diff
changeset
|
886 IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, load.accessKind(), load.displacement(), load.offset(), graph, 1); |
5076
01ffb0fc9aec
propagate stamps while lowering
Lukas Stadler <lukas.stadler@jku.at>
parents:
5067
diff
changeset
|
887 ReadNode memoryRead = graph.add(new ReadNode(load.object(), location, load.stamp())); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
888 // An unsafe read must not floating outside its block as may float above an explicit |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
889 // null check on its object. |
9436
ae815a4c112a
Rename BeginNode => AbstractBeginNode and make abstract. Introduce concrete subclass BeginNode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9380
diff
changeset
|
890 memoryRead.dependencies().add(AbstractBeginNode.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
|
891 graph.replaceFixedWithFixed(load, memoryRead); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
892 } else if (n instanceof UnsafeStoreNode) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
893 UnsafeStoreNode store = (UnsafeStoreNode) n; |
7827
961ad124cb21
Convert indexScalingEnabled boolean into an indexScaling integer value. This change removed the dependency on TargetDescription in large parts of the system.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7814
diff
changeset
|
894 IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, store.accessKind(), store.displacement(), store.offset(), graph, 1); |
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
|
895 ValueNode object = store.object(); |
9174
f6a8efb8d104
Better naming for WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9147
diff
changeset
|
896 WriteBarrierType barrierType = getUnsafeStoreBarrierType(store); |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
897 WriteNode write = graph.add(new WriteNode(object, store.value(), location, barrierType)); |
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
|
898 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
|
899 graph.replaceFixedWithFixed(store, write); |
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
|
900 } 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
|
901 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
|
902 assert loadHub.kind() == wordKind; |
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
|
903 ValueNode object = loadHub.object(); |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
904 ReadNode hub = createReadHub(tool, graph, wordKind, object); |
6463
41f0849e107b
reverted LoadHubNode to be a fixed node
Doug Simon <doug.simon@oracle.com>
parents:
6462
diff
changeset
|
905 graph.replaceFixed(loadHub, hub); |
9377
0f4041cc6be1
First draft of node for loading a method from the vtable of a hub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9376
diff
changeset
|
906 } else if (n instanceof LoadMethodNode) { |
0f4041cc6be1
First draft of node for loading a method from the vtable of a hub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9376
diff
changeset
|
907 LoadMethodNode loadMethodNode = (LoadMethodNode) n; |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
908 ResolvedJavaMethod method = loadMethodNode.getMethod(); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
909 ReadNode metaspaceMethod = createReadVirtualMethod(graph, wordKind, loadMethodNode.getHub(), method); |
9377
0f4041cc6be1
First draft of node for loading a method from the vtable of a hub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9376
diff
changeset
|
910 graph.replaceFixed(loadMethodNode, metaspaceMethod); |
7130
3a2f8b313bc5
Allow VM-specific lowering of FixedGuardNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7113
diff
changeset
|
911 } else if (n instanceof FixedGuardNode) { |
3a2f8b313bc5
Allow VM-specific lowering of FixedGuardNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7113
diff
changeset
|
912 FixedGuardNode node = (FixedGuardNode) n; |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7558
diff
changeset
|
913 ValueAnchorNode newAnchor = graph.add(new ValueAnchorNode(tool.createGuard(node.condition(), node.getReason(), node.getAction(), node.isNegated()))); |
7130
3a2f8b313bc5
Allow VM-specific lowering of FixedGuardNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7113
diff
changeset
|
914 graph.replaceFixedWithFixed(node, newAnchor); |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
915 } else if (n instanceof CommitAllocationNode) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
916 CommitAllocationNode commit = (CommitAllocationNode) n; |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
917 |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
918 ValueNode[] allocations = new ValueNode[commit.getVirtualObjects().size()]; |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
919 for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
920 VirtualObjectNode virtual = commit.getVirtualObjects().get(objIndex); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
921 int entryCount = virtual.entryCount(); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
922 |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
923 FixedWithNextNode newObject; |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
924 if (virtual instanceof VirtualInstanceNode) { |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
925 newObject = graph.add(new NewInstanceNode(virtual.type(), true)); |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
926 } else { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
927 ResolvedJavaType element = ((VirtualArrayNode) virtual).componentType(); |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
928 newObject = graph.add(new NewArrayNode(element, ConstantNode.forInt(entryCount, graph), true)); |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
929 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
930 graph.addBeforeFixed(commit, newObject); |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
931 allocations[objIndex] = newObject; |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
932 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
933 int valuePos = 0; |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
934 for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
935 VirtualObjectNode virtual = commit.getVirtualObjects().get(objIndex); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
936 int entryCount = virtual.entryCount(); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
937 |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
938 ValueNode newObject = allocations[objIndex]; |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
939 if (virtual instanceof VirtualInstanceNode) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
940 VirtualInstanceNode instance = (VirtualInstanceNode) virtual; |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
941 for (int i = 0; i < entryCount; i++) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
942 ValueNode value = commit.getValues().get(valuePos++); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
943 if (value instanceof VirtualObjectNode) { |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
944 value = allocations[commit.getVirtualObjects().indexOf(value)]; |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
945 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
946 graph.addBeforeFixed(commit, graph.add(new WriteNode(newObject, value, createFieldLocation(graph, (HotSpotResolvedJavaField) instance.field(i)), WriteBarrierType.NONE))); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
947 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
948 } else { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
949 VirtualArrayNode array = (VirtualArrayNode) virtual; |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
950 ResolvedJavaType element = array.componentType(); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
951 for (int i = 0; i < entryCount; i++) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
952 ValueNode value = commit.getValues().get(valuePos++); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
953 if (value instanceof VirtualObjectNode) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
954 int indexOf = commit.getVirtualObjects().indexOf(value); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
955 assert indexOf != -1 : commit + " " + value; |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
956 value = allocations[indexOf]; |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
957 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
958 graph.addBeforeFixed(commit, graph.add(new WriteNode(newObject, value, createArrayLocation(graph, element.getKind(), ConstantNode.forInt(i, graph)), WriteBarrierType.NONE))); |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
959 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
960 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
961 } |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
962 for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) { |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
963 FixedValueAnchorNode anchor = graph.add(new FixedValueAnchorNode(allocations[objIndex])); |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
964 allocations[objIndex] = anchor; |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
965 graph.addBeforeFixed(commit, anchor); |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
966 } |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
967 for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) { |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
968 for (int lockDepth : commit.getLocks().get(objIndex)) { |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
969 MonitorEnterNode enter = graph.add(new MonitorEnterNode(allocations[objIndex], lockDepth)); |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
970 graph.addBeforeFixed(commit, enter); |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
971 } |
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
972 } |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
973 for (Node usage : commit.usages().snapshot()) { |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
974 AllocatedObjectNode addObject = (AllocatedObjectNode) usage; |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
975 int index = commit.getVirtualObjects().indexOf(addObject.getVirtualObject()); |
9504
106f0a0acafa
refactored monitor handling in EA: MonitorEnter/Exit is removed, not eliminated
Lukas Stadler <lukas.stadler@jku.at>
parents:
9502
diff
changeset
|
976 graph.replaceFloating(addObject, allocations[index]); |
9501
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
977 } |
bef43373de39
coalesce allocations during escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
9500
diff
changeset
|
978 graph.removeFixed(commit); |
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
|
979 } else if (n instanceof CheckCastNode) { |
6462 | 980 checkcastSnippets.lower((CheckCastNode) n, tool); |
9532
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
981 } else if (n instanceof OSRStartNode) { |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
982 OSRStartNode osrStart = (OSRStartNode) n; |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
983 StartNode newStart = graph.add(new StartNode()); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
984 LocalNode buffer = graph.unique(new LocalNode(0, StampFactory.forKind(wordKind()))); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
985 RuntimeCallNode migrationEnd = graph.add(new RuntimeCallNode(OSR_MIGRATION_END, buffer)); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
986 migrationEnd.setStateAfter(osrStart.stateAfter()); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
987 |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
988 newStart.setNext(migrationEnd); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
989 FixedNode next = osrStart.next(); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
990 osrStart.setNext(null); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
991 migrationEnd.setNext(next); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
992 graph.setStart(newStart); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
993 |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
994 // mirroring the calculations in c1_GraphBuilder.cpp (setup_osr_entry_block) |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
995 int localsOffset = (graph.method().getMaxLocals() - 1) * 8; |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
996 for (OSRLocalNode osrLocal : graph.getNodes(OSRLocalNode.class)) { |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
997 int size = FrameStateBuilder.stackSlots(osrLocal.kind()); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
998 int offset = localsOffset - (osrLocal.index() + size - 1) * 8; |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
999 UnsafeLoadNode load = graph.add(new UnsafeLoadNode(buffer, offset, ConstantNode.forInt(0, graph), osrLocal.kind())); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
1000 osrLocal.replaceAndDelete(load); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
1001 graph.addBeforeFixed(migrationEnd, load); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
1002 } |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
1003 osrStart.replaceAtUsages(newStart); |
8f854c4deabf
Delay lowering of the platform specific OSR entry
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9504
diff
changeset
|
1004 osrStart.safeDelete(); |
6648
7bf5a6c42db7
factored CheckCastDynamicNode out of CheckCastNode
Doug Simon <doug.simon@oracle.com>
parents:
6582
diff
changeset
|
1005 } else if (n instanceof CheckCastDynamicNode) { |
7bf5a6c42db7
factored CheckCastDynamicNode out of CheckCastNode
Doug Simon <doug.simon@oracle.com>
parents:
6582
diff
changeset
|
1006 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
|
1007 } else if (n instanceof InstanceOfNode) { |
6462 | 1008 instanceofSnippets.lower((InstanceOfNode) n, tool); |
7278
346336325337
added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents:
7235
diff
changeset
|
1009 } else if (n instanceof InstanceOfDynamicNode) { |
346336325337
added intrinsification of Class.isInstance()
Doug Simon <doug.simon@oracle.com>
parents:
7235
diff
changeset
|
1010 instanceofSnippets.lower((InstanceOfDynamicNode) n, tool); |
5563
6a2671066204
added NewInstanceSnippets for lowering NewInstanceNodes (currently disabled by default)
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
1011 } else if (n instanceof NewInstanceNode) { |
6462 | 1012 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
|
1013 } else if (n instanceof NewArrayNode) { |
6462 | 1014 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
|
1015 } else if (n instanceof MonitorEnterNode) { |
6462 | 1016 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
|
1017 } else if (n instanceof MonitorExitNode) { |
6462 | 1018 monitorSnippets.lower((MonitorExitNode) n, tool); |
8905
c502db57e687
Rename ArrayWriteBarrier to SerialWriteBarrier and move it to graal.nodes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8904
diff
changeset
|
1019 } else if (n instanceof SerialWriteBarrier) { |
c502db57e687
Rename ArrayWriteBarrier to SerialWriteBarrier and move it to graal.nodes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8904
diff
changeset
|
1020 writeBarrierSnippets.lower((SerialWriteBarrier) n, tool); |
8963
63eae4723b18
Creation of snippets for ArrayCopy write barriers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8935
diff
changeset
|
1021 } else if (n instanceof SerialArrayRangeWriteBarrier) { |
63eae4723b18
Creation of snippets for ArrayCopy write barriers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8935
diff
changeset
|
1022 writeBarrierSnippets.lower((SerialArrayRangeWriteBarrier) 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
|
1023 } 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
|
1024 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
|
1025 } 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
|
1026 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
|
1027 } 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
|
1028 newObjectSnippets.lower((InitializeArrayNode) n, tool); |
6431
2e376f8ea4e2
added snippet for lowering NewMultiArrayNodes
Doug Simon <doug.simon@oracle.com>
parents:
6409
diff
changeset
|
1029 } else if (n instanceof NewMultiArrayNode) { |
6462 | 1030 newObjectSnippets.lower((NewMultiArrayNode) n, tool); |
8643
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8642
diff
changeset
|
1031 } else if (n instanceof LoadExceptionObjectNode) { |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8642
diff
changeset
|
1032 exceptionObjectSnippets.lower((LoadExceptionObjectNode) n); |
7305
cd205ca515dd
Make integer division and remainder nodes fixed so that they can be lowered via snippets to do exception checks
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7300
diff
changeset
|
1033 } else if (n instanceof IntegerDivNode || n instanceof IntegerRemNode || n instanceof UnsignedDivNode || n instanceof UnsignedRemNode) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1034 // Nothing to do for division nodes. The HotSpot signal handler catches divisions by |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1035 // zero and the MIN_VALUE / -1 cases. |
9016
60b9fe7034e6
Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9015
diff
changeset
|
1036 } else if (n instanceof UnwindNode || n instanceof DeoptimizeNode) { |
8357
5fbb2df2b47f
Allow lowering of UnwindNode and ExceptionObjectNode. The HotSpot code still uses the old LIR lowering.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8217
diff
changeset
|
1037 // Nothing to do, using direct LIR lowering for these nodes. |
8913
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
1038 } else if (n instanceof BoxNode) { |
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
1039 boxingSnippets.lower((BoxNode) n); |
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
1040 } else if (n instanceof UnboxNode) { |
653110156f8a
refactored boxing identification and lowering, removed BoxingMethodPool and explicit boxing phases
Lukas Stadler <lukas.stadler@jku.at>
parents:
8627
diff
changeset
|
1041 boxingSnippets.lower((UnboxNode) n); |
5241
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
1042 } else { |
e24167877471
conditional support for translating ExceptionObjectNode without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
1043 assert false : "Node implementing Lowerable not handled: " + n; |
7076 | 1044 throw GraalInternalError.shouldNotReachHere(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1045 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1046 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1047 |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1048 private static ReadNode createReadVirtualMethod(StructuredGraph graph, Kind wordKind, ValueNode hub, ResolvedJavaMethod method) { |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1049 HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) method; |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1050 assert !hsMethod.getDeclaringClass().isInterface(); |
9636
ff4e8218d3dd
Remove hasVtableEntry, use isInVirtualMethodTable instead
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9619
diff
changeset
|
1051 assert hsMethod.isInVirtualMethodTable(); |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1052 |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1053 int vtableEntryOffset = hsMethod.vtableEntryOffset(); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1054 assert vtableEntryOffset > 0; |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1055 // We use LocationNode.ANY_LOCATION for the reads that access the vtable |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1056 // entry as HotSpot does not guarantee that this is a final value. |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1057 ReadNode metaspaceMethod = graph.add(new ReadNode(hub, ConstantLocationNode.create(LocationNode.ANY_LOCATION, wordKind, vtableEntryOffset, graph), StampFactory.forKind(wordKind()))); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1058 return metaspaceMethod; |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1059 } |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1060 |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1061 private ReadNode createReadHub(LoweringTool tool, StructuredGraph graph, Kind wordKind, ValueNode object) { |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1062 LocationNode location = ConstantLocationNode.create(LocationNode.FINAL_LOCATION, wordKind, config.hubOffset, graph); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1063 assert !object.isConstant() || object.asConstant().isNull(); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1064 ReadNode hub = graph.add(new ReadNode(object, location, StampFactory.forKind(wordKind()))); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1065 tool.createNullCheckGuard(hub.dependencies(), object); |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1066 return hub; |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1067 } |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9377
diff
changeset
|
1068 |
9174
f6a8efb8d104
Better naming for WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9147
diff
changeset
|
1069 private static WriteBarrierType getFieldStoreBarrierType(StoreFieldNode storeField) { |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1070 WriteBarrierType barrierType = WriteBarrierType.NONE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1071 if (storeField.field().getKind() == Kind.Object && !storeField.value().objectStamp().alwaysNull()) { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1072 barrierType = WriteBarrierType.IMPRECISE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1073 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1074 return barrierType; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1075 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1076 |
9174
f6a8efb8d104
Better naming for WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9147
diff
changeset
|
1077 private static WriteBarrierType getArrayStoreBarrierType(StoreIndexedNode store) { |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1078 WriteBarrierType barrierType = WriteBarrierType.NONE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1079 if (store.elementKind() == Kind.Object && !store.value().objectStamp().alwaysNull()) { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1080 barrierType = WriteBarrierType.PRECISE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1081 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1082 return barrierType; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1083 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1084 |
9174
f6a8efb8d104
Better naming for WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9147
diff
changeset
|
1085 private static WriteBarrierType getUnsafeStoreBarrierType(UnsafeStoreNode store) { |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1086 WriteBarrierType barrierType = WriteBarrierType.NONE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1087 if (store.value().kind() == Kind.Object && !store.value().objectStamp().alwaysNull()) { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1088 ResolvedJavaType type = store.object().objectStamp().type(); |
9175
5248c53f9978
Remove redundant checks from WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9174
diff
changeset
|
1089 if (type != null && type.isArray()) { |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1090 barrierType = WriteBarrierType.PRECISE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1091 } else { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1092 barrierType = WriteBarrierType.IMPRECISE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1093 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1094 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1095 return barrierType; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1096 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1097 |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1098 private static WriteBarrierType getCompareAndSwapBarrier(CompareAndSwapNode cas) { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1099 WriteBarrierType barrierType = WriteBarrierType.NONE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1100 if (cas.expected().kind() == Kind.Object && !cas.newValue().objectStamp().alwaysNull()) { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1101 ResolvedJavaType type = cas.object().objectStamp().type(); |
9175
5248c53f9978
Remove redundant checks from WriteBarrierType get-functions
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9174
diff
changeset
|
1102 if (type != null && type.isArray()) { |
9105
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1103 barrierType = WriteBarrierType.PRECISE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1104 } else { |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1105 barrierType = WriteBarrierType.IMPRECISE; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1106 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1107 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1108 return barrierType; |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1109 } |
2cae919cd3af
Introduce enumeration for the different write barrier types
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8980
diff
changeset
|
1110 |
9608
7a330743a452
change visibility of createFieldLocation/createArrayLocation
Lukas Stadler <lukas.stadler@jku.at>
parents:
9605
diff
changeset
|
1111 protected static ConstantLocationNode createFieldLocation(StructuredGraph graph, HotSpotResolvedJavaField field) { |
9500
9cc37ce426cc
factor out createFieldLocation in HotSpotRuntime
Lukas Stadler <lukas.stadler@jku.at>
parents:
9491
diff
changeset
|
1112 return ConstantLocationNode.create(field, field.getKind(), field.offset(), graph); |
9cc37ce426cc
factor out createFieldLocation in HotSpotRuntime
Lukas Stadler <lukas.stadler@jku.at>
parents:
9491
diff
changeset
|
1113 } |
9cc37ce426cc
factor out createFieldLocation in HotSpotRuntime
Lukas Stadler <lukas.stadler@jku.at>
parents:
9491
diff
changeset
|
1114 |
9608
7a330743a452
change visibility of createFieldLocation/createArrayLocation
Lukas Stadler <lukas.stadler@jku.at>
parents:
9605
diff
changeset
|
1115 protected IndexedLocationNode createArrayLocation(Graph graph, Kind elementKind, ValueNode index) { |
9423
3426008293e7
Move getSizeInBytes method to Architecture class.
Roland Schatz <roland.schatz@oracle.com>
parents:
9421
diff
changeset
|
1116 int scale = this.graalRuntime.getTarget().arch.getSizeInBytes(elementKind); |
7827
961ad124cb21
Convert indexScalingEnabled boolean into an indexScaling integer value. This change removed the dependency on TargetDescription in large parts of the system.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7814
diff
changeset
|
1117 return IndexedLocationNode.create(LocationNode.getArrayLocation(elementKind), elementKind, getArrayBaseOffset(elementKind), index, graph, scale); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1118 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1119 |
5718
10341299528c
renamings: ExtendedRiRuntime -> GraalCodeCacheProvider, CiLoweringTool -> LoweringTool, RiGraphCache -> GraphCache
Doug Simon <doug.simon@oracle.com>
parents:
5705
diff
changeset
|
1120 private static ValueNode createBoundsCheck(AccessIndexedNode n, LoweringTool tool) { |
9602
19c5a07c7843
Introduce a graph() method that returns a StructuredGraph, to make many explicit casts unnecessary
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9595
diff
changeset
|
1121 StructuredGraph graph = n.graph(); |
5415
79f12805362b
Use iterative lowering instead of manually applying lowering
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5401
diff
changeset
|
1122 ArrayLengthNode arrayLength = graph.add(new ArrayLengthNode(n.array())); |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7558
diff
changeset
|
1123 ValueNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), BoundsCheckException, InvalidateReprofile); |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
1124 |
5415
79f12805362b
Use iterative lowering instead of manually applying lowering
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5401
diff
changeset
|
1125 graph.addBeforeFixed(n, arrayLength); |
5401
332a3c0d7b3b
remove array length input from LoadIndexedNode and StoreIndexedNode
Lukas Stadler <lukas.stadler@jku.at>
parents:
5400
diff
changeset
|
1126 return guard; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1127 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1128 |
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
|
1129 public ResolvedJavaType lookupJavaType(Class<?> clazz) { |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7083
diff
changeset
|
1130 return HotSpotResolvedObjectType.fromClass(clazz); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1131 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1132 |
7144
ae69cd8c08a9
rename: RuntimeCall -> RuntimeCallTarget
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
1133 public HotSpotRuntimeCallTarget lookupRuntimeCall(Descriptor descriptor) { |
8627
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
1134 HotSpotRuntimeCallTarget callTarget = runtimeCalls.get(descriptor); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
1135 assert runtimeCalls != null : descriptor; |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
1136 callTarget.finalizeAddress(graalRuntime.getBackend()); |
75db7afee829
implemented lazy installation of replacements (GRAAL-137)
Doug Simon <doug.simon@oracle.com>
parents:
8587
diff
changeset
|
1137 return callTarget; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1138 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1139 |
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
|
1140 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
|
1141 CompilerToVM c2vm = graalRuntime.getCompilerToVM(); |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7083
diff
changeset
|
1142 HotSpotResolvedObjectType[] resultHolder = {null}; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
1143 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
|
1144 assert metaspaceMethod != 0L; |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
1145 return resultHolder[0].createMethod(metaspaceMethod); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1146 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1147 |
7044
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1148 public ResolvedJavaMethod lookupJavaConstructor(Constructor reflectionConstructor) { |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1149 CompilerToVM c2vm = graalRuntime.getCompilerToVM(); |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7083
diff
changeset
|
1150 HotSpotResolvedObjectType[] resultHolder = {null}; |
7044
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1151 long metaspaceMethod = c2vm.getMetaspaceConstructor(reflectionConstructor, resultHolder); |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1152 assert metaspaceMethod != 0L; |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1153 return resultHolder[0].createMethod(metaspaceMethod); |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1154 } |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7034
diff
changeset
|
1155 |
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
|
1156 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
|
1157 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
|
1158 } |
45f682f7fea8
Add MetaAccessProvider.getResolvedJavaField to convert from reflection field to metadata field
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6431
diff
changeset
|
1159 |
9041 | 1160 public HotSpotInstalledCode installMethod(HotSpotResolvedJavaMethod method, Graph graph, int entryBCI, CompilationResult compResult) { |
1161 HotSpotInstalledCode installedCode = new HotSpotInstalledCode(method, graph, true); | |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
1162 graalRuntime.getCompilerToVM().installCode(new HotSpotCompilationResult(method, entryBCI, compResult), installedCode, method.getSpeculationLog()); |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
1163 return installedCode; |
5360
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
1164 } |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
1165 |
6cc970203f30
moved creation of a RiCodeInfo to the runtime side of the CRI
Doug Simon <doug.simon@oracle.com>
parents:
5323
diff
changeset
|
1166 @Override |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
1167 public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult) { |
9041 | 1168 return addMethod(method, compResult, null); |
1169 } | |
1170 | |
1171 @Override | |
1172 public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph) { | |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6699
diff
changeset
|
1173 HotSpotResolvedJavaMethod hotspotMethod = (HotSpotResolvedJavaMethod) method; |
9041 | 1174 HotSpotInstalledCode code = new HotSpotInstalledCode(hotspotMethod, graph, false); |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8217
diff
changeset
|
1175 CodeInstallResult result = graalRuntime.getCompilerToVM().installCode(new HotSpotCompilationResult(hotspotMethod, -1, compResult), code, null); |
7113
38076efb9062
Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7104
diff
changeset
|
1176 if (result != CodeInstallResult.OK) { |
38076efb9062
Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7104
diff
changeset
|
1177 return null; |
38076efb9062
Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7104
diff
changeset
|
1178 } |
38076efb9062
Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7104
diff
changeset
|
1179 return code; |
4319
3c21eee8ab4d
Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents:
4312
diff
changeset
|
1180 } |
3c21eee8ab4d
Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents:
4312
diff
changeset
|
1181 |
4993
897b7d18bebc
added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents:
4696
diff
changeset
|
1182 @Override |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
1183 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
|
1184 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
|
1185 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
|
1186 |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
1187 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
|
1188 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
|
1189 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
|
1190 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
1191 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
1192 public int convertDeoptAction(DeoptimizationAction action) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1193 switch (action) { |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1194 case None: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1195 return config.deoptActionNone; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1196 case RecompileIfTooManyDeopts: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1197 return config.deoptActionMaybeRecompile; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1198 case InvalidateReprofile: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1199 return config.deoptActionReinterpret; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1200 case InvalidateRecompile: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1201 return config.deoptActionMakeNotEntrant; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1202 case InvalidateStopCompiling: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1203 return config.deoptActionMakeNotCompilable; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1204 default: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1205 throw GraalInternalError.shouldNotReachHere(); |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
1206 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
1207 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
1208 |
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
|
1209 public int convertDeoptReason(DeoptimizationReason reason) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1210 switch (reason) { |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1211 case None: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1212 return config.deoptReasonNone; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1213 case NullCheckException: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1214 return config.deoptReasonNullCheck; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1215 case BoundsCheckException: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1216 return config.deoptReasonRangeCheck; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1217 case ClassCastException: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1218 return config.deoptReasonClassCheck; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1219 case ArrayStoreException: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1220 return config.deoptReasonArrayCheck; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1221 case UnreachedCode: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1222 return config.deoptReasonUnreached0; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1223 case TypeCheckedInliningViolated: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1224 return config.deoptReasonTypeCheckInlining; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1225 case OptimizedTypeCheckViolated: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1226 return config.deoptReasonOptimizedTypeCheck; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1227 case NotCompiledExceptionHandler: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1228 return config.deoptReasonNotCompiledExceptionHandler; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1229 case Unresolved: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1230 return config.deoptReasonUnresolved; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1231 case JavaSubroutineMismatch: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1232 return config.deoptReasonJsrMismatch; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1233 case ArithmeticException: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1234 return config.deoptReasonDiv0Check; |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1235 case RuntimeConstraint: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1236 return config.deoptReasonConstraint; |
9444
fd60b73f1759
Add LoopLimitCheck deoptimization reason
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9441
diff
changeset
|
1237 case LoopLimitCheck: |
fd60b73f1759
Add LoopLimitCheck deoptimization reason
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9441
diff
changeset
|
1238 return config.deoptReasonLoopLimitCheck; |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1239 default: |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7522
diff
changeset
|
1240 throw GraalInternalError.shouldNotReachHere(); |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5110
diff
changeset
|
1241 } |
4993
897b7d18bebc
added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents:
4696
diff
changeset
|
1242 } |
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
|
1243 |
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
|
1244 public boolean needsDataPatch(Constant constant) { |
7930
fe64b5da8229
Create direct call for Static and Special to avoid out-of-line patching stub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7912
diff
changeset
|
1245 return constant.getPrimitiveAnnotation() != null; |
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
|
1246 } |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7130
diff
changeset
|
1247 |
7672
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1248 @Override |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1249 public Constant readUnsafeConstant(Kind kind, Object base, long displacement) { |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1250 switch (kind) { |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1251 case Boolean: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1252 return Constant.forBoolean(base == null ? unsafe.getByte(displacement) != 0 : unsafe.getBoolean(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1253 case Byte: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1254 return Constant.forByte(base == null ? unsafe.getByte(displacement) : unsafe.getByte(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1255 case Char: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1256 return Constant.forChar(base == null ? unsafe.getChar(displacement) : unsafe.getChar(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1257 case Short: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1258 return Constant.forShort(base == null ? unsafe.getShort(displacement) : unsafe.getShort(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1259 case Int: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1260 return Constant.forInt(base == null ? unsafe.getInt(displacement) : unsafe.getInt(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1261 case Long: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1262 return Constant.forLong(base == null ? unsafe.getLong(displacement) : unsafe.getLong(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1263 case Float: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1264 return Constant.forFloat(base == null ? unsafe.getFloat(displacement) : unsafe.getFloat(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1265 case Double: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1266 return Constant.forDouble(base == null ? unsafe.getDouble(displacement) : unsafe.getDouble(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1267 case Object: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1268 return Constant.forObject(unsafe.getObject(base, displacement)); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1269 default: |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1270 throw GraalInternalError.shouldNotReachHere(); |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1271 } |
1a4a00390113
Make the access of raw memory via Unsafe specific to HotSpot.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7558
diff
changeset
|
1272 } |
7733
f6bf0f6a8431
move AMD64HotSpotRuntime.getTarget up to HotSpotRuntime
Roland Schatz <roland.schatz@oracle.com>
parents:
7677
diff
changeset
|
1273 |
f6bf0f6a8431
move AMD64HotSpotRuntime.getTarget up to HotSpotRuntime
Roland Schatz <roland.schatz@oracle.com>
parents:
7677
diff
changeset
|
1274 @Override |
f6bf0f6a8431
move AMD64HotSpotRuntime.getTarget up to HotSpotRuntime
Roland Schatz <roland.schatz@oracle.com>
parents:
7677
diff
changeset
|
1275 public TargetDescription getTarget() { |
f6bf0f6a8431
move AMD64HotSpotRuntime.getTarget up to HotSpotRuntime
Roland Schatz <roland.schatz@oracle.com>
parents:
7677
diff
changeset
|
1276 return graalRuntime.getTarget(); |
f6bf0f6a8431
move AMD64HotSpotRuntime.getTarget up to HotSpotRuntime
Roland Schatz <roland.schatz@oracle.com>
parents:
7677
diff
changeset
|
1277 } |
7784
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1278 |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1279 public String disassemble(InstalledCode code) { |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1280 if (code.isValid()) { |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9301
diff
changeset
|
1281 long codeBlob = ((HotSpotInstalledCode) code).getCodeBlob(); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9301
diff
changeset
|
1282 return graalRuntime.getCompilerToVM().disassembleCodeBlob(codeBlob); |
7784
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1283 } |
7912
06ecee106195
added unit tests for bytecode and machine code disassembly
Doug Simon <doug.simon@oracle.com>
parents:
7838
diff
changeset
|
1284 return null; |
7784
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1285 } |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1286 |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1287 public String disassemble(ResolvedJavaMethod method) { |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1288 return new BytecodeDisassembler().disassemble(method); |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7764
diff
changeset
|
1289 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1290 } |