annotate agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactoryImpl.java @ 1913:3b2dea75431e

6984311: JSR 292 needs optional bootstrap method parameters Summary: Allow CONSTANT_InvokeDynamic nodes to have any number of extra operands. Reviewed-by: twisti
author jrose
date Sat, 30 Oct 2010 13:08:23 -0700
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.asm.sparc;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import sun.jvm.hotspot.asm.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 public class SPARCInstructionFactoryImpl implements SPARCInstructionFactory {
a61af66fc99e Initial load
duke
parents:
diff changeset
30 public SPARCInstruction newCallInstruction(PCRelativeAddress addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
31 return new SPARCCallInstruction(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
32 }
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public SPARCInstruction newNoopInstruction() {
a61af66fc99e Initial load
duke
parents:
diff changeset
35 return new SPARCNoopInstruction();
a61af66fc99e Initial load
duke
parents:
diff changeset
36 }
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 public SPARCInstruction newSethiInstruction(int imm22, SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
39 return new SPARCSethiInstruction(imm22, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
40 }
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 public SPARCInstruction newUnimpInstruction(int const22) {
a61af66fc99e Initial load
duke
parents:
diff changeset
43 return new SPARCUnimpInstruction(const22);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 }
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 public SPARCInstruction newBranchInstruction(String name, PCRelativeAddress addr, boolean isAnnuled, int conditionCode) {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 return new SPARCBranchInstruction(name, addr, isAnnuled, conditionCode);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 }
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 public SPARCInstruction newSpecialLoadInstruction(String name, int specialReg, int cregNum,
a61af66fc99e Initial load
duke
parents:
diff changeset
51 SPARCRegisterIndirectAddress addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 return new SPARCSpecialLoadInstruction(name, specialReg, cregNum, addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 }
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 public SPARCInstruction newSpecialStoreInstruction(String name, int specialReg, int cregNum,
a61af66fc99e Initial load
duke
parents:
diff changeset
57 SPARCRegisterIndirectAddress addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
58 return new SPARCSpecialStoreInstruction(name, specialReg, cregNum, addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 public SPARCInstruction newLoadInstruction(String name, int opcode,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 SPARCRegisterIndirectAddress addr, SPARCRegister rd,
a61af66fc99e Initial load
duke
parents:
diff changeset
63 int dataType) {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 return new SPARCLoadInstruction(name, opcode, addr, rd, dataType);
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 public SPARCInstruction newStoreInstruction(String name, int opcode,
a61af66fc99e Initial load
duke
parents:
diff changeset
68 SPARCRegisterIndirectAddress addr, SPARCRegister rd,
a61af66fc99e Initial load
duke
parents:
diff changeset
69 int dataType) {
a61af66fc99e Initial load
duke
parents:
diff changeset
70 return new SPARCStoreInstruction(name, opcode, addr, rd, dataType);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public SPARCInstruction newStbarInstruction() {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 return new SPARCStbarInstruction();
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 public SPARCInstruction newReadInstruction(int specialReg, int asrRegNum, SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 return new SPARCReadInstruction(specialReg, asrRegNum, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
79 }
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 public SPARCInstruction newWriteInstruction(int specialReg, int asrRegNum, SPARCRegister rs1,
a61af66fc99e Initial load
duke
parents:
diff changeset
82 ImmediateOrRegister operand2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 return new SPARCWriteInstruction(specialReg, asrRegNum, rs1,operand2);
a61af66fc99e Initial load
duke
parents:
diff changeset
84 }
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 public SPARCInstruction newIllegalInstruction(int instruction) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 return new SPARCIllegalInstruction(instruction);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 }
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public SPARCInstruction newIndirectCallInstruction(SPARCRegisterIndirectAddress addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
92 SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
93 return new SPARCIndirectCallInstruction(addr, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 }
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 public SPARCInstruction newReturnInstruction(SPARCRegisterIndirectAddress addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
97 SPARCRegister rd, boolean isLeaf) {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 return new SPARCReturnInstruction(addr, rd, isLeaf);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 }
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 public SPARCInstruction newJmplInstruction(SPARCRegisterIndirectAddress addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
102 SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
103 return new SPARCJmplInstruction(addr, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 public SPARCInstruction newFPArithmeticInstruction(String name, int opf, int rtlOperation,
a61af66fc99e Initial load
duke
parents:
diff changeset
107 SPARCFloatRegister rs1, SPARCFloatRegister rs2,
a61af66fc99e Initial load
duke
parents:
diff changeset
108 SPARCFloatRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 return new SPARCFPArithmeticInstruction(name, opf, rtlOperation, rs1, rs2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 public SPARCInstruction newFPMoveInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
113 return new SPARCFPMoveInstruction(name, opf, rs, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public SPARCInstruction newFP2RegisterInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
117 return new SPARCFP2RegisterInstruction(name, opf, rs, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 public SPARCInstruction newFlushInstruction(SPARCRegisterIndirectAddress addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 return new SPARCFlushInstruction(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
122 }
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 public SPARCInstruction newSaveInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 return new SPARCSaveInstruction(rs1, operand2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
126 }
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 public SPARCInstruction newRestoreInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 return new SPARCRestoreInstruction(rs1, operand2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
130 }
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 public SPARCInstruction newTrapInstruction(String name, int conditionCode) {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 return new SPARCTrapInstruction(name, conditionCode);
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 public SPARCInstruction newRettInstruction(SPARCRegisterIndirectAddress addr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
137 return new SPARCRettInstruction(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 public SPARCInstruction newArithmeticInstruction(String name, int opcode, int rtlOperation,
a61af66fc99e Initial load
duke
parents:
diff changeset
141 SPARCRegister rs1, ImmediateOrRegister operand2,
a61af66fc99e Initial load
duke
parents:
diff changeset
142 SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
143 return new SPARCArithmeticInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
144 }
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 public SPARCInstruction newLogicInstruction(String name, int opcode, int rtlOperation,
a61af66fc99e Initial load
duke
parents:
diff changeset
147 SPARCRegister rs1, ImmediateOrRegister operand2,
a61af66fc99e Initial load
duke
parents:
diff changeset
148 SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
149 return new SPARCLogicInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 public SPARCInstruction newMoveInstruction(String name, int opcode,
a61af66fc99e Initial load
duke
parents:
diff changeset
153 ImmediateOrRegister operand2,
a61af66fc99e Initial load
duke
parents:
diff changeset
154 SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
155 return new SPARCMoveInstruction(name, opcode, operand2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 public SPARCInstruction newShiftInstruction(String name, int opcode, int rtlOperation,
a61af66fc99e Initial load
duke
parents:
diff changeset
159 SPARCRegister rs1, ImmediateOrRegister operand2,
a61af66fc99e Initial load
duke
parents:
diff changeset
160 SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
161 return new SPARCShiftInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
162 }
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 public SPARCInstruction newCoprocessorInstruction(int instruction, int cpopcode, int opcode,
a61af66fc99e Initial load
duke
parents:
diff changeset
165 int rs1Num, int rs2Num, int rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
166 return new SPARCIllegalInstruction(instruction);
a61af66fc99e Initial load
duke
parents:
diff changeset
167 }
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 public SPARCInstruction newSwapInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 return new SPARCSwapInstruction(name, addr, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 public SPARCInstruction newLdstubInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
174 return new SPARCLdstubInstruction(name, addr, rd);
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }