Tue, 26 Jul 2016 17:06:17 +0800
Add multiply word to GPR instruction (mul) in MIPS assembler.
1 /*
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
26 #include "precompiled.hpp"
27 #include "c1/c1_FrameMap.hpp"
28 #include "c1/c1_LIR.hpp"
29 #include "runtime/sharedRuntime.hpp"
30 #include "vmreg_mips.inline.hpp"
32 const int FrameMap::pd_c_runtime_reserved_arg_size = 0;
35 FloatRegister FrameMap::_fpu_regs[32];
39 LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
40 LIR_Opr opr = LIR_OprFact::illegalOpr;
41 VMReg r_1 = reg->first();
42 VMReg r_2 = reg->second();
43 if (r_1->is_stack()) {
44 // Convert stack slot to an SP offset
45 // The calling convention does not count the
46 // SharedRuntime::out_preserve_stack_slots() value
47 // so we must add it in here.
48 int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots())
49 * VMRegImpl::stack_slot_size;
50 opr = LIR_OprFact::address(new LIR_Address(_sp_opr, st_off, type));
51 } else if (r_1->is_Register()) {
52 Register reg = r_1->as_Register();
53 if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
54 Register reg2 = r_2->as_Register();
55 #ifdef _LP64
56 assert(reg2 == reg, "must be same register");
57 #endif
58 opr = as_long_opr(reg, reg2);
59 } else if (type == T_OBJECT || type == T_ARRAY) {
60 opr = as_oop_opr(reg);
61 } else {
62 opr = as_opr(reg);
63 }
64 } else if (r_1->is_FloatRegister()) {
65 assert(type == T_DOUBLE || type == T_FLOAT, "wrong type");
66 int num = r_1->as_FloatRegister()->encoding();
67 if (type == T_FLOAT) {
68 opr = LIR_OprFact::single_fpu(num);
69 } else {
70 opr = LIR_OprFact::double_fpu(num);
71 }
72 } else {
73 ShouldNotReachHere();
74 }
75 return opr;
76 }
78 // some useful constant RInfo's:
79 LIR_Opr FrameMap::_zero_opr;
80 LIR_Opr FrameMap::_k0_opr;
81 LIR_Opr FrameMap::_k1_opr;
82 LIR_Opr FrameMap::_at_opr;
83 LIR_Opr FrameMap::_v0_opr;
84 LIR_Opr FrameMap::_v1_opr;
85 LIR_Opr FrameMap::_a0_opr;
86 LIR_Opr FrameMap::_a1_opr;
87 LIR_Opr FrameMap::_a2_opr;
88 LIR_Opr FrameMap::_a3_opr;
89 LIR_Opr FrameMap::_t0_opr;
90 LIR_Opr FrameMap::_t1_opr;
91 LIR_Opr FrameMap::_t2_opr;
92 LIR_Opr FrameMap::_t3_opr;
93 #ifndef _LP64
94 LIR_Opr FrameMap::_t4_opr;
95 LIR_Opr FrameMap::_t5_opr;
96 LIR_Opr FrameMap::_t6_opr;
97 LIR_Opr FrameMap::_t7_opr;
98 #else
99 LIR_Opr FrameMap::_a4_opr;
100 LIR_Opr FrameMap::_a5_opr;
101 LIR_Opr FrameMap::_a6_opr;
102 LIR_Opr FrameMap::_a7_opr;
103 #endif
104 LIR_Opr FrameMap::_t8_opr;
105 LIR_Opr FrameMap::_t9_opr;
106 LIR_Opr FrameMap::_s0_opr;
107 LIR_Opr FrameMap::_s1_opr;
108 LIR_Opr FrameMap::_s2_opr;
109 LIR_Opr FrameMap::_s3_opr;
110 LIR_Opr FrameMap::_s4_opr;
111 LIR_Opr FrameMap::_s5_opr;
112 LIR_Opr FrameMap::_s6_opr;
113 LIR_Opr FrameMap::_s7_opr;
114 LIR_Opr FrameMap::_gp_opr;
115 LIR_Opr FrameMap::_fp_opr;
116 LIR_Opr FrameMap::_sp_opr;
117 LIR_Opr FrameMap::_ra_opr;
121 LIR_Opr FrameMap::_a0_a1_opr;
122 LIR_Opr FrameMap::_a2_a3_opr;
123 LIR_Opr FrameMap::_v0_v1_opr;
126 LIR_Opr FrameMap::_f0_opr;
127 LIR_Opr FrameMap::_f12_opr;
128 LIR_Opr FrameMap::_f14_opr;
129 LIR_Opr FrameMap::_d0_opr;
130 LIR_Opr FrameMap::_d12_opr;
131 LIR_Opr FrameMap::_d14_opr;
134 LIR_Opr FrameMap::receiver_opr;
136 //caller saved register
137 LIR_Opr FrameMap::_v0_oop_opr;
138 LIR_Opr FrameMap::_v1_oop_opr;
139 LIR_Opr FrameMap::_a0_oop_opr;
140 LIR_Opr FrameMap::_a1_oop_opr;
141 LIR_Opr FrameMap::_a2_oop_opr;
142 LIR_Opr FrameMap::_a3_oop_opr;
143 LIR_Opr FrameMap::_t0_oop_opr;
144 LIR_Opr FrameMap::_t1_oop_opr;
145 LIR_Opr FrameMap::_t2_oop_opr;
146 LIR_Opr FrameMap::_t3_oop_opr;
147 #ifndef _LP64
148 LIR_Opr FrameMap::_t4_oop_opr;
149 LIR_Opr FrameMap::_t5_oop_opr;
150 LIR_Opr FrameMap::_t6_oop_opr;
151 LIR_Opr FrameMap::_t7_oop_opr;
152 #else
153 LIR_Opr FrameMap::_a4_oop_opr;
154 LIR_Opr FrameMap::_a5_oop_opr;
155 LIR_Opr FrameMap::_a6_oop_opr;
156 LIR_Opr FrameMap::_a7_oop_opr;
157 #endif
158 LIR_Opr FrameMap::_t8_oop_opr;
159 LIR_Opr FrameMap::_t9_oop_opr;
160 LIR_Opr FrameMap::_s0_oop_opr;
161 LIR_Opr FrameMap::_s1_oop_opr;
162 LIR_Opr FrameMap::_s2_oop_opr;
163 LIR_Opr FrameMap::_s3_oop_opr;
164 LIR_Opr FrameMap::_s4_oop_opr;
165 LIR_Opr FrameMap::_s5_oop_opr;
166 LIR_Opr FrameMap::_s6_oop_opr;
167 LIR_Opr FrameMap::_s7_oop_opr;
170 LIR_Opr FrameMap::_a0_a1_long_opr;
171 LIR_Opr FrameMap::_a2_a3_long_opr;
172 LIR_Opr FrameMap::_v0_v1_long_opr;
173 LIR_Opr FrameMap::_f0_float_opr;
174 LIR_Opr FrameMap::_f12_float_opr;
175 LIR_Opr FrameMap::_f14_float_opr;
176 LIR_Opr FrameMap::_d0_double_opr;
177 LIR_Opr FrameMap::_d12_double_opr;
178 LIR_Opr FrameMap::_d14_double_opr;
183 LIR_Opr FrameMap::_caller_save_cpu_regs[] = { 0, };
184 LIR_Opr FrameMap::_caller_save_fpu_regs[] = { 0, };
187 //--------------------------------------------------------
188 // FrameMap
189 //--------------------------------------------------------
190 FloatRegister FrameMap::nr2floatreg (int rnr) {
191 assert(_init_done, "tables not initialized");
192 debug_only(fpu_range_check(rnr);)
193 return _fpu_regs[rnr];
194 }
196 // returns true if reg could be smashed by a callee.
197 bool FrameMap::is_caller_save_register (LIR_Opr reg) {
198 if (reg->is_single_fpu() || reg->is_double_fpu()) { return true; }
199 if (reg->is_double_cpu()) {
200 return is_caller_save_register(reg->as_register_lo()) ||
201 is_caller_save_register(reg->as_register_hi());
202 }
203 return is_caller_save_register(reg->as_register());
204 }
206 //FIXME, why always ture? @jerome
207 bool FrameMap::is_caller_save_register (Register r) {
208 // return (r>=V0 && r<=T7) || (r==T8) || (r==T9);
209 //return ((r>=V0) && (r<=T7));
210 return true;
211 }
213 void FrameMap::initialize() {
214 if (_init_done) return;
216 assert(nof_cpu_regs == 32, "wrong number of CPU registers");
217 //init _cpu_regs for RegAlloc
218 int i = 0;
220 map_register(0,R0); _zero_opr=LIR_OprFact::single_cpu(0);
221 map_register(1,AT);
222 #ifdef _LP64
223 _at_opr=LIR_OprFact::double_cpu(1, 1);
224 #else
225 _at_opr=LIR_OprFact::single_cpu(1);
226 #endif
227 map_register(2,V0); _v0_opr=LIR_OprFact::single_cpu(2); _v0_oop_opr=LIR_OprFact::single_cpu_oop(2);
228 map_register(3,V1); _v1_opr=LIR_OprFact::single_cpu(3); _v1_oop_opr=LIR_OprFact::single_cpu_oop(3);
229 map_register(4,A0); _a0_opr=LIR_OprFact::single_cpu(4); _a0_oop_opr=LIR_OprFact::single_cpu_oop(4);
230 map_register(5,A1); _a1_opr=LIR_OprFact::single_cpu(5); _a1_oop_opr=LIR_OprFact::single_cpu_oop(5);
231 map_register(6,A2); _a2_opr=LIR_OprFact::single_cpu(6); _a2_oop_opr=LIR_OprFact::single_cpu_oop(6);
232 map_register(7,A3); _a3_opr=LIR_OprFact::single_cpu(7); _a3_oop_opr=LIR_OprFact::single_cpu_oop(7);
233 #ifndef _LP64
234 map_register(8,T0); _t0_opr=LIR_OprFact::single_cpu(8); _t0_oop_opr=LIR_OprFact::single_cpu_oop(8);
235 map_register(9,T1); _t1_opr=LIR_OprFact::single_cpu(9); _t1_oop_opr=LIR_OprFact::single_cpu_oop(9);
236 map_register(10,T2); _t2_opr=LIR_OprFact::single_cpu(10); _t2_oop_opr=LIR_OprFact::single_cpu_oop(10);
237 map_register(11,T3); _t3_opr=LIR_OprFact::single_cpu(11); _t3_oop_opr=LIR_OprFact::single_cpu_oop(11);
238 map_register(12,T4); _t4_opr=LIR_OprFact::single_cpu(12); _t4_oop_opr=LIR_OprFact::single_cpu_oop(12);
239 map_register(13,T5); _t5_opr=LIR_OprFact::single_cpu(13); _t5_oop_opr=LIR_OprFact::single_cpu_oop(13);
240 map_register(14,T6); _t6_opr=LIR_OprFact::single_cpu(14); _t6_oop_opr=LIR_OprFact::single_cpu_oop(14);
241 map_register(15,T7); _t7_opr=LIR_OprFact::single_cpu(15); _t7_oop_opr=LIR_OprFact::single_cpu_oop(15);
242 #else
243 map_register(8,A4); _a4_opr=LIR_OprFact::single_cpu(8); _a4_oop_opr=LIR_OprFact::single_cpu_oop(8);
244 map_register(9,A5); _a5_opr=LIR_OprFact::single_cpu(9); _a5_oop_opr=LIR_OprFact::single_cpu_oop(9);
245 map_register(10,A6); _a6_opr=LIR_OprFact::single_cpu(10); _a6_oop_opr=LIR_OprFact::single_cpu_oop(10);
246 map_register(11,A7); _a7_opr=LIR_OprFact::single_cpu(11); _a7_oop_opr=LIR_OprFact::single_cpu_oop(11);
247 map_register(12,T0); _t0_opr=LIR_OprFact::single_cpu(12); _t0_oop_opr=LIR_OprFact::single_cpu_oop(12);
248 map_register(13,T1); _t1_opr=LIR_OprFact::single_cpu(13); _t1_oop_opr=LIR_OprFact::single_cpu_oop(13);
249 map_register(14,T2); _t2_opr=LIR_OprFact::single_cpu(14); _t2_oop_opr=LIR_OprFact::single_cpu_oop(14);
250 map_register(15,T3); _t3_opr=LIR_OprFact::single_cpu(15); _t3_oop_opr=LIR_OprFact::single_cpu_oop(15);
251 #endif
252 map_register(16,S0); _s0_opr=LIR_OprFact::single_cpu(16); _s0_oop_opr=LIR_OprFact::single_cpu_oop(16);
253 map_register(17,S1); _s1_opr=LIR_OprFact::single_cpu(17); _s1_oop_opr=LIR_OprFact::single_cpu_oop(17);
254 map_register(18,S2); _s2_opr=LIR_OprFact::single_cpu(18); _s2_oop_opr=LIR_OprFact::single_cpu_oop(18);
255 map_register(19,S3); _s3_opr=LIR_OprFact::single_cpu(19); _s3_oop_opr=LIR_OprFact::single_cpu_oop(19);
256 map_register(20,S4); _s4_opr=LIR_OprFact::single_cpu(20); _s4_oop_opr=LIR_OprFact::single_cpu_oop(20);
257 map_register(21,S5); _s5_opr=LIR_OprFact::single_cpu(21); _s5_oop_opr=LIR_OprFact::single_cpu_oop(21);
258 map_register(22,S6); _s6_opr=LIR_OprFact::single_cpu(22); _s6_oop_opr=LIR_OprFact::single_cpu_oop(22);
259 map_register(23,S7); _s7_opr=LIR_OprFact::single_cpu(23); _s7_oop_opr=LIR_OprFact::single_cpu_oop(23);
260 map_register(24,T8); _t8_opr=LIR_OprFact::single_cpu(24);
261 map_register(25,T9); _t9_opr=LIR_OprFact::single_cpu(25);
262 map_register(26,K0); _k0_opr=LIR_OprFact::single_cpu(26);
263 map_register(27,K1); _k1_opr=LIR_OprFact::single_cpu(27);
264 map_register(28,GP); _gp_opr=LIR_OprFact::single_cpu(28);
265 map_register(29,SP);
266 #ifdef _LP64
267 _sp_opr=LIR_OprFact::double_cpu(29, 29);
268 #else
269 _sp_opr=LIR_OprFact::single_cpu(29);
270 #endif
272 map_register(30,FP); _fp_opr=LIR_OprFact::single_cpu(30);
273 map_register(31,RA); _ra_opr=LIR_OprFact::single_cpu(31);
275 /*
276 _caller_save_cpu_regs[0] = _v0_opr;
277 _caller_save_cpu_regs[1] = _v1_opr;
278 _caller_save_cpu_regs[2] = _a0_opr;
279 _caller_save_cpu_regs[3] = _a1_opr;
280 _caller_save_cpu_regs[4] = _a2_opr;
281 _caller_save_cpu_regs[5] = _a3_opr;
282 _caller_save_cpu_regs[6] = _t0_opr;
283 _caller_save_cpu_regs[7] = _t1_opr;
284 _caller_save_cpu_regs[8] = _t2_opr;
285 _caller_save_cpu_regs[9] = _t3_opr;
286 _caller_save_cpu_regs[10] = _t4_opr;
287 _caller_save_cpu_regs[11] = _t5_opr;
288 _caller_save_cpu_regs[12] = _t6_opr;
289 _caller_save_cpu_regs[13] = _t7_opr;
290 _caller_save_cpu_regs[14] = _s0_opr;
291 _caller_save_cpu_regs[15] = _s1_opr;
292 _caller_save_cpu_regs[16] = _s2_opr;
293 _caller_save_cpu_regs[17] = _s3_opr;
294 _caller_save_cpu_regs[18] = _s4_opr;
295 _caller_save_cpu_regs[19] = _s5_opr;
296 _caller_save_cpu_regs[20] = _s6_opr;
297 _caller_save_cpu_regs[21] = _s7_opr;
298 _caller_save_cpu_regs[22] = _v0_opr;
299 _caller_save_cpu_regs[23] = _v1_opr;
300 */
301 _caller_save_cpu_regs[0] = _t0_opr;
302 _caller_save_cpu_regs[1] = _t1_opr;
303 _caller_save_cpu_regs[2] = _t2_opr;
304 _caller_save_cpu_regs[3] = _t3_opr;
305 #ifndef _LP64
306 _caller_save_cpu_regs[4] = _t4_opr;
307 _caller_save_cpu_regs[5] = _t5_opr;
308 _caller_save_cpu_regs[6] = _t6_opr;
309 _caller_save_cpu_regs[7] = _t7_opr;
310 #else
311 _caller_save_cpu_regs[4] = _a4_opr;
312 _caller_save_cpu_regs[5] = _a5_opr;
313 _caller_save_cpu_regs[6] = _a6_opr;
314 _caller_save_cpu_regs[7] = _a7_opr;
315 #endif
316 _caller_save_cpu_regs[8] = _s0_opr;
317 _caller_save_cpu_regs[9] = _s1_opr;
318 _caller_save_cpu_regs[10] = _s2_opr;
319 _caller_save_cpu_regs[11] = _s3_opr;
320 _caller_save_cpu_regs[12] = _s4_opr;
321 _caller_save_cpu_regs[13] = _s5_opr;
322 _caller_save_cpu_regs[14] = _s6_opr;
323 _caller_save_cpu_regs[15] = _s7_opr;
324 _caller_save_cpu_regs[16] = _v0_opr;
325 _caller_save_cpu_regs[17] = _v1_opr;
328 _caller_save_fpu_regs[0] = LIR_OprFact::single_fpu(0);
329 _caller_save_fpu_regs[1] = LIR_OprFact::single_fpu(1);
330 _caller_save_fpu_regs[2] = LIR_OprFact::single_fpu(2);
331 _caller_save_fpu_regs[3] = LIR_OprFact::single_fpu(3);
332 _caller_save_fpu_regs[4] = LIR_OprFact::single_fpu(4);
333 _caller_save_fpu_regs[5] = LIR_OprFact::single_fpu(5);
334 _caller_save_fpu_regs[6] = LIR_OprFact::single_fpu(6);
335 _caller_save_fpu_regs[7] = LIR_OprFact::single_fpu(7);
336 _caller_save_fpu_regs[8] = LIR_OprFact::single_fpu(8);
337 _caller_save_fpu_regs[9] = LIR_OprFact::single_fpu(9);
338 _caller_save_fpu_regs[10] = LIR_OprFact::single_fpu(10);
339 _caller_save_fpu_regs[11] = LIR_OprFact::single_fpu(11);
340 _caller_save_fpu_regs[12] = LIR_OprFact::single_fpu(12);
341 _caller_save_fpu_regs[13] = LIR_OprFact::single_fpu(13);
342 _caller_save_fpu_regs[14] = LIR_OprFact::single_fpu(14);
343 _caller_save_fpu_regs[15] = LIR_OprFact::single_fpu(15);
344 #ifdef _LP64
345 _caller_save_fpu_regs[16] = LIR_OprFact::single_fpu(16);
346 _caller_save_fpu_regs[17] = LIR_OprFact::single_fpu(17);
347 _caller_save_fpu_regs[18] = LIR_OprFact::single_fpu(18);
348 _caller_save_fpu_regs[19] = LIR_OprFact::single_fpu(19);
349 _caller_save_fpu_regs[20] = LIR_OprFact::single_fpu(20);
350 _caller_save_fpu_regs[21] = LIR_OprFact::single_fpu(21);
351 _caller_save_fpu_regs[22] = LIR_OprFact::single_fpu(22);
352 _caller_save_fpu_regs[23] = LIR_OprFact::single_fpu(23);
353 _caller_save_fpu_regs[24] = LIR_OprFact::single_fpu(24);
354 _caller_save_fpu_regs[25] = LIR_OprFact::single_fpu(25);
355 _caller_save_fpu_regs[26] = LIR_OprFact::single_fpu(26);
356 _caller_save_fpu_regs[27] = LIR_OprFact::single_fpu(27);
357 _caller_save_fpu_regs[28] = LIR_OprFact::single_fpu(28);
358 _caller_save_fpu_regs[29] = LIR_OprFact::single_fpu(29);
359 _caller_save_fpu_regs[30] = LIR_OprFact::single_fpu(30);
360 _caller_save_fpu_regs[31] = LIR_OprFact::single_fpu(31);
361 #endif
362 /*
363 _caller_save_fpu_regs[0] = LIR_OprFact::single_fpu(0);
364 _caller_save_fpu_regs[1] = LIR_OprFact::single_fpu(2);
365 _caller_save_fpu_regs[2] = LIR_OprFact::single_fpu(4);
366 _caller_save_fpu_regs[3] = LIR_OprFact::single_fpu(6);
367 _caller_save_fpu_regs[4] = LIR_OprFact::single_fpu(8);
368 _caller_save_fpu_regs[5] = LIR_OprFact::single_fpu(10);
369 _caller_save_fpu_regs[6] = LIR_OprFact::single_fpu(12);
370 _caller_save_fpu_regs[7] = LIR_OprFact::single_fpu(14);
371 _caller_save_fpu_regs[8] = LIR_OprFact::single_fpu(16);
372 _caller_save_fpu_regs[9] = LIR_OprFact::single_fpu(18);
373 _caller_save_fpu_regs[10] = LIR_OprFact::single_fpu(20);
374 _caller_save_fpu_regs[11] = LIR_OprFact::single_fpu(22);
375 _caller_save_fpu_regs[12] = LIR_OprFact::single_fpu(24);
376 _caller_save_fpu_regs[13] = LIR_OprFact::single_fpu(26);
377 _caller_save_fpu_regs[14] = LIR_OprFact::single_fpu(28);
378 _caller_save_fpu_regs[15] = LIR_OprFact::single_fpu(30);
379 */
381 for (int i = 0; i < 32; i++) {
382 _fpu_regs[i] = as_FloatRegister(i);
383 }
385 #ifndef _LP64
386 _a0_a1_long_opr=LIR_OprFact::double_cpu(4/*a0*/,5/*a1*/);
387 _a2_a3_long_opr=LIR_OprFact::double_cpu(6/*a2*/,7/*a3*/);
388 _v0_v1_long_opr=LIR_OprFact::double_cpu(2/*v0*/,3/*v1*/);
389 #else
390 _a0_a1_long_opr=LIR_OprFact::double_cpu(4/*a0*/,4/*a0*/);
391 _a2_a3_long_opr=LIR_OprFact::double_cpu(6/*a2*/,6/*a2*/);
392 _v0_v1_long_opr=LIR_OprFact::double_cpu(2/*v0*/,2/*v0*/);
393 #endif
394 _f0_float_opr =LIR_OprFact::single_fpu(0/*f0*/);
395 _f12_float_opr =LIR_OprFact::single_fpu(12/*f12*/);
396 _f14_float_opr =LIR_OprFact::single_fpu(14/*f14*/);
397 _d0_double_opr =LIR_OprFact::double_fpu(0/*f0*/);
398 _d12_double_opr=LIR_OprFact::double_fpu(12/*f12*/);
399 _d14_double_opr=LIR_OprFact::double_fpu(14/*f14*/);
402 _init_done = true;
404 VMRegPair regs;
405 BasicType sig_bt = T_OBJECT;
406 SharedRuntime::java_calling_convention(&sig_bt, ®s, 1, true);
408 receiver_opr = as_oop_opr(regs.first()->as_Register());
409 assert(receiver_opr == _t0_oop_opr, "rcvr ought to be t0");
411 }
414 Address FrameMap::make_new_address(ByteSize sp_offset) const {
415 return Address(SP, in_bytes(sp_offset));
416 }
419 // ----------------mapping-----------------------
420 // all mapping is based on rbp, addressing, except for simple leaf methods where we access
421 // the locals rsp based (and no frame is built)
424 // Frame for simple leaf methods (quick entries)
425 //
426 // +----------+
427 // | ret addr | <- TOS
428 // +----------+
429 // | args |
430 // | ...... |
432 // Frame for standard methods
433 //
434 // | .........| <- TOS
435 // | locals |
436 // +----------+
437 // | old rbp, | <- EBP
438 // +----------+
439 // | ret addr |
440 // +----------+
441 // | args |
442 // | .........|
445 // For OopMaps, map a local variable or spill index to an VMRegImpl name.
446 // This is the offset from sp() in the frame of the slot for the index,
447 // skewed by VMRegImpl::stack0 to indicate a stack location (vs.a register.)
448 //
449 // framesize +
450 // stack0 stack0 0 <- VMReg
451 // | | <registers> |
452 // ...........|..............|.............|
453 // 0 1 2 3 x x 4 5 6 ... | <- local indices
454 // ^ ^ sp() ( x x indicate link
455 // | | and return addr)
456 // arguments non-argument locals
458 VMReg FrameMap::fpu_regname (int n) {
459 // Return the OptoReg name for the fpu stack slot "n"
460 // A spilled fpu stack slot comprises to two single-word OptoReg's.
461 return as_FloatRegister(n)->as_VMReg();
462 }
464 LIR_Opr FrameMap::stack_pointer() {
465 //return FrameMap::esp_opr;
466 return FrameMap::_sp_opr;
467 }
469 // JSR 292
470 LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
471 assert(SP == mh_SP_save, "must be same register");
472 return _sp_opr;
473 }
475 bool FrameMap::validate_frame() {
476 return true;
477 }