< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

Print this page




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


































































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

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






 192   ce->add_call_info_here(_info);
 193   ce->verify_oop_map(_info);
 194   assert(_result->as_register() == r0, "result must in r0");
 195   __ b(_continuation);
 196 }
 197 // Implementation of MonitorAccessStubs
 198 
 199 MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
 200 : MonitorAccessStub(obj_reg, lock_reg)
 201 {
 202   _info = new CodeEmitInfo(info);





 203 }
 204 
 205 
 206 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
 207   assert(__ rsp_offset() == 0, "frame size should be fixed");
 208   __ bind(_entry);










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




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


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


< prev index next >