< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

Print this page

103   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
104   __ far_call(RuntimeAddress(a));
105   ce->add_call_info_here(_info);
106   ce->verify_oop_map(_info);
107   debug_only(__ should_not_reach_here());
108 }
109 
110 void DivByZeroStub::emit_code(LIR_Assembler* ce) {
111   if (_offset != -1) {
112     ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
113   }
114   __ bind(_entry);
115   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id)));
116   ce->add_call_info_here(_info);
117   ce->verify_oop_map(_info);
118 #ifdef ASSERT
119   __ should_not_reach_here();
120 #endif
121 }
122 


































































123 
124 
125 // Implementation of NewInstanceStub
126 
127 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
128   _result = result;
129   _klass = klass;
130   _klass_reg = klass_reg;
131   _info = new CodeEmitInfo(info);
132   assert(stub_id == Runtime1::new_instance_id                 ||
133          stub_id == Runtime1::fast_new_instance_id            ||
134          stub_id == Runtime1::fast_new_instance_init_check_id,
135          "need new_instance id");
136   _stub_id   = stub_id;
137 }
138 
139 
140 
141 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
142   assert(__ rsp_offset() == 0, "frame size should be fixed");
143   __ bind(_entry);
144   __ mov(r3, _klass_reg->as_register());
145   __ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
146   ce->add_call_info_here(_info);
147   ce->verify_oop_map(_info);
148   assert(_result->as_register() == r0, "result must in r0,");
149   __ b(_continuation);
150 }
151 
152 
153 // Implementation of NewTypeArrayStub
154 
155 // Implementation of NewTypeArrayStub
156 
157 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
158   _klass_reg = klass_reg;
159   _length = length;
160   _result = result;
161   _info = new CodeEmitInfo(info);
162 }
163 
164 
165 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
166   assert(__ rsp_offset() == 0, "frame size should be fixed");
167   __ bind(_entry);
168   assert(_length->as_register() == r19, "length must in r19,");
169   assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
170   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id)));
171   ce->add_call_info_here(_info);
172   ce->verify_oop_map(_info);
173   assert(_result->as_register() == r0, "result must in r0");
174   __ b(_continuation);
175 }
176 
177 
178 // Implementation of NewObjectArrayStub
179 
180 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {

181   _klass_reg = klass_reg;
182   _result = result;
183   _length = length;
184   _info = new CodeEmitInfo(info);

185 }
186 
187 
188 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
189   assert(__ rsp_offset() == 0, "frame size should be fixed");
190   __ bind(_entry);
191   assert(_length->as_register() == r19, "length must in r19,");
192   assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
193   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id)));






194   ce->add_call_info_here(_info);
195   ce->verify_oop_map(_info);
196   assert(_result->as_register() == r0, "result must in r0");
197   __ b(_continuation);
198 }
199 
200 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
201   assert(__ rsp_offset() == 0, "frame size should be fixed");
202   __ bind(_entry);










203   ce->store_parameter(_obj_reg->as_register(),  1);
204   ce->store_parameter(_lock_reg->as_register(), 0);
205   Runtime1::StubID enter_id;
206   if (ce->compilation()->has_fpu_code()) {
207     enter_id = Runtime1::monitorenter_id;
208   } else {
209     enter_id = Runtime1::monitorenter_nofpu_id;
210   }
211   __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
212   ce->add_call_info_here(_info);
213   ce->verify_oop_map(_info);
214   __ b(_continuation);
215 }
216 
217 
218 void MonitorExitStub::emit_code(LIR_Assembler* ce) {
219   __ bind(_entry);
220   if (_compute_lock) {
221     // lock_reg was destroyed by fast unlocking attempt => recompute it
222     ce->monitor_address(_monitor_ix, _lock_reg);

103   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
104   __ far_call(RuntimeAddress(a));
105   ce->add_call_info_here(_info);
106   ce->verify_oop_map(_info);
107   debug_only(__ should_not_reach_here());
108 }
109 
110 void DivByZeroStub::emit_code(LIR_Assembler* ce) {
111   if (_offset != -1) {
112     ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
113   }
114   __ bind(_entry);
115   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_div0_exception_id)));
116   ce->add_call_info_here(_info);
117   ce->verify_oop_map(_info);
118 #ifdef ASSERT
119   __ should_not_reach_here();
120 #endif
121 }
122 
123 // Implementation of LoadFlattenedArrayStub
124 
125 LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
126   _array = array;
127   _index = index;
128   _result = result;
129   _scratch_reg = FrameMap::r0_oop_opr;
130   _info = new CodeEmitInfo(info);
131 }
132 
133 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
134   assert(__ rsp_offset() == 0, "frame size should be fixed");
135   __ bind(_entry);
136   ce->store_parameter(_array->as_register(), 1);
137   ce->store_parameter(_index->as_register(), 0);
138   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::load_flat_array_id)));
139   ce->add_call_info_here(_info);
140   ce->verify_oop_map(_info);
141   if (_result->as_register() != r0) {
142     __ mov(_result->as_register(), r0);
143   }
144   __ b(_continuation);
145 }
146 
147 
148 // Implementation of StoreFlattenedArrayStub
149 
150 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {
151   _array = array;
152   _index = index;
153   _value = value;
154   _scratch_reg = FrameMap::r0_oop_opr;
155   _info = new CodeEmitInfo(info);
156 }
157 
158 
159 void StoreFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
160   assert(__ rsp_offset() == 0, "frame size should be fixed");
161   __ bind(_entry);
162   ce->store_parameter(_array->as_register(), 2);
163   ce->store_parameter(_index->as_register(), 1);
164   ce->store_parameter(_value->as_register(), 0);
165   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::store_flat_array_id)));
166   ce->add_call_info_here(_info);
167   ce->verify_oop_map(_info);
168   __ b(_continuation);
169 }
170 
171 // Implementation of SubstitutabilityCheckStub
172 SubstitutabilityCheckStub::SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info) {
173   _left = left;
174   _right = right;
175   _scratch_reg = FrameMap::r0_oop_opr;
176   _info = new CodeEmitInfo(info);
177 }
178 
179 void SubstitutabilityCheckStub::emit_code(LIR_Assembler* ce) {
180   assert(__ rsp_offset() == 0, "frame size should be fixed");
181   __ bind(_entry);
182   ce->store_parameter(_left->as_register(), 1);
183   ce->store_parameter(_right->as_register(), 0);
184   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::substitutability_check_id)));
185   ce->add_call_info_here(_info);
186   ce->verify_oop_map(_info);
187   __ b(_continuation);
188 }
189 
190 
191 // Implementation of NewInstanceStub
192 
193 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
194   _result = result;
195   _klass = klass;
196   _klass_reg = klass_reg;
197   _info = new CodeEmitInfo(info);
198   assert(stub_id == Runtime1::new_instance_id                 ||
199          stub_id == Runtime1::fast_new_instance_id            ||
200          stub_id == Runtime1::fast_new_instance_init_check_id,
201          "need new_instance id");
202   _stub_id   = stub_id;
203 }
204 


205 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
206   assert(__ rsp_offset() == 0, "frame size should be fixed");
207   __ bind(_entry);
208   __ mov(r3, _klass_reg->as_register());
209   __ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
210   ce->add_call_info_here(_info);
211   ce->verify_oop_map(_info);
212   assert(_result->as_register() == r0, "result must in r0,");
213   __ b(_continuation);
214 }
215 
216 
217 // Implementation of NewTypeArrayStub
218 
219 // Implementation of NewTypeArrayStub
220 
221 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
222   _klass_reg = klass_reg;
223   _length = length;
224   _result = result;
225   _info = new CodeEmitInfo(info);
226 }
227 
228 
229 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
230   assert(__ rsp_offset() == 0, "frame size should be fixed");
231   __ bind(_entry);
232   assert(_length->as_register() == r19, "length must in r19,");
233   assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
234   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id)));
235   ce->add_call_info_here(_info);
236   ce->verify_oop_map(_info);
237   assert(_result->as_register() == r0, "result must in r0");
238   __ b(_continuation);
239 }
240 
241 
242 // Implementation of NewObjectArrayStub
243 
244 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result,
245                                        CodeEmitInfo* info, bool is_null_free) {
246   _klass_reg = klass_reg;
247   _result = result;
248   _length = length;
249   _info = new CodeEmitInfo(info);
250   _is_null_free = is_null_free;
251 }
252 
253 
254 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
255   assert(__ rsp_offset() == 0, "frame size should be fixed");
256   __ bind(_entry);
257   assert(_length->as_register() == r19, "length must in r19,");
258   assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
259 
260   if (_is_null_free) {
261     __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_flat_array_id)));
262   } else {
263     __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id)));
264   }
265 
266   ce->add_call_info_here(_info);
267   ce->verify_oop_map(_info);
268   assert(_result->as_register() == r0, "result must in r0");
269   __ b(_continuation);
270 }
271 
272 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
273   assert(__ rsp_offset() == 0, "frame size should be fixed");
274   __ bind(_entry);
275   if (_throw_imse_stub != nullptr) {
276     // When we come here, _obj_reg has already been checked to be non-null.
277     __ ldr(rscratch1, Address(_obj_reg->as_register(), oopDesc::mark_offset_in_bytes()));
278     __ mov(rscratch2, markWord::inline_type_pattern);
279     __ andr(rscratch1, rscratch1, rscratch2);
280 
281     __ cmp(rscratch1, rscratch2);
282     __ br(Assembler::EQ, *_throw_imse_stub->entry());
283   }
284 
285   ce->store_parameter(_obj_reg->as_register(),  1);
286   ce->store_parameter(_lock_reg->as_register(), 0);
287   Runtime1::StubID enter_id;
288   if (ce->compilation()->has_fpu_code()) {
289     enter_id = Runtime1::monitorenter_id;
290   } else {
291     enter_id = Runtime1::monitorenter_nofpu_id;
292   }
293   __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
294   ce->add_call_info_here(_info);
295   ce->verify_oop_map(_info);
296   __ b(_continuation);
297 }
298 
299 
300 void MonitorExitStub::emit_code(LIR_Assembler* ce) {
301   __ bind(_entry);
302   if (_compute_lock) {
303     // lock_reg was destroyed by fast unlocking attempt => recompute it
304     ce->monitor_address(_monitor_ix, _lock_reg);
< prev index next >