Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java @ 13641:5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Thu, 12 Dec 2013 15:13:02 +0100 |
parents | fb7b39f07232 |
children | 0c38906450a0 |
rev | line source |
---|---|
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
1 /* |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
4 * |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
8 * |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
14 * |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
18 * |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
22 */ |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.sparc; |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
24 |
10792 | 25 import static com.oracle.graal.api.code.ValueUtil.*; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
26 import static com.oracle.graal.hotspot.HotSpotBackend.*; |
11832
97d6932a309b
CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
27 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; |
11233 | 28 import static com.oracle.graal.sparc.SPARC.*; |
10792 | 29 |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
30 import java.lang.reflect.*; |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
31 |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
32 import com.oracle.graal.api.code.*; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
33 import com.oracle.graal.api.meta.*; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
34 import com.oracle.graal.compiler.gen.*; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
35 import com.oracle.graal.compiler.sparc.*; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
36 import com.oracle.graal.graph.*; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
37 import com.oracle.graal.hotspot.*; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
38 import com.oracle.graal.hotspot.meta.*; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
39 import com.oracle.graal.hotspot.nodes.*; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
40 import com.oracle.graal.hotspot.stubs.*; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
41 import com.oracle.graal.lir.*; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
42 import com.oracle.graal.lir.sparc.*; |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
43 import com.oracle.graal.lir.sparc.SPARCMove.CompareAndSwapOp; |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
44 import com.oracle.graal.lir.sparc.SPARCMove.LoadOp; |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
45 import com.oracle.graal.lir.sparc.SPARCMove.StoreConstantOp; |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
46 import com.oracle.graal.lir.sparc.SPARCMove.StoreOp; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
47 import com.oracle.graal.nodes.*; |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
48 import com.oracle.graal.nodes.extended.*; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
49 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
50 |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
51 public class SPARCHotSpotLIRGenerator extends SPARCLIRGenerator implements HotSpotLIRGenerator { |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
52 |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
53 private final HotSpotVMConfig config; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
54 |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
55 public SPARCHotSpotLIRGenerator(StructuredGraph graph, HotSpotProviders providers, HotSpotVMConfig config, FrameMap frameMap, CallingConvention cc, LIR lir) { |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
56 super(graph, providers, frameMap, cc, lir); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
57 this.config = config; |
10694
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
58 } |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
59 |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
60 @Override |
12787
9b62c748c9ae
get thread register from generator when lowering CurrentJavaThreadNode node instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents:
12757
diff
changeset
|
61 public HotSpotProviders getProviders() { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
62 return (HotSpotProviders) super.getProviders(); |
10694
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
63 } |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
64 |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
65 /** |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
66 * The slot reserved for storing the original return address when a frame is marked for |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
67 * deoptimization. The return address slot in the callee is overwritten with the address of a |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
68 * deoptimization stub. |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
69 */ |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
70 StackSlot deoptimizationRescueSlot; |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
71 |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
72 @SuppressWarnings("hiding") |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
73 @Override |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
74 protected DebugInfoBuilder createDebugInfoBuilder(NodeMap<Value> nodeOperands) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
75 assert config.basicLockSize == 8; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
76 HotSpotLockStack lockStack = new HotSpotLockStack(frameMap, Kind.Long); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
77 return new HotSpotDebugInfoBuilder(nodeOperands, lockStack); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
78 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
79 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
80 @Override |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
81 public StackSlot getLockSlot(int lockDepth) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
82 return ((HotSpotDebugInfoBuilder) debugInfoBuilder).lockStack().makeLockSlot(lockDepth); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
83 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
84 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
85 @Override |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
86 protected boolean needOnlyOopMaps() { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
87 // Stubs only need oop maps |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
88 return graph.start() instanceof StubStartNode; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
89 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
90 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
91 Stub getStub() { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
92 if (graph.start() instanceof StubStartNode) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
93 return ((StubStartNode) graph.start()).getStub(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
94 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
95 return null; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
96 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
97 |
10694
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
98 @Override |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
99 public Variable emitForeignCall(ForeignCallLinkage linkage, DeoptimizingNode info, Value... args) { |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
100 Variable result; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
101 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
102 if (linkage.canDeoptimize()) { |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
103 assert info != null; |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
104 HotSpotRegistersProvider registers = getProviders().getRegisters(); |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
105 Register thread = registers.getThreadRegister(); |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
106 Register stackPointer = registers.getStackPointerRegister(); |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12503
diff
changeset
|
107 append(new SPARCHotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread, stackPointer)); |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
108 result = super.emitForeignCall(linkage, info, args); |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12503
diff
changeset
|
109 append(new SPARCHotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadJavaFrameAnchorFlagsOffset(), thread)); |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
110 } else { |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
111 result = super.emitForeignCall(linkage, null, args); |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
112 } |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
113 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
114 return result; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
115 } |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
116 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10870
diff
changeset
|
117 @Override |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
118 protected void emitReturn(Value input) { |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
119 append(new SPARCHotSpotReturnOp(input, getStub() != null)); |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
120 } |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
121 |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11355
diff
changeset
|
122 @Override |
10694
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
123 public void visitSafepointNode(SafepointNode i) { |
31266ceb86ef
SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
10686
diff
changeset
|
124 LIRFrameState info = state(i); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
125 append(new SPARCHotSpotSafepointOp(info, config, this)); |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
126 } |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
127 |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
128 @Override |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
129 public void visitDirectCompareAndSwap(DirectCompareAndSwapNode x) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
130 Kind kind = x.newValue().kind(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
131 assert kind == x.expectedValue().kind(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
132 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
133 Variable address = load(operand(x.object())); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
134 Value offset = operand(x.offset()); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
135 Variable cmpValue = (Variable) loadNonConst(operand(x.expectedValue())); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
136 Variable newValue = load(operand(x.newValue())); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
137 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
138 if (ValueUtil.isConstant(offset)) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
139 assert !getCodeCache().needsDataPatch(asConstant(offset)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
140 Variable longAddress = newVariable(Kind.Long); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
141 emitMove(longAddress, address); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
142 address = emitAdd(longAddress, asConstant(offset)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
143 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
144 if (isLegal(offset)) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
145 address = emitAdd(address, offset); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
146 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
147 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
148 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
149 append(new CompareAndSwapOp(address, cmpValue, newValue)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
150 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
151 Variable result = newVariable(x.kind()); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
152 emitMove(result, newValue); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
153 setResult(x, result); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
154 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
155 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
156 @Override |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
157 public void emitTailcall(Value[] args, Value address) { |
12503
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
158 // append(new AMD64TailcallOp(args, address)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
159 throw GraalInternalError.unimplemented(); |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
160 } |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
161 |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
162 @Override |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
163 protected void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) { |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
164 InvokeKind invokeKind = ((HotSpotDirectCallTargetNode) callTarget).invokeKind(); |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
165 if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) { |
10792 | 166 append(new SPARCHotspotDirectVirtualCallOp(callTarget.target(), result, parameters, temps, callState, invokeKind)); |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
167 } else { |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
168 assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
169 HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.target(); |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
170 assert !Modifier.isAbstract(resolvedMethod.getModifiers()) : "Cannot make direct call to abstract method."; |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
171 Constant metaspaceMethod = resolvedMethod.getMetaspaceMethodConstant(); |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
172 append(new SPARCHotspotDirectStaticCallOp(callTarget.target(), result, parameters, temps, callState, invokeKind, metaspaceMethod)); |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
173 } |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
174 } |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
175 |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
176 @Override |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
177 protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) { |
11233 | 178 AllocatableValue metaspaceMethod = g5.asValue(); |
179 emitMove(metaspaceMethod, operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod())); | |
180 AllocatableValue targetAddress = g3.asValue(); | |
181 emitMove(targetAddress, operand(callTarget.computedAddress())); | |
182 append(new SPARCIndirectCallOp(callTarget.target(), result, parameters, temps, metaspaceMethod, targetAddress, callState)); | |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
183 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
184 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
185 @Override |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
186 public void emitUnwind(Value exception) { |
12363
78e5badf4b8e
moved lookupForeignCall() from CodeCacheProvider to ForeignCallsProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12356
diff
changeset
|
187 ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER); |
10870
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
10854
diff
changeset
|
188 CallingConvention linkageCc = linkage.getOutgoingCallingConvention(); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
189 assert linkageCc.getArgumentCount() == 2; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
190 RegisterValue exceptionParameter = (RegisterValue) linkageCc.getArgument(0); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
191 emitMove(exceptionParameter, exception); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
192 append(new SPARCHotSpotUnwindOp(exceptionParameter)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
193 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
194 |
13641
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
195 private void moveDeoptValuesToThread(Value actionAndReason, Value speculation) { |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
196 moveValueToThread(actionAndReason, runtime().getConfig().pendingDeoptimizationOffset); |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
197 moveValueToThread(speculation, runtime().getConfig().pendingFailedSpeculationOffset); |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
198 } |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
199 |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
200 private void moveValueToThread(Value v, int offset) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
201 Kind wordKind = getProviders().getCodeCache().getTarget().wordKind; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
202 RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind); |
13641
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
203 SPARCAddressValue pendingDeoptAddress = new SPARCAddressValue(v.getKind(), thread, offset); |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
204 append(new StoreOp(v.getKind(), pendingDeoptAddress, emitMove(v), null)); |
11832
97d6932a309b
CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
205 } |
97d6932a309b
CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
206 |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
207 @Override |
13641
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
208 public void emitDeoptimize(Value actionAndReason, Value speculation, DeoptimizingNode deopting) { |
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
209 moveDeoptValuesToThread(actionAndReason, speculation); |
11832
97d6932a309b
CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
210 append(new SPARCDeoptimizeOp(state(deopting))); |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
211 } |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
212 |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
213 @Override |
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
214 public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) { |
13641
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13520
diff
changeset
|
215 moveDeoptValuesToThread(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0), Constant.NULL_OBJECT); |
11832
97d6932a309b
CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
216 append(new SPARCHotSpotDeoptimizeCallerOp()); |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
217 } |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
218 |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
219 @Override |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
220 public void emitPatchReturnAddress(ValueNode address) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
221 append(new SPARCHotSpotPatchReturnAddressOp(load(operand(address)))); |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
222 } |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
223 |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
224 @Override |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
9814
diff
changeset
|
225 public void emitJumpToExceptionHandlerInCaller(ValueNode handlerInCallerPc, ValueNode exception, ValueNode exceptionPc) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
226 Variable handler = load(operand(handlerInCallerPc)); |
12363
78e5badf4b8e
moved lookupForeignCall() from CodeCacheProvider to ForeignCallsProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12356
diff
changeset
|
227 ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(EXCEPTION_HANDLER_IN_CALLER); |
10870
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
10854
diff
changeset
|
228 CallingConvention linkageCc = linkage.getOutgoingCallingConvention(); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
229 assert linkageCc.getArgumentCount() == 2; |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
230 RegisterValue exceptionFixed = (RegisterValue) linkageCc.getArgument(0); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
231 RegisterValue exceptionPcFixed = (RegisterValue) linkageCc.getArgument(1); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
232 emitMove(exceptionFixed, operand(exception)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
233 emitMove(exceptionPcFixed, operand(exceptionPc)); |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
234 Register thread = getProviders().getRegisters().getThreadRegister(); |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
235 SPARCHotSpotJumpToExceptionHandlerInCallerOp op = new SPARCHotSpotJumpToExceptionHandlerInCallerOp(handler, exceptionFixed, exceptionPcFixed, config.threadIsMethodHandleReturnOffset, thread); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
236 append(op); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
237 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
238 |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
239 private static boolean isCompressCandidate(Access access) { |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
240 return access != null && access.isCompressible(); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
241 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
242 |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
243 @Override |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
244 public Variable emitLoad(Kind kind, Value address, Access access) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
245 SPARCAddressValue loadAddress = asAddressValue(address); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
246 Variable result = newVariable(kind); |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
247 LIRFrameState state = null; |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
248 if (access instanceof DeoptimizingNode) { |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
249 state = state((DeoptimizingNode) access); |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
250 } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
251 if (isCompressCandidate(access)) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
252 if (config.useCompressedOops && kind == Kind.Object) { |
12503
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
253 // append(new LoadCompressedPointer(kind, result, loadAddress, access != null ? |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
254 // state(access) : |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
255 // null, config.narrowOopBase, config.narrowOopShift, |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
256 // config.logMinObjAlignment)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
257 throw GraalInternalError.unimplemented(); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
258 } else if (config.useCompressedClassPointers && kind == Kind.Long) { |
12503
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
259 // append(new LoadCompressedPointer(kind, result, loadAddress, access != null ? |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
260 // state(access) : |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
261 // null, config.narrowKlassBase, config.narrowKlassShift, |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
262 // config.logKlassAlignment)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
263 throw GraalInternalError.unimplemented(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
264 } else { |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
265 append(new LoadOp(kind, result, loadAddress, state)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
266 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
267 } else { |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
268 append(new LoadOp(kind, result, loadAddress, state)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
269 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
270 return result; |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
271 } |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
272 |
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
273 @Override |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
274 public void emitStore(Kind kind, Value address, Value inputVal, Access access) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
275 SPARCAddressValue storeAddress = asAddressValue(address); |
13291
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
276 LIRFrameState state = null; |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
277 if (access instanceof DeoptimizingNode) { |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
278 state = state((DeoptimizingNode) access); |
01fd11e44f73
Access is not necessarily a DeoptimizingNode. In particular, FloatingAccessNodes are not DeoptimizingNode.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13255
diff
changeset
|
279 } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
280 if (isConstant(inputVal)) { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
281 Constant c = asConstant(inputVal); |
13520
fb7b39f07232
Embed compressed constants when possible and use more efficient patterns for encoding
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13291
diff
changeset
|
282 if (canStoreConstant(c, isCompressCandidate(access))) { |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
283 if (inputVal.getKind() == Kind.Object) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
284 append(new StoreConstantOp(kind, storeAddress, c, state, config.useCompressedOops && isCompressCandidate(access))); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
285 } else if (inputVal.getKind() == Kind.Long) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
286 append(new StoreConstantOp(kind, storeAddress, c, state, config.useCompressedClassPointers && isCompressCandidate(access))); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
287 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
288 append(new StoreConstantOp(kind, storeAddress, c, state, false)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
289 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
290 return; |
10792 | 291 } |
292 } | |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
293 Variable input = load(inputVal); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
294 if (isCompressCandidate(access)) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
295 if (config.useCompressedOops && kind == Kind.Object) { |
12503
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
296 // if (input.getKind() == Kind.Object) { |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
297 // Variable scratch = newVariable(Kind.Long); |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
298 // append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state, |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
299 // config.narrowOopBase, config.narrowOopShift, |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
300 // config.logMinObjAlignment)); |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
301 // } else { |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
302 // // the input oop is already compressed |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
303 // append(new StoreOp(input.getKind(), storeAddress, input, state)); |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
304 // } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
305 throw GraalInternalError.unimplemented(); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
12363
diff
changeset
|
306 } else if (config.useCompressedClassPointers && kind == Kind.Long) { |
12503
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
307 // Variable scratch = newVariable(Kind.Long); |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
308 // append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state, |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
309 // config.narrowKlassBase, config.narrowKlassShift, |
d7f8dd4fe876
minor reformatting based on 'mx eclipseformat'
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
310 // config.logKlassAlignment)); |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
311 throw GraalInternalError.unimplemented(); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
312 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
313 append(new StoreOp(kind, storeAddress, input, state)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
314 } |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
315 } else { |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
316 append(new StoreOp(kind, storeAddress, input, state)); |
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10792
diff
changeset
|
317 } |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
318 } |
11355
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11233
diff
changeset
|
319 |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11233
diff
changeset
|
320 @Override |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11233
diff
changeset
|
321 public Value emitNot(Value input) { |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11233
diff
changeset
|
322 GraalInternalError.shouldNotReachHere("binary negation not implemented"); |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11233
diff
changeset
|
323 return null; |
01269a181628
add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents:
11233
diff
changeset
|
324 } |
13255
785bbb619238
Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12787
diff
changeset
|
325 |
785bbb619238
Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12787
diff
changeset
|
326 public void emitPrefetchAllocate(ValueNode address, ValueNode distance) { |
785bbb619238
Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12787
diff
changeset
|
327 SPARCAddressValue addr = emitAddress(operand(address), 0, loadNonConst(operand(distance)), 1); |
785bbb619238
Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12787
diff
changeset
|
328 append(new SPARCPrefetchOp(addr, config.allocatePrefetchInstr)); |
785bbb619238
Basic allocation prefetching support
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
12787
diff
changeset
|
329 } |
9814
e723f9031785
re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
330 } |