< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

Print this page

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


































































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

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

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






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










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

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


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