annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java @ 12456:f87c68d79f07

improved support for co-existing, multiple backends (GRAAL-363)
author Doug Simon <doug.simon@oracle.com>
date Thu, 17 Oct 2013 01:08:17 +0200
parents 7080a96be216
children d7f8dd4fe876
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
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
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
28 import static com.oracle.graal.sparc.SPARC.*;
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
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.*;
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
48 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
49
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
50 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
51
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
52 private final HotSpotVMConfig config;
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
53
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
54 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
55 super(graph, providers, frameMap, cc, lir);
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
56 this.config = config;
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
57 }
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
58
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
59 @Override
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
60 protected HotSpotProviders getProviders() {
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
61 return (HotSpotProviders) super.getProviders();
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
62 }
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 * 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
66 * 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
67 * deoptimization stub.
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
68 */
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
69 StackSlot deoptimizationRescueSlot;
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
70
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
71 @SuppressWarnings("hiding")
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
72 @Override
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
73 protected DebugInfoBuilder createDebugInfoBuilder(NodeMap<Value> nodeOperands) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
74 assert config.basicLockSize == 8;
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
75 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
76 return new HotSpotDebugInfoBuilder(nodeOperands, lockStack);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
77 }
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 @Override
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
80 public StackSlot getLockSlot(int lockDepth) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
81 return ((HotSpotDebugInfoBuilder) debugInfoBuilder).lockStack().makeLockSlot(lockDepth);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
82 }
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 @Override
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
85 protected boolean needOnlyOopMaps() {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
86 // Stubs only need oop maps
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
87 return graph.start() instanceof StubStartNode;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
88 }
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 Stub getStub() {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
91 if (graph.start() instanceof StubStartNode) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
92 return ((StubStartNode) graph.start()).getStub();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
93 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
94 return null;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
95 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
96
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
97 @Override
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
98 public Variable emitForeignCall(ForeignCallLinkage linkage, DeoptimizingNode info, Value... args) {
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
99 Variable result;
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
100
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
101 if (linkage.canDeoptimize()) {
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
102 assert info != null;
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
103 HotSpotRegistersProvider registers = getProviders().getRegisters();
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
104 Register thread = registers.getThreadRegister();
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
105 Register stackPointer = registers.getStackPointerRegister();
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
106 append(new SPARCHotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset, thread, stackPointer));
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
107 result = super.emitForeignCall(linkage, info, args);
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
108 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
109 } else {
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
110 result = super.emitForeignCall(linkage, null, args);
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
111 }
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 return result;
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10870
diff changeset
114 }
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 @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
117 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
118 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
119 }
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 @Override
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
122 public void visitSafepointNode(SafepointNode i) {
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents: 10686
diff changeset
123 LIRFrameState info = state(i);
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
124 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
125 }
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 @Override
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
128 public void visitDirectCompareAndSwap(DirectCompareAndSwapNode x) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
129 Kind kind = x.newValue().kind();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
130 assert kind == x.expectedValue().kind();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
131
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
132 Variable address = load(operand(x.object()));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
133 Value offset = operand(x.offset());
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
134 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
135 Variable newValue = load(operand(x.newValue()));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
136
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
137 if (ValueUtil.isConstant(offset)) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
138 assert !getCodeCache().needsDataPatch(asConstant(offset));
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
139 Variable longAddress = newVariable(Kind.Long);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
140 emitMove(longAddress, address);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
141 address = emitAdd(longAddress, asConstant(offset));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
142 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
143 if (isLegal(offset)) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
144 address = emitAdd(address, offset);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
145 }
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 append(new CompareAndSwapOp(address, cmpValue, newValue));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
149
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
150 Variable result = newVariable(x.kind());
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
151 emitMove(result, newValue);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
152 setResult(x, result);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
153 }
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 @Override
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
156 public void emitTailcall(Value[] args, Value address) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
157 // append(new AMD64TailcallOp(args, address));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
158 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
159 }
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 @Override
10686
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
162 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
163 InvokeKind invokeKind = ((HotSpotDirectCallTargetNode) callTarget).invokeKind();
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
164 if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) {
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
165 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
166 } else {
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
167 assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special;
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
168 HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.target();
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
169 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
170 Constant metaspaceMethod = resolvedMethod.getMetaspaceMethodConstant();
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
171 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
172 }
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 @Override
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
176 protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
177 AllocatableValue metaspaceMethod = g5.asValue();
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
178 emitMove(metaspaceMethod, operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod()));
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
179 AllocatableValue targetAddress = g3.asValue();
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
180 emitMove(targetAddress, operand(callTarget.computedAddress()));
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
181 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
182 }
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 @Override
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
185 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
186 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
187 CallingConvention linkageCc = linkage.getOutgoingCallingConvention();
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
188 assert linkageCc.getArgumentCount() == 2;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
189 RegisterValue exceptionParameter = (RegisterValue) linkageCc.getArgument(0);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
190 emitMove(exceptionParameter, exception);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
191 append(new SPARCHotSpotUnwindOp(exceptionParameter));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
192 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
193
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11834
diff changeset
194 private void moveDeoptimizationActionAndReasonToThread(Value actionAndReason) {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
195 int pendingDeoptimizationOffset = runtime().getConfig().pendingDeoptimizationOffset;
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
196 Kind wordKind = getProviders().getCodeCache().getTarget().wordKind;
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
197 RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11834
diff changeset
198 SPARCAddressValue pendingDeoptAddress = new SPARCAddressValue(actionAndReason.getKind(), thread, pendingDeoptimizationOffset);
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11834
diff changeset
199 append(new StoreOp(actionAndReason.getKind(), pendingDeoptAddress, emitMove(actionAndReason), null));
11832
97d6932a309b CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11760
diff changeset
200 }
97d6932a309b CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11760
diff changeset
201
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
202 @Override
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11834
diff changeset
203 public void emitDeoptimize(Value actionAndReason, DeoptimizingNode deopting) {
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11834
diff changeset
204 moveDeoptimizationActionAndReasonToThread(actionAndReason);
11832
97d6932a309b CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11760
diff changeset
205 append(new SPARCDeoptimizeOp(state(deopting)));
10686
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
206 }
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
207
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
208 @Override
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
209 public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
210 moveDeoptimizationActionAndReasonToThread(getMetaAccess().encodeDeoptActionAndReason(action, reason));
11832
97d6932a309b CodeCacheProvider.encodeDeoptActionAndReason now returns a Constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11760
diff changeset
211 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
212 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
213
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
214 @Override
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
215 public void emitPatchReturnAddress(ValueNode address) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
216 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
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
10686
73122b5edf6a SPARC: Can compile simple methods and do static calls.
twisti
parents: 9814
diff changeset
220 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
221 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
222 ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(EXCEPTION_HANDLER_IN_CALLER);
10870
886c2df7a7e4 Stubs need both an outgoing and incoming calling convention.
twisti
parents: 10854
diff changeset
223 CallingConvention linkageCc = linkage.getOutgoingCallingConvention();
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
224 assert linkageCc.getArgumentCount() == 2;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
225 RegisterValue exceptionFixed = (RegisterValue) linkageCc.getArgument(0);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
226 RegisterValue exceptionPcFixed = (RegisterValue) linkageCc.getArgument(1);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
227 emitMove(exceptionFixed, operand(exception));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
228 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
229 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
230 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
231 append(op);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
232 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
233
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
234 private static boolean isCompressCandidate(DeoptimizingNode access) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
235 return access != null && ((HeapAccess) access).isCompressible();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
236 }
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 @Override
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
239 public Variable emitLoad(Kind kind, Value address, DeoptimizingNode access) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
240 SPARCAddressValue loadAddress = asAddressValue(address);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
241 Variable result = newVariable(kind);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
242 assert access == null || access instanceof HeapAccess;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
243 if (isCompressCandidate(access)) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
244 if (config.useCompressedOops && kind == Kind.Object) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
245 // append(new LoadCompressedPointer(kind, result, loadAddress, access != null ? state(access) :
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
246 // null, config.narrowOopBase, config.narrowOopShift,
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
247 // config.logMinObjAlignment));
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
248 throw GraalInternalError.unimplemented();
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
249 } else if (config.useCompressedClassPointers && kind == Kind.Long) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
250 // append(new LoadCompressedPointer(kind, result, loadAddress, access != null ? state(access) :
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
251 // null, config.narrowKlassBase, config.narrowKlassShift,
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
252 // config.logKlassAlignment));
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
253 throw GraalInternalError.unimplemented();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
254 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
255 append(new LoadOp(kind, result, loadAddress, access != null ? state(access) : null));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
256 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
257 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
258 append(new LoadOp(kind, result, loadAddress, access != null ? state(access) : null));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
259 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
260 return result;
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
261 }
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
262
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
263 @Override
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
264 public void emitStore(Kind kind, Value address, Value inputVal, DeoptimizingNode access) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
265 SPARCAddressValue storeAddress = asAddressValue(address);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
266 LIRFrameState state = access != null ? state(access) : null;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
267 if (isConstant(inputVal)) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
268 Constant c = asConstant(inputVal);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
269 if (canStoreConstant(c)) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
270 if (inputVal.getKind() == Kind.Object) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
271 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
272 } else if (inputVal.getKind() == Kind.Long) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
273 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
274 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
275 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
276 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
277 return;
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
278 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10694
diff changeset
279 }
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
280 Variable input = load(inputVal);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
281 if (isCompressCandidate(access)) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
282 if (config.useCompressedOops && kind == Kind.Object) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
283 // if (input.getKind() == Kind.Object) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
284 // Variable scratch = newVariable(Kind.Long);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
285 // append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state,
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
286 // config.narrowOopBase, config.narrowOopShift,
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
287 // config.logMinObjAlignment));
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
288 // } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
289 // // the input oop is already compressed
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
290 // append(new StoreOp(input.getKind(), storeAddress, input, state));
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
291 // }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
292 throw GraalInternalError.unimplemented();
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
293 } else if (config.useCompressedClassPointers && kind == Kind.Long) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
294 // Variable scratch = newVariable(Kind.Long);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
295 // append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state,
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
296 // config.narrowKlassBase, config.narrowKlassShift,
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12363
diff changeset
297 // config.logKlassAlignment));
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
298 throw GraalInternalError.unimplemented();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
299 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
300 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
301 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
302 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
303 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
304 }
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
305 }
11355
01269a181628 add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents: 11233
diff changeset
306
01269a181628 add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents: 11233
diff changeset
307 @Override
01269a181628 add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents: 11233
diff changeset
308 public Value emitNot(Value input) {
01269a181628 add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents: 11233
diff changeset
309 GraalInternalError.shouldNotReachHere("binary negation not implemented");
01269a181628 add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents: 11233
diff changeset
310 return null;
01269a181628 add bitwise "not" operation
Lukas Stadler <lukas.stadler@jku.at>
parents: 11233
diff changeset
311 }
9814
e723f9031785 re-architected SPARC assembler to be Fmt class specific, initial arithmetic
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
312 }