< 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::new_instance_no_inline_id       ||
200          stub_id == Runtime1::fast_new_instance_id            ||
201          stub_id == Runtime1::fast_new_instance_init_check_id,
202          "need new_instance id");
203   _stub_id   = stub_id;
204 }
205 


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