annotate src/cpu/x86/vm/c1_FrameMap_x86.hpp @ 3096:8073f5ad1d87

IdealGraphVisualizer: Rename predecessors to "Nodes Above" and successors to "Nodes Below" and actions "Expand Predecessors" and "Expand Successors" to "Expand Above" and "Expand Below" to avoid ambiguity with the Graal concept of successors and predecessors
author Peter Hofer <peter.hofer@jku.at>
date Wed, 29 Jun 2011 18:27:14 +0200
parents ac637b7220d1
children 8a02ca5e5576
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: 1301
diff changeset
2 * Copyright (c) 1999, 2010, 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: 1301
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1301
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: 1301
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
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
25 #ifndef CPU_X86_VM_C1_FRAMEMAP_X86_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
26 #define CPU_X86_VM_C1_FRAMEMAP_X86_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
27
0
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // On i486 the frame looks as follows:
a61af66fc99e Initial load
duke
parents:
diff changeset
29 //
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // +-----------------------------+---------+----------------------------------------+----------------+-----------
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling .
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // +-----------------------------+---------+----------------------------------------+----------------+-----------
a61af66fc99e Initial load
duke
parents:
diff changeset
33 //
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // The FPU registers are mapped with their offset from TOS; therefore the
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // status of FPU stack must be updated during code emission.
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
38 static const int pd_c_runtime_reserved_arg_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 nof_xmm_regs = pd_nof_xmm_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
42 nof_caller_save_xmm_regs = pd_nof_caller_save_xmm_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 first_available_sp_in_frame = 0,
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
44 #ifndef _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
45 frame_pad_in_bytes = 8,
a61af66fc99e Initial load
duke
parents:
diff changeset
46 nof_reg_args = 2
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
47 #else
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
48 frame_pad_in_bytes = 16,
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
49 nof_reg_args = 6
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
50 #endif // _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
51 };
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
54 static LIR_Opr _caller_save_xmm_regs [nof_caller_save_xmm_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 static XMMRegister _xmm_regs[nof_xmm_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static LIR_Opr receiver_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 static LIR_Opr rsi_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 static LIR_Opr rdi_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static LIR_Opr rbx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 static LIR_Opr rax_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 static LIR_Opr rdx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 static LIR_Opr rcx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 static LIR_Opr rsp_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 static LIR_Opr rbp_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static LIR_Opr rsi_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static LIR_Opr rdi_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 static LIR_Opr rbx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 static LIR_Opr rax_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 static LIR_Opr rdx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 static LIR_Opr rcx_oop_opr;
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
76 #ifdef _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
77
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
78 static LIR_Opr r8_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
79 static LIR_Opr r9_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
80 static LIR_Opr r10_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
81 static LIR_Opr r11_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
82 static LIR_Opr r12_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
83 static LIR_Opr r13_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
84 static LIR_Opr r14_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
85 static LIR_Opr r15_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
86
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
87 static LIR_Opr r8_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
88 static LIR_Opr r9_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
89
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
90 static LIR_Opr r11_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
91 static LIR_Opr r12_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
92 static LIR_Opr r13_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
93 static LIR_Opr r14_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
94
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
95 #endif // _LP64
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
96
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
97 static LIR_Opr long0_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
98 static LIR_Opr long1_opr;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
99 static LIR_Opr fpu0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 static LIR_Opr fpu0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
101 static LIR_Opr xmm0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
102 static LIR_Opr xmm0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
103
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
104 #ifdef _LP64
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
105 static LIR_Opr as_long_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
106 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
107 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
108 static LIR_Opr as_pointer_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
109 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
110 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
111 #else
0
a61af66fc99e Initial load
duke
parents:
diff changeset
112 static LIR_Opr as_long_opr(Register r, Register r2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
113 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r2));
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
115 static LIR_Opr as_pointer_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
116 return LIR_OprFact::single_cpu(cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
117 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
118 #endif // _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // VMReg name for spilled physical FPU stack slot n
a61af66fc99e Initial load
duke
parents:
diff changeset
121 static VMReg fpu_regname (int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 static XMMRegister nr2xmmreg(int rnr);
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 static bool is_caller_save_register (LIR_Opr opr) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
126 static bool is_caller_save_register (Register r) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 static LIR_Opr caller_save_xmm_reg_at(int i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
130 return _caller_save_xmm_regs[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
132
2002
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
133 static int adjust_reg_range(int range) {
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
134 // Reduce the number of available regs (to free r12) in case of compressed oops
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
135 if (UseCompressedOops) return range - 1;
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
136 return range;
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
137 }
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
138
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
139 static int nof_caller_save_cpu_regs() { return adjust_reg_range(pd_nof_caller_save_cpu_regs_frame_map); }
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
140 static int last_cpu_reg() { return adjust_reg_range(pd_last_cpu_reg); }
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
141 static int last_byte_reg() { return adjust_reg_range(pd_last_byte_reg); }
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
142
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
143 #endif // CPU_X86_VM_C1_FRAMEMAP_X86_HPP
2002
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
144