annotate src/cpu/x86/vm/c1_FrameMap_x86.hpp @ 1842:6e0aac35bfa9

6980838: G1: guarantee(false) failed: thread has an unexpected active value in its SATB queue Summary: Under certain circumstances a safepoint could happen between a JavaThread object being created and that object being added to the Java threads list. This could cause the active field of that thread's SATB queue to get out-of-sync with respect to the other Java threads. The solution is to activate the SATB queue, when necessary, before adding the thread to the Java threads list, not when the JavaThread object is created. The changeset also includes a small fix to rename the surrogate locker thread from "Surrogate Locker Thread (CMS)" to "Surrogate Locker Thread (Concurrent GC)" since it's also used in G1. Reviewed-by: iveresov, ysr, johnc, jcoomes
author tonyp
date Fri, 01 Oct 2010 16:43:05 -0400
parents e9ff18c4ace7
children f95d63e2154a
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
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // On i486 the frame looks as follows:
a61af66fc99e Initial load
duke
parents:
diff changeset
26 //
a61af66fc99e Initial load
duke
parents:
diff changeset
27 // +-----------------------------+---------+----------------------------------------+----------------+-----------
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling .
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // +-----------------------------+---------+----------------------------------------+----------------+-----------
a61af66fc99e Initial load
duke
parents:
diff changeset
30 //
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // The FPU registers are mapped with their offset from TOS; therefore the
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // status of FPU stack must be updated during code emission.
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
35 static const int pd_c_runtime_reserved_arg_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 nof_xmm_regs = pd_nof_xmm_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
39 nof_caller_save_xmm_regs = pd_nof_caller_save_xmm_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
40 first_available_sp_in_frame = 0,
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
41 #ifndef _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 frame_pad_in_bytes = 8,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 nof_reg_args = 2
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
44 #else
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
45 frame_pad_in_bytes = 16,
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
46 nof_reg_args = 6
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
47 #endif // _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
48 };
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static LIR_Opr _caller_save_xmm_regs [nof_caller_save_xmm_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 static XMMRegister _xmm_regs[nof_xmm_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
56 static LIR_Opr receiver_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 static LIR_Opr rsi_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static LIR_Opr rdi_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 static LIR_Opr rbx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 static LIR_Opr rax_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 static LIR_Opr rdx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static LIR_Opr rcx_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 static LIR_Opr rsp_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 static LIR_Opr rbp_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 static LIR_Opr rsi_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 static LIR_Opr rdi_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 static LIR_Opr rbx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 static LIR_Opr rax_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 static LIR_Opr rdx_oop_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 static LIR_Opr rcx_oop_opr;
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
73 #ifdef _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
74
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
75 static LIR_Opr r8_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
76 static LIR_Opr r9_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
77 static LIR_Opr r10_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
78 static LIR_Opr r11_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
79 static LIR_Opr r12_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
80 static LIR_Opr r13_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
81 static LIR_Opr r14_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
82 static LIR_Opr r15_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
83
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
84 static LIR_Opr r8_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
85 static LIR_Opr r9_oop_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 r11_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
88 static LIR_Opr r12_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
89 static LIR_Opr r13_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
90 static LIR_Opr r14_oop_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
91
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
92 #endif // _LP64
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
93
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
94 static LIR_Opr long0_opr;
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
95 static LIR_Opr long1_opr;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
96 static LIR_Opr fpu0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 static LIR_Opr fpu0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
98 static LIR_Opr xmm0_float_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
99 static LIR_Opr xmm0_double_opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
100
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
101 #ifdef _LP64
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
102 static LIR_Opr as_long_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
103 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
104 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
105 static LIR_Opr as_pointer_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 #else
0
a61af66fc99e Initial load
duke
parents:
diff changeset
109 static LIR_Opr as_long_opr(Register r, Register r2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
110 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r2));
a61af66fc99e Initial load
duke
parents:
diff changeset
111 }
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
112 static LIR_Opr as_pointer_opr(Register r) {
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
113 return LIR_OprFact::single_cpu(cpu_reg2rnr(r));
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
114 }
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
115 #endif // _LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // VMReg name for spilled physical FPU stack slot n
a61af66fc99e Initial load
duke
parents:
diff changeset
118 static VMReg fpu_regname (int n);
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 static XMMRegister nr2xmmreg(int rnr);
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 static bool is_caller_save_register (LIR_Opr opr) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
123 static bool is_caller_save_register (Register r) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 static LIR_Opr caller_save_xmm_reg_at(int i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
127 return _caller_save_xmm_regs[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }