annotate src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp @ 1783:d5d065957597

6953144: Tiered compilation Summary: Infrastructure for tiered compilation support (interpreter + c1 + c2) for 32 and 64 bit. Simple tiered policy implementation. Reviewed-by: kvn, never, phh, twisti
author iveresov
date Fri, 03 Sep 2010 17:51:07 -0700
parents c18cbe5936b8
children f02a8bbe6ed4
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: 1295
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: 1295
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1295
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: 1295
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 #include "incls/_precompiled.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
26 #include "incls/_c1_CodeStubs_sparc.cpp.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 #define __ ce->masm()->
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
a61af66fc99e Initial load
duke
parents:
diff changeset
31 bool throw_index_out_of_bounds_exception)
a61af66fc99e Initial load
duke
parents:
diff changeset
32 : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
a61af66fc99e Initial load
duke
parents:
diff changeset
33 , _index(index)
a61af66fc99e Initial load
duke
parents:
diff changeset
34 {
a61af66fc99e Initial load
duke
parents:
diff changeset
35 _info = new CodeEmitInfo(info);
a61af66fc99e Initial load
duke
parents:
diff changeset
36 }
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 if (_index->is_register()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
43 __ mov(_index->as_register(), G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
45 __ set(_index->as_jint(), G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
46 }
a61af66fc99e Initial load
duke
parents:
diff changeset
47 if (_throw_index_out_of_bounds_exception) {
a61af66fc99e Initial load
duke
parents:
diff changeset
48 __ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
49 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
50 __ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 }
a61af66fc99e Initial load
duke
parents:
diff changeset
52 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
53 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
54 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
55 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
56 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
57 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
58 }
a61af66fc99e Initial load
duke
parents:
diff changeset
59
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
63 __ set(_bci, G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
64 __ call(Runtime1::entry_for(Runtime1::counter_overflow_id), relocInfo::runtime_call_type);
1783
d5d065957597 6953144: Tiered compilation
iveresov
parents: 1552
diff changeset
65 __ delayed()->mov_or_nop(_method->as_register(), G5);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
67 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 __ br(Assembler::always, true, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
70 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 void DivByZeroStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
75 if (_offset != -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
a61af66fc99e Initial load
duke
parents:
diff changeset
77 }
a61af66fc99e Initial load
duke
parents:
diff changeset
78 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
79 __ call(Runtime1::entry_for(Runtime1::throw_div0_exception_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
80 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
81 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
82 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
84 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
85 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
86 }
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
90 ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
a61af66fc99e Initial load
duke
parents:
diff changeset
91 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 __ call(Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id),
a61af66fc99e Initial load
duke
parents:
diff changeset
93 relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
95 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
98 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
99 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
100 }
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // Implementation of SimpleExceptionStub
a61af66fc99e Initial load
duke
parents:
diff changeset
104 // Note: %g1 and %g3 are already in use
a61af66fc99e Initial load
duke
parents:
diff changeset
105 void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
107 __ call(Runtime1::entry_for(_stub), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 if (_obj->is_valid()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
110 __ delayed()->mov(_obj->as_register(), G4); // _obj contains the optional argument to the stub
a61af66fc99e Initial load
duke
parents:
diff changeset
111 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 __ delayed()->mov(G0, G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
113 }
a61af66fc99e Initial load
duke
parents:
diff changeset
114 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
115 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
116 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
117 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // Implementation of ArrayStoreExceptionStub
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 ArrayStoreExceptionStub::ArrayStoreExceptionStub(CodeEmitInfo* info):
a61af66fc99e Initial load
duke
parents:
diff changeset
124 _info(info) {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 }
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 void ArrayStoreExceptionStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
130 __ call(Runtime1::entry_for(Runtime1::throw_array_store_exception_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
131 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
132 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
133 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
134 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
135 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
136 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // Implementation of NewInstanceStub
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 _result = result;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 _klass = klass;
a61af66fc99e Initial load
duke
parents:
diff changeset
147 _klass_reg = klass_reg;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 _info = new CodeEmitInfo(info);
a61af66fc99e Initial load
duke
parents:
diff changeset
149 assert(stub_id == Runtime1::new_instance_id ||
a61af66fc99e Initial load
duke
parents:
diff changeset
150 stub_id == Runtime1::fast_new_instance_id ||
a61af66fc99e Initial load
duke
parents:
diff changeset
151 stub_id == Runtime1::fast_new_instance_init_check_id,
a61af66fc99e Initial load
duke
parents:
diff changeset
152 "need new_instance id");
a61af66fc99e Initial load
duke
parents:
diff changeset
153 _stub_id = stub_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
154 }
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
159 __ call(Runtime1::entry_for(_stub_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
160 __ delayed()->mov_or_nop(_klass_reg->as_register(), G5);
a61af66fc99e Initial load
duke
parents:
diff changeset
161 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
162 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
163 __ br(Assembler::always, false, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
164 __ delayed()->mov_or_nop(O0, _result->as_register());
a61af66fc99e Initial load
duke
parents:
diff changeset
165 }
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 // Implementation of NewTypeArrayStub
a61af66fc99e Initial load
duke
parents:
diff changeset
169 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 _klass_reg = klass_reg;
a61af66fc99e Initial load
duke
parents:
diff changeset
171 _length = length;
a61af66fc99e Initial load
duke
parents:
diff changeset
172 _result = result;
a61af66fc99e Initial load
duke
parents:
diff changeset
173 _info = new CodeEmitInfo(info);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 __ mov(_length->as_register(), G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
181 __ call(Runtime1::entry_for(Runtime1::new_type_array_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 __ delayed()->mov_or_nop(_klass_reg->as_register(), G5);
a61af66fc99e Initial load
duke
parents:
diff changeset
183 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
184 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
185 __ br(Assembler::always, false, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
186 __ delayed()->mov_or_nop(O0, _result->as_register());
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 // Implementation of NewObjectArrayStub
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
a61af66fc99e Initial load
duke
parents:
diff changeset
193 _klass_reg = klass_reg;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 _length = length;
a61af66fc99e Initial load
duke
parents:
diff changeset
195 _result = result;
a61af66fc99e Initial load
duke
parents:
diff changeset
196 _info = new CodeEmitInfo(info);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199
a61af66fc99e Initial load
duke
parents:
diff changeset
200 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
201 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203 __ mov(_length->as_register(), G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
204 __ call(Runtime1::entry_for(Runtime1::new_object_array_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
205 __ delayed()->mov_or_nop(_klass_reg->as_register(), G5);
a61af66fc99e Initial load
duke
parents:
diff changeset
206 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
207 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
208 __ br(Assembler::always, false, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
209 __ delayed()->mov_or_nop(O0, _result->as_register());
a61af66fc99e Initial load
duke
parents:
diff changeset
210 }
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 // Implementation of MonitorAccessStubs
a61af66fc99e Initial load
duke
parents:
diff changeset
214 MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
a61af66fc99e Initial load
duke
parents:
diff changeset
215 : MonitorAccessStub(obj_reg, lock_reg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 _info = new CodeEmitInfo(info);
a61af66fc99e Initial load
duke
parents:
diff changeset
217 }
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219
a61af66fc99e Initial load
duke
parents:
diff changeset
220 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
221 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
222 __ mov(_obj_reg->as_register(), G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
223 if (ce->compilation()->has_fpu_code()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
224 __ call(Runtime1::entry_for(Runtime1::monitorenter_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
225 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
226 __ call(Runtime1::entry_for(Runtime1::monitorenter_nofpu_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
227 }
a61af66fc99e Initial load
duke
parents:
diff changeset
228 __ delayed()->mov_or_nop(_lock_reg->as_register(), G5);
a61af66fc99e Initial load
duke
parents:
diff changeset
229 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
230 ce->verify_oop_map(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
231 __ br(Assembler::always, true, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
232 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 void MonitorExitStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
238 if (_compute_lock) {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 ce->monitor_address(_monitor_ix, _lock_reg);
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241 if (ce->compilation()->has_fpu_code()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
242 __ call(Runtime1::entry_for(Runtime1::monitorexit_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
243 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 __ call(Runtime1::entry_for(Runtime1::monitorexit_nofpu_id), relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 __ delayed()->mov_or_nop(_lock_reg->as_register(), G4);
a61af66fc99e Initial load
duke
parents:
diff changeset
248 __ br(Assembler::always, true, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
249 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
250 }
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 // Implementation of patching:
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // - Copy the code at given offset to an inlined buffer (first the bytes, then the number of bytes)
a61af66fc99e Initial load
duke
parents:
diff changeset
254 // - Replace original code with a call to the stub
a61af66fc99e Initial load
duke
parents:
diff changeset
255 // At Runtime:
a61af66fc99e Initial load
duke
parents:
diff changeset
256 // - call to stub, jump to runtime
a61af66fc99e Initial load
duke
parents:
diff changeset
257 // - in runtime: preserve all registers (especially objects, i.e., source and destination object)
a61af66fc99e Initial load
duke
parents:
diff changeset
258 // - in runtime: after initializing class, restore original code, reexecute instruction
a61af66fc99e Initial load
duke
parents:
diff changeset
259
a61af66fc99e Initial load
duke
parents:
diff changeset
260 int PatchingStub::_patch_info_offset = -NativeGeneralJump::instruction_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262 void PatchingStub::align_patch_site(MacroAssembler* ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 // patch sites on sparc are always properly aligned.
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 void PatchingStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
267 // copy original code here
a61af66fc99e Initial load
duke
parents:
diff changeset
268 assert(NativeCall::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF,
a61af66fc99e Initial load
duke
parents:
diff changeset
269 "not enough room for call");
a61af66fc99e Initial load
duke
parents:
diff changeset
270 assert((_bytes_to_copy & 0x3) == 0, "must copy a multiple of four bytes");
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272 Label call_patch;
a61af66fc99e Initial load
duke
parents:
diff changeset
273
a61af66fc99e Initial load
duke
parents:
diff changeset
274 int being_initialized_entry = __ offset();
a61af66fc99e Initial load
duke
parents:
diff changeset
275
a61af66fc99e Initial load
duke
parents:
diff changeset
276 if (_id == load_klass_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
277 // produce a copy of the load klass instruction for use by the being initialized case
727
6b2273dd6fa9 6822110: Add AddressLiteral class on SPARC
twisti
parents: 342
diff changeset
278 #ifdef ASSERT
0
a61af66fc99e Initial load
duke
parents:
diff changeset
279 address start = __ pc();
727
6b2273dd6fa9 6822110: Add AddressLiteral class on SPARC
twisti
parents: 342
diff changeset
280 #endif
6b2273dd6fa9 6822110: Add AddressLiteral class on SPARC
twisti
parents: 342
diff changeset
281 AddressLiteral addrlit(NULL, oop_Relocation::spec(_oop_index));
6b2273dd6fa9 6822110: Add AddressLiteral class on SPARC
twisti
parents: 342
diff changeset
282 __ patchable_set(addrlit, _obj);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
283
a61af66fc99e Initial load
duke
parents:
diff changeset
284 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
285 for (int i = 0; i < _bytes_to_copy; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
286 address ptr = (address)(_pc_start + i);
a61af66fc99e Initial load
duke
parents:
diff changeset
287 int a_byte = (*ptr) & 0xFF;
a61af66fc99e Initial load
duke
parents:
diff changeset
288 assert(a_byte == *start++, "should be the same code");
a61af66fc99e Initial load
duke
parents:
diff changeset
289 }
a61af66fc99e Initial load
duke
parents:
diff changeset
290 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
291 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // make a copy the code which is going to be patched.
a61af66fc99e Initial load
duke
parents:
diff changeset
293 for (int i = 0; i < _bytes_to_copy; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
294 address ptr = (address)(_pc_start + i);
a61af66fc99e Initial load
duke
parents:
diff changeset
295 int a_byte = (*ptr) & 0xFF;
a61af66fc99e Initial load
duke
parents:
diff changeset
296 __ a_byte (a_byte);
a61af66fc99e Initial load
duke
parents:
diff changeset
297 }
a61af66fc99e Initial load
duke
parents:
diff changeset
298 }
a61af66fc99e Initial load
duke
parents:
diff changeset
299
a61af66fc99e Initial load
duke
parents:
diff changeset
300 address end_of_patch = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
301 int bytes_to_skip = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
302 if (_id == load_klass_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
303 int offset = __ offset();
a61af66fc99e Initial load
duke
parents:
diff changeset
304 if (CommentedAssembly) {
a61af66fc99e Initial load
duke
parents:
diff changeset
305 __ block_comment(" being_initialized check");
a61af66fc99e Initial load
duke
parents:
diff changeset
306 }
a61af66fc99e Initial load
duke
parents:
diff changeset
307
a61af66fc99e Initial load
duke
parents:
diff changeset
308 // static field accesses have special semantics while the class
a61af66fc99e Initial load
duke
parents:
diff changeset
309 // initializer is being run so we emit a test which can be used to
a61af66fc99e Initial load
duke
parents:
diff changeset
310 // check that this code is being executed by the initializing
a61af66fc99e Initial load
duke
parents:
diff changeset
311 // thread.
a61af66fc99e Initial load
duke
parents:
diff changeset
312 assert(_obj != noreg, "must be a valid register");
a61af66fc99e Initial load
duke
parents:
diff changeset
313 assert(_oop_index >= 0, "must have oop index");
a61af66fc99e Initial load
duke
parents:
diff changeset
314 __ ld_ptr(_obj, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc), G3);
a61af66fc99e Initial load
duke
parents:
diff changeset
315 __ cmp(G2_thread, G3);
a61af66fc99e Initial load
duke
parents:
diff changeset
316 __ br(Assembler::notEqual, false, Assembler::pn, call_patch);
a61af66fc99e Initial load
duke
parents:
diff changeset
317 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 // load_klass patches may execute the patched code before it's
a61af66fc99e Initial load
duke
parents:
diff changeset
320 // copied back into place so we need to jump back into the main
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // code of the nmethod to continue execution.
a61af66fc99e Initial load
duke
parents:
diff changeset
322 __ br(Assembler::always, false, Assembler::pt, _patch_site_continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
323 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
324
a61af66fc99e Initial load
duke
parents:
diff changeset
325 // make sure this extra code gets skipped
a61af66fc99e Initial load
duke
parents:
diff changeset
326 bytes_to_skip += __ offset() - offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
327 }
a61af66fc99e Initial load
duke
parents:
diff changeset
328
a61af66fc99e Initial load
duke
parents:
diff changeset
329 // Now emit the patch record telling the runtime how to find the
a61af66fc99e Initial load
duke
parents:
diff changeset
330 // pieces of the patch. We only need 3 bytes but it has to be
a61af66fc99e Initial load
duke
parents:
diff changeset
331 // aligned as an instruction so emit 4 bytes.
a61af66fc99e Initial load
duke
parents:
diff changeset
332 int sizeof_patch_record = 4;
a61af66fc99e Initial load
duke
parents:
diff changeset
333 bytes_to_skip += sizeof_patch_record;
a61af66fc99e Initial load
duke
parents:
diff changeset
334
a61af66fc99e Initial load
duke
parents:
diff changeset
335 // emit the offsets needed to find the code to patch
a61af66fc99e Initial load
duke
parents:
diff changeset
336 int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record;
a61af66fc99e Initial load
duke
parents:
diff changeset
337
a61af66fc99e Initial load
duke
parents:
diff changeset
338 // Emit the patch record. We need to emit a full word, so emit an extra empty byte
a61af66fc99e Initial load
duke
parents:
diff changeset
339 __ a_byte(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
340 __ a_byte(being_initialized_entry_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
341 __ a_byte(bytes_to_skip);
a61af66fc99e Initial load
duke
parents:
diff changeset
342 __ a_byte(_bytes_to_copy);
a61af66fc99e Initial load
duke
parents:
diff changeset
343 address patch_info_pc = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
344 assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info");
a61af66fc99e Initial load
duke
parents:
diff changeset
345
a61af66fc99e Initial load
duke
parents:
diff changeset
346 address entry = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
347 NativeGeneralJump::insert_unconditional((address)_pc_start, entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
348 address target = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
349 switch (_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
350 case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
351 case load_klass_id: target = Runtime1::entry_for(Runtime1::load_klass_patching_id); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
352 default: ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
353 }
a61af66fc99e Initial load
duke
parents:
diff changeset
354 __ bind(call_patch);
a61af66fc99e Initial load
duke
parents:
diff changeset
355
a61af66fc99e Initial load
duke
parents:
diff changeset
356 if (CommentedAssembly) {
a61af66fc99e Initial load
duke
parents:
diff changeset
357 __ block_comment("patch entry point");
a61af66fc99e Initial load
duke
parents:
diff changeset
358 }
a61af66fc99e Initial load
duke
parents:
diff changeset
359 __ call(target, relocInfo::runtime_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
360 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
361 assert(_patch_info_offset == (patch_info_pc - __ pc()), "must not change");
a61af66fc99e Initial load
duke
parents:
diff changeset
362 ce->add_call_info_here(_info);
a61af66fc99e Initial load
duke
parents:
diff changeset
363 __ br(Assembler::always, false, Assembler::pt, _patch_site_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
364 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
365 if (_id == load_klass_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
366 CodeSection* cs = __ code_section();
a61af66fc99e Initial load
duke
parents:
diff changeset
367 address pc = (address)_pc_start;
a61af66fc99e Initial load
duke
parents:
diff changeset
368 RelocIterator iter(cs, pc, pc + 1);
a61af66fc99e Initial load
duke
parents:
diff changeset
369 relocInfo::change_reloc_info_for_address(&iter, (address) pc, relocInfo::oop_type, relocInfo::none);
a61af66fc99e Initial load
duke
parents:
diff changeset
370
a61af66fc99e Initial load
duke
parents:
diff changeset
371 pc = (address)(_pc_start + NativeMovConstReg::add_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
372 RelocIterator iter2(cs, pc, pc+1);
a61af66fc99e Initial load
duke
parents:
diff changeset
373 relocInfo::change_reloc_info_for_address(&iter2, (address) pc, relocInfo::oop_type, relocInfo::none);
a61af66fc99e Initial load
duke
parents:
diff changeset
374 }
a61af66fc99e Initial load
duke
parents:
diff changeset
375
a61af66fc99e Initial load
duke
parents:
diff changeset
376 }
a61af66fc99e Initial load
duke
parents:
diff changeset
377
1295
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
378
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
379 void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
380 __ bind(_entry);
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
381 __ call(SharedRuntime::deopt_blob()->unpack_with_reexecution());
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
382 __ delayed()->nop();
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
383 ce->add_call_info_here(_info);
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
384 debug_only(__ should_not_reach_here());
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
385 }
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
386
3cf667df43ef 6919934: JSR 292 needs to support x86 C1
twisti
parents: 727
diff changeset
387
0
a61af66fc99e Initial load
duke
parents:
diff changeset
388 void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
a61af66fc99e Initial load
duke
parents:
diff changeset
389 //---------------slow case: call to native-----------------
a61af66fc99e Initial load
duke
parents:
diff changeset
390 __ bind(_entry);
a61af66fc99e Initial load
duke
parents:
diff changeset
391 __ mov(src()->as_register(), O0);
a61af66fc99e Initial load
duke
parents:
diff changeset
392 __ mov(src_pos()->as_register(), O1);
a61af66fc99e Initial load
duke
parents:
diff changeset
393 __ mov(dst()->as_register(), O2);
a61af66fc99e Initial load
duke
parents:
diff changeset
394 __ mov(dst_pos()->as_register(), O3);
a61af66fc99e Initial load
duke
parents:
diff changeset
395 __ mov(length()->as_register(), O4);
a61af66fc99e Initial load
duke
parents:
diff changeset
396
a61af66fc99e Initial load
duke
parents:
diff changeset
397 ce->emit_static_call_stub();
a61af66fc99e Initial load
duke
parents:
diff changeset
398
a61af66fc99e Initial load
duke
parents:
diff changeset
399 __ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
a61af66fc99e Initial load
duke
parents:
diff changeset
400 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
401 ce->add_call_info_here(info());
a61af66fc99e Initial load
duke
parents:
diff changeset
402 ce->verify_oop_map(info());
a61af66fc99e Initial load
duke
parents:
diff changeset
403
a61af66fc99e Initial load
duke
parents:
diff changeset
404 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
405 __ set((intptr_t)&Runtime1::_arraycopy_slowcase_cnt, O0);
a61af66fc99e Initial load
duke
parents:
diff changeset
406 __ ld(O0, 0, O1);
a61af66fc99e Initial load
duke
parents:
diff changeset
407 __ inc(O1);
a61af66fc99e Initial load
duke
parents:
diff changeset
408 __ st(O1, 0, O0);
a61af66fc99e Initial load
duke
parents:
diff changeset
409 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
410
a61af66fc99e Initial load
duke
parents:
diff changeset
411 __ br(Assembler::always, false, Assembler::pt, _continuation);
a61af66fc99e Initial load
duke
parents:
diff changeset
412 __ delayed()->nop();
a61af66fc99e Initial load
duke
parents:
diff changeset
413 }
a61af66fc99e Initial load
duke
parents:
diff changeset
414
a61af66fc99e Initial load
duke
parents:
diff changeset
415
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
416 ///////////////////////////////////////////////////////////////////////////////////
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
417 #ifndef SERIALGC
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
418
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
419 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
420 __ bind(_entry);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
421
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
422 assert(pre_val()->is_register(), "Precondition.");
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
423
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
424 Register pre_val_reg = pre_val()->as_register();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
425
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
426 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
427 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt,
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
428 pre_val_reg, _continuation);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
429 __ delayed()->nop();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
430
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
431 __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id));
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
432 __ delayed()->mov(pre_val_reg, G4);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
433 __ br(Assembler::always, false, Assembler::pt, _continuation);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
434 __ delayed()->nop();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
435
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
436 }
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
437
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
438 jbyte* G1PostBarrierStub::_byte_map_base = NULL;
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
439
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
440 jbyte* G1PostBarrierStub::byte_map_base_slow() {
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
441 BarrierSet* bs = Universe::heap()->barrier_set();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
442 assert(bs->is_a(BarrierSet::G1SATBCTLogging),
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
443 "Must be if we're using this.");
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
444 return ((G1SATBCardTableModRefBS*)bs)->byte_map_base;
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
445 }
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
446
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
447 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
448 __ bind(_entry);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
449
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
450 assert(addr()->is_register(), "Precondition.");
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
451 assert(new_val()->is_register(), "Precondition.");
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
452 Register addr_reg = addr()->as_pointer_register();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
453 Register new_val_reg = new_val()->as_register();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
454 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt,
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
455 new_val_reg, _continuation);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
456 __ delayed()->nop();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
457
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
458 __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id));
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
459 __ delayed()->mov(addr_reg, G4);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
460 __ br(Assembler::always, false, Assembler::pt, _continuation);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
461 __ delayed()->nop();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
462 }
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
463
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
464 #endif // SERIALGC
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
465 ///////////////////////////////////////////////////////////////////////////////////
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
466
0
a61af66fc99e Initial load
duke
parents:
diff changeset
467 #undef __