annotate src/cpu/x86/vm/c1_FrameMap_x86.hpp @ 20304:a22acf6d7598

8048112: G1 Full GC needs to support the case when the very first region is not available Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 10:00:31 +0200
parents 55fb97c4c58d
children 4ca6dc0799b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17467
55fb97c4c58d 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 12226
diff changeset
2 * Copyright (c) 1999, 2013, 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;
6739
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
76
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
77 static LIR_Opr rsi_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
78 static LIR_Opr rdi_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
79 static LIR_Opr rbx_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
80 static LIR_Opr rax_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
81 static LIR_Opr rdx_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
82 static LIR_Opr rcx_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
83
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
84 #ifdef _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
85
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
86 static LIR_Opr r8_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
87 static LIR_Opr r9_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
88 static LIR_Opr r10_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
89 static LIR_Opr r11_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
90 static LIR_Opr r12_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
91 static LIR_Opr r13_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
92 static LIR_Opr r14_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
93 static LIR_Opr r15_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 static LIR_Opr r8_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
96 static LIR_Opr r9_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
97
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
98 static LIR_Opr r11_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
99 static LIR_Opr r12_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
100 static LIR_Opr r13_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
101 static LIR_Opr r14_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
102
6739
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
103 static LIR_Opr r8_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
104 static LIR_Opr r9_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
105
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
106 static LIR_Opr r11_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
107 static LIR_Opr r12_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
108 static LIR_Opr r13_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
109 static LIR_Opr r14_metadata_opr;
8a02ca5e5576 7195816: NPG: Crash in c1_ValueType - ShouldNotReachHere
roland
parents: 2002
diff changeset
110
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
111 #endif // _LP64
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
112
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
113 static LIR_Opr long0_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
114 static LIR_Opr long1_opr;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
115 static LIR_Opr fpu0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 static LIR_Opr fpu0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
117 static LIR_Opr xmm0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
118 static LIR_Opr xmm0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
119
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
120 #ifdef _LP64
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
121 static LIR_Opr as_long_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
122 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
123 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
124 static LIR_Opr as_pointer_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
125 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
126 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
127 #else
0
a61af66fc99e Initial load
duke
parents:
diff changeset
128 static LIR_Opr as_long_opr(Register r, Register r2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r2));
a61af66fc99e Initial load
duke
parents:
diff changeset
130 }
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
131 static LIR_Opr as_pointer_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
132 return LIR_OprFact::single_cpu(cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
133 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
134 #endif // _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // VMReg name for spilled physical FPU stack slot n
a61af66fc99e Initial load
duke
parents:
diff changeset
137 static VMReg fpu_regname (int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 static XMMRegister nr2xmmreg(int rnr);
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 static bool is_caller_save_register (LIR_Opr opr) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
142 static bool is_caller_save_register (Register r) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 static LIR_Opr caller_save_xmm_reg_at(int i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
146 return _caller_save_xmm_regs[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
147 }
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
148
2002
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
149 static int adjust_reg_range(int range) {
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
150 // Reduce the number of available regs (to free r12) in case of compressed oops
12226
7944aba7ba41 8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents: 6853
diff changeset
151 if (UseCompressedOops || UseCompressedClassPointers) return range - 1;
2002
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
152 return range;
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
153 }
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
154
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
155 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
156 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
157 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
158
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1579
diff changeset
159 #endif // CPU_X86_VM_C1_FRAMEMAP_X86_HPP
2002
ac637b7220d1 6985015: C1 needs to support compressed oops
iveresov
parents: 1972
diff changeset
160