< prev index next >

src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp

Print this page

178   _result = result;
179   _length = length;
180   _info = new CodeEmitInfo(info);
181 }
182 
183 
184 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
185   assert(_result->as_register() == R0, "runtime call setup");
186   assert(_klass_reg->as_register() == R1, "runtime call setup");
187   assert(_length->as_register() == R2, "runtime call setup");
188   __ bind(_entry);
189   __ call(Runtime1::entry_for(Runtime1::new_object_array_id), relocInfo::runtime_call_type);
190   ce->add_call_info_here(_info);
191   ce->verify_oop_map(_info);
192   __ b(_continuation);
193 }
194 
195 
196 // Implementation of MonitorAccessStubs
197 
198 MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
199 : MonitorAccessStub(obj_reg, lock_reg)
200 {
201   _info = new CodeEmitInfo(info);
202 }
203 
204 
205 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
206   __ bind(_entry);
207   const Register obj_reg = _obj_reg->as_pointer_register();
208   const Register lock_reg = _lock_reg->as_pointer_register();
209 
210   ce->verify_reserved_argument_area_size(2);
211   if (obj_reg < lock_reg) {
212     __ stmia(SP, RegisterSet(obj_reg) | RegisterSet(lock_reg));
213   } else {
214     __ str(obj_reg, Address(SP));
215     __ str(lock_reg, Address(SP, BytesPerWord));
216   }
217 
218   Runtime1::StubID enter_id = ce->compilation()->has_fpu_code() ?
219                               Runtime1::monitorenter_id :
220                               Runtime1::monitorenter_nofpu_id;
221   __ call(Runtime1::entry_for(enter_id), relocInfo::runtime_call_type);
222   ce->add_call_info_here(_info);
223   ce->verify_oop_map(_info);
224   __ b(_continuation);
225 }
226 
227 
228 void MonitorExitStub::emit_code(LIR_Assembler* ce) {
229   __ bind(_entry);
230   if (_compute_lock) {
231     ce->monitor_address(_monitor_ix, _lock_reg);
232   }
233   const Register lock_reg = _lock_reg->as_pointer_register();
234 
235   ce->verify_reserved_argument_area_size(1);
236   __ str(lock_reg, Address(SP));
237 
238   // Non-blocking leaf routine - no call info needed
239   Runtime1::StubID exit_id = ce->compilation()->has_fpu_code() ?
240                              Runtime1::monitorexit_id :
241                              Runtime1::monitorexit_nofpu_id;
242   __ call(Runtime1::entry_for(exit_id), relocInfo::runtime_call_type);
243   __ b(_continuation);
244 }
245 




246 
247 // Call return is directly after patch word
248 int PatchingStub::_patch_info_offset = 0;
249 
250 void PatchingStub::align_patch_site(MacroAssembler* masm) {
251 #if 0
252   // TODO: investigate if we required to implement this
253     ShouldNotReachHere();
254 #endif
255 }
256 
257 void PatchingStub::emit_code(LIR_Assembler* ce) {
258   const int patchable_instruction_offset = 0;
259 
260   assert(NativeCall::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF,
261          "not enough room for call");
262   assert((_bytes_to_copy & 3) == 0, "must copy a multiple of four bytes");
263   Label call_patch;
264   bool is_load = (_id == load_klass_id) || (_id == load_mirror_id) || (_id == load_appendix_id);
265 

178   _result = result;
179   _length = length;
180   _info = new CodeEmitInfo(info);
181 }
182 
183 
184 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
185   assert(_result->as_register() == R0, "runtime call setup");
186   assert(_klass_reg->as_register() == R1, "runtime call setup");
187   assert(_length->as_register() == R2, "runtime call setup");
188   __ bind(_entry);
189   __ call(Runtime1::entry_for(Runtime1::new_object_array_id), relocInfo::runtime_call_type);
190   ce->add_call_info_here(_info);
191   ce->verify_oop_map(_info);
192   __ b(_continuation);
193 }
194 
195 
196 // Implementation of MonitorAccessStubs
197 
198 MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, CodeEmitInfo* info)
199 : MonitorAccessStub(obj_reg)
200 {
201   _info = new CodeEmitInfo(info);
202 }
203 
204 
205 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
206   __ bind(_entry);
207   const Register obj_reg = _obj_reg->as_pointer_register();

208 
209   ce->verify_reserved_argument_area_size(2);
210   __ str(obj_reg, Address(SP));





211 
212   Runtime1::StubID enter_id = ce->compilation()->has_fpu_code() ?
213                               Runtime1::monitorenter_id :
214                               Runtime1::monitorenter_nofpu_id;
215   __ call(Runtime1::entry_for(enter_id), relocInfo::runtime_call_type);
216   ce->add_call_info_here(_info);
217   ce->verify_oop_map(_info);
218   __ b(_continuation);
219 }
220 
221 
222 void MonitorExitStub::emit_code(LIR_Assembler* ce) {
223   __ bind(_entry);
224   const Register obj_reg = _obj_reg->as_pointer_register();



225 
226   ce->verify_reserved_argument_area_size(1);
227   __ str(obj_reg, Address(SP));
228 
229   // Non-blocking leaf routine - no call info needed
230   Runtime1::StubID exit_id = ce->compilation()->has_fpu_code() ?
231                              Runtime1::monitorexit_id :
232                              Runtime1::monitorexit_nofpu_id;
233   __ call(Runtime1::entry_for(exit_id), relocInfo::runtime_call_type);
234   __ b(_continuation);
235 }
236 
237 void LoadKlassStub::emit_code(LIR_Assembler* ce) {
238   // Currently not needed.
239   Unimplemented();
240 }
241 
242 // Call return is directly after patch word
243 int PatchingStub::_patch_info_offset = 0;
244 
245 void PatchingStub::align_patch_site(MacroAssembler* masm) {
246 #if 0
247   // TODO: investigate if we required to implement this
248     ShouldNotReachHere();
249 #endif
250 }
251 
252 void PatchingStub::emit_code(LIR_Assembler* ce) {
253   const int patchable_instruction_offset = 0;
254 
255   assert(NativeCall::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF,
256          "not enough room for call");
257   assert((_bytes_to_copy & 3) == 0, "must copy a multiple of four bytes");
258   Label call_patch;
259   bool is_load = (_id == load_klass_id) || (_id == load_mirror_id) || (_id == load_appendix_id);
260 
< prev index next >