annotate graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCSaveRegistersOp.java @ 19526:8fc336a04d77

Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 20 Feb 2015 22:22:55 +0100
parents 1c92d437179b
children 96ab2078eeaf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
1 /*
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18443
diff changeset
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
4 *
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
7 * published by the Free Software Foundation.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
8 *
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
13 * accompanied this code).
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
14 *
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
18 *
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
21 * questions.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
22 */
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
23 package com.oracle.graal.lir.sparc;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
24
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
25 import static com.oracle.graal.api.code.ValueUtil.*;
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
26 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
27
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
28 import java.util.*;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
29
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
30 import com.oracle.graal.api.code.*;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
31 import com.oracle.graal.asm.sparc.*;
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
32 import com.oracle.graal.asm.sparc.SPARCAssembler.Lddf;
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
33 import com.oracle.graal.asm.sparc.SPARCAssembler.Stx;
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
34 import com.oracle.graal.lir.*;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
35 import com.oracle.graal.lir.StandardOp.SaveRegistersOp;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
36 import com.oracle.graal.lir.asm.*;
18443
1c92d437179b FrameMapBuilder: move into package.
Josef Eisl <josef.eisl@jku.at>
parents: 18425
diff changeset
37 import com.oracle.graal.lir.framemap.*;
16932
4d77f938aa02 [SPARC] Exclude AMD64 tests from SPARC testrun, always use tmp register when using StrategySwitch, using registerSaver in EnterUnpackStackFrame, LeaveCurrentStackframe, adding guarantee to load offsets when doing load reg+imm13 when the imm value does not fit in 13 bit, assertions for scratch register usage (tmp/def)
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16094
diff changeset
38 import com.oracle.graal.sparc.*;
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
39
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
40 /**
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
41 * Saves registers to stack slots.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
42 */
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
43 @Opcode("SAVE_REGISTER")
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
44 public class SPARCSaveRegistersOp extends SPARCLIRInstruction implements SaveRegistersOp {
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18443
diff changeset
45 public static final LIRInstructionClass<SPARCSaveRegistersOp> TYPE = LIRInstructionClass.create(SPARCSaveRegistersOp.class);
18163
c88ab4f1f04a re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents: 18140
diff changeset
46 public static final Register RETURN_REGISTER_STORAGE = SPARC.d62;
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
47 /**
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
48 * The registers (potentially) saved by this operation.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
49 */
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
50 protected final Register[] savedRegisters;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
51
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
52 /**
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
53 * The slots to which the registers are saved.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
54 */
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
55 @Def(STACK) protected final StackSlotValue[] slots;
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
56
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
57 /**
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
58 * Specifies if {@link #remove(Set)} should have an effect.
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
59 */
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
60 protected final boolean supportsRemove;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
61
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
62 /**
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
63 *
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
64 * @param savedRegisters the registers saved by this operation which may be subject to
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
65 * {@linkplain #remove(Set) pruning}
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
66 * @param savedRegisterLocations the slots to which the registers are saved
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
67 * @param supportsRemove determines if registers can be {@linkplain #remove(Set) pruned}
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
68 */
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
69 public SPARCSaveRegistersOp(Register[] savedRegisters, StackSlotValue[] savedRegisterLocations, boolean supportsRemove) {
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 18443
diff changeset
70 super(TYPE);
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
71 assert Arrays.asList(savedRegisterLocations).stream().allMatch(ValueUtil::isVirtualStackSlot);
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
72 this.savedRegisters = savedRegisters;
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
73 this.slots = savedRegisterLocations;
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
74 this.supportsRemove = supportsRemove;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
75 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
76
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
77 private static void saveRegister(CompilationResultBuilder crb, SPARCMacroAssembler masm, StackSlot result, Register register) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15345
diff changeset
78 RegisterValue input = register.asValue(result.getLIRKind());
17206
2d401b9ca70d [SPARC] Improve the lookup for delayable candidates, renaming interfaces/methods
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17177
diff changeset
79 SPARCMove.move(crb, masm, result, input, SPARCDelayedControlTransfer.DUMMY);
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
80 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
81
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
82 @Override
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
83 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
17082
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
84 // Can be used with VIS3
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
85 // new Movxtod(SPARC.i0, RETURN_REGISTER_STORAGE).emit(masm);
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
86 // We abuse the first stackslot for transferring i0 to return_register_storage
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
87 // assert slots.length >= 1;
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
88 SPARCAddress slot0Address = (SPARCAddress) crb.asAddress(slots[0]);
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
89 new Stx(SPARC.i0, slot0Address).emit(masm);
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
90 new Lddf(slot0Address, RETURN_REGISTER_STORAGE).emit(masm);
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
91
f8586d059f9d [SPARC] make compatible for CPU without VIS3 and do some cleanup
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17026
diff changeset
92 // Now save the registers
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
93 for (int i = 0; i < savedRegisters.length; i++) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
94 if (savedRegisters[i] != null) {
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
95 assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
96 saveRegister(crb, masm, asStackSlot(slots[i]), savedRegisters[i]);
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
97 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
98 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
99 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
100
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
101 public StackSlotValue[] getSlots() {
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
102 return slots;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
103 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
104
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
105 public boolean supportsRemove() {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
106 return supportsRemove;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
107 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
108
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
109 public int remove(Set<Register> doNotSave) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
110 if (!supportsRemove) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
111 throw new UnsupportedOperationException();
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
112 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
113 return prune(doNotSave, savedRegisters);
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
114 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
115
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
116 static int prune(Set<Register> toRemove, Register[] registers) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
117 int pruned = 0;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
118 for (int i = 0; i < registers.length; i++) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
119 if (registers[i] != null) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
120 if (toRemove.contains(registers[i])) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
121 registers[i] = null;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
122 pruned++;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
123 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
124 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
125 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
126 return pruned;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
127 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
128
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
129 public RegisterSaveLayout getMap(FrameMap frameMap) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
130 int total = 0;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
131 for (int i = 0; i < savedRegisters.length; i++) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
132 if (savedRegisters[i] != null) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
133 total++;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
134 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
135 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
136 Register[] keys = new Register[total];
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
137 int[] values = new int[total];
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
138 if (total != 0) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
139 int mapIndex = 0;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
140 for (int i = 0; i < savedRegisters.length; i++) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
141 if (savedRegisters[i] != null) {
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
142 keys[mapIndex] = savedRegisters[i];
18425
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
143 assert isStackSlot(slots[i]) : "not a StackSlot: " + slots[i];
b856446ff7e0 Introduce StackSlotValue and VirtualStackSlot.
Josef Eisl <josef.eisl@jku.at>
parents: 18163
diff changeset
144 StackSlot slot = asStackSlot(slots[i]);
18140
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
145 values[mapIndex] = indexForStackSlot(frameMap, slot);
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
146 mapIndex++;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
147 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
148 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
149 assert mapIndex == total;
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
150 }
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
151 return new RegisterSaveLayout(keys, values);
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
152 }
18140
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
153
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
154 /**
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
155 * Computes the index of a stack slot relative to slot 0. This is also the bit index of stack
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
156 * slots in the reference map.
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
157 *
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
158 * @param slot a stack slot
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
159 * @return the index of the stack slot
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
160 */
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
161 private static int indexForStackSlot(FrameMap frameMap, StackSlot slot) {
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
162 assert frameMap.offsetForStackSlot(slot) % frameMap.getTarget().wordSize == 0;
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
163 int value = frameMap.offsetForStackSlot(slot) / frameMap.getTarget().wordSize;
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
164 return value;
185bd9096c88 Remove FrameMap.indexForStackSlot().
Josef Eisl <josef.eisl@jku.at>
parents: 17206
diff changeset
165 }
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents:
diff changeset
166 }