< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

Print this page
rev 54670 : Port of valuetypes to aarch64


 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   _info = new CodeEmitInfo(info);
 128 }
 129 
 130 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
 131   assert(__ rsp_offset() == 0, "frame size should be fixed");
 132   __ bind(_entry);
 133   ce->store_parameter(_array->as_register(), 1);
 134   ce->store_parameter(_index->as_register(), 0);
 135   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::load_flattened_array_id)));
 136   ce->add_call_info_here(_info);
 137   ce->verify_oop_map(_info);
 138   if (_result->as_register() != r0) { // DMS CHECK
 139     __ mov(_result->as_register(), r0);
 140   }
 141   __ b(_continuation);
 142 }
 143 
 144 
 145 // Implementation of StoreFlattenedArrayStub
 146 
 147 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {
 148   _array = array;
 149   _index = index;
 150   _value = value;
 151   _info = new CodeEmitInfo(info);
 152 }
 153 
 154 
 155 void StoreFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
 156   assert(__ rsp_offset() == 0, "frame size should be fixed");
 157   __ bind(_entry);
 158   ce->store_parameter(_array->as_register(), 2);
 159   ce->store_parameter(_index->as_register(), 1);
 160   ce->store_parameter(_value->as_register(), 0);
 161   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::store_flattened_array_id)));
 162   ce->add_call_info_here(_info);
 163   ce->verify_oop_map(_info);
 164   __ b(_continuation);
 165 }
 166 
 167 
 168 // Implementation of NewInstanceStub
 169 
 170 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {
 171   _result = result;
 172   _klass = klass;
 173   _klass_reg = klass_reg;
 174   _info = new CodeEmitInfo(info);
 175   assert(stub_id == Runtime1::new_instance_id                 ||
 176          stub_id == Runtime1::fast_new_instance_id            ||
 177          stub_id == Runtime1::fast_new_instance_init_check_id,
 178          "need new_instance id");
 179   _stub_id   = stub_id;
 180 }
 181 


 182 void NewInstanceStub::emit_code(LIR_Assembler* ce) {
 183   assert(__ rsp_offset() == 0, "frame size should be fixed");
 184   __ bind(_entry);
 185   __ mov(r3, _klass_reg->as_register());
 186   __ far_call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
 187   ce->add_call_info_here(_info);
 188   ce->verify_oop_map(_info);
 189   assert(_result->as_register() == r0, "result must in r0,");
 190   __ b(_continuation);
 191 }
 192 
 193 
 194 // Implementation of NewTypeArrayStub
 195 
 196 // Implementation of NewTypeArrayStub
 197 
 198 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
 199   _klass_reg = klass_reg;
 200   _length = length;
 201   _result = result;
 202   _info = new CodeEmitInfo(info);
 203 }
 204 
 205 
 206 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
 207   assert(__ rsp_offset() == 0, "frame size should be fixed");
 208   __ bind(_entry);
 209   assert(_length->as_register() == r19, "length must in r19,");
 210   assert(_klass_reg->as_register() == r3, "klass_reg must in r3");
 211   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id)));
 212   ce->add_call_info_here(_info);
 213   ce->verify_oop_map(_info);
 214   assert(_result->as_register() == r0, "result must in r0");
 215   __ b(_continuation);
 216 }
 217 
 218 
 219 // Implementation of NewObjectArrayStub
 220 
 221 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info, bool is_value_type) {
 222   _klass_reg = klass_reg;
 223   _result = result;
 224   _length = length;
 225   _info = new CodeEmitInfo(info);
 226   _is_value_type = is_value_type; 
 227 }
 228 
 229 
 230 void NewObjectArrayStub::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 
 236   if (_is_value_type) {
 237     __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_value_array_id)));
 238   } else {
 239     __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id)));
 240   }
 241 
 242   ce->add_call_info_here(_info);
 243   ce->verify_oop_map(_info);
 244   assert(_result->as_register() == r0, "result must in r0");
 245   __ b(_continuation);
 246 }
 247 // Implementation of MonitorAccessStubs
 248 
 249 MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info,  CodeStub* throw_imse_stub, LIR_Opr scratch_reg)
 250 : MonitorAccessStub(obj_reg, lock_reg)
 251 {
 252   _info = new CodeEmitInfo(info);
 253   _scratch_reg = scratch_reg;
 254   _throw_imse_stub = throw_imse_stub;
 255   if (_throw_imse_stub != NULL) {
 256     assert(_scratch_reg != LIR_OprFact::illegalOpr, "must be");
 257   }
 258 }
 259 
 260 
 261 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
 262   assert(__ rsp_offset() == 0, "frame size should be fixed");
 263   __ bind(_entry);
 264   if (_throw_imse_stub != NULL) {
 265     // When we come here, _obj_reg has already been checked to be non-null.
 266     Register mark = _scratch_reg->as_register();
 267     __ ldr(mark, Address(_obj_reg->as_register(), oopDesc::mark_offset_in_bytes()));
 268     __ andr(mark, mark, (u1) markOopDesc::always_locked_pattern && 0xF);
 269     __ cmp(r2, (u1) markOopDesc::always_locked_pattern); 
 270     __ br(Assembler::NE, *_throw_imse_stub->entry());
 271   }
 272 
 273   ce->store_parameter(_obj_reg->as_register(),  1);
 274   ce->store_parameter(_lock_reg->as_register(), 0);
 275   Runtime1::StubID enter_id;
 276   if (ce->compilation()->has_fpu_code()) {
 277     enter_id = Runtime1::monitorenter_id;
 278   } else {
 279     enter_id = Runtime1::monitorenter_nofpu_id;
 280   }
 281   __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id)));
 282   ce->add_call_info_here(_info);
 283   ce->verify_oop_map(_info);
 284   __ b(_continuation);
 285 }
 286 
 287 
 288 void MonitorExitStub::emit_code(LIR_Assembler* ce) {
 289   __ bind(_entry);
 290   if (_compute_lock) {
 291     // lock_reg was destroyed by fast unlocking attempt => recompute it
 292     ce->monitor_address(_monitor_ix, _lock_reg);


< prev index next >