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, LIR_Opr result, CodeEmitInfo* info) { 171 _left = left; 172 _right = right; 173 _result = result; 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(Runtime1::substitutability_check_id))); 184 ce->add_call_info_here(_info); 185 ce->verify_oop_map(_info); 186 if (_result->as_register() != r0) { 187 __ mov(_result->as_register(), r0); 188 } 189 __ b(_continuation); 190 } 191 192 193 // Implementation of NewInstanceStub 194 195 NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { 196 _result = result; 197 _klass = klass; 198 _klass_reg = klass_reg; 199 _info = new CodeEmitInfo(info); 200 assert(stub_id == Runtime1::new_instance_id || 201 stub_id == Runtime1::fast_new_instance_id || 202 stub_id == Runtime1::fast_new_instance_init_check_id, 203 "need new_instance id"); 204 _stub_id = stub_id; 205 } 206 207 void NewInstanceStub::emit_code(LIR_Assembler* ce) { 208 assert(__ rsp_offset() == 0, "frame size should be fixed"); 209 __ bind(_entry); 210 __ mov(r3, _klass_reg->as_register()); 211 __ far_call(RuntimeAddress(Runtime1::entry_for(_stub_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 NewTypeArrayStub 220 221 // Implementation of NewTypeArrayStub 222 223 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) { 224 _klass_reg = klass_reg; 225 _length = length; 226 _result = result; 227 _info = new CodeEmitInfo(info); 228 } 229 230 231 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { 232 assert(__ rsp_offset() == 0, "frame size should be fixed"); 233 __ bind(_entry); 234 assert(_length->as_register() == r19, "length must in r19,"); 235 assert(_klass_reg->as_register() == r3, "klass_reg must in r3"); 236 __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_type_array_id))); 237 ce->add_call_info_here(_info); 238 ce->verify_oop_map(_info); 239 assert(_result->as_register() == r0, "result must in r0"); 240 __ b(_continuation); 241 } 242 243 244 // Implementation of NewObjectArrayStub 245 246 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info, bool is_value_type) { 247 _klass_reg = klass_reg; 248 _result = result; 249 _length = length; 250 _info = new CodeEmitInfo(info); 251 _is_value_type = is_value_type; 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_value_type) { 262 __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_value_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 // Implementation of MonitorAccessStubs 273 274 MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info, CodeStub* throw_imse_stub, LIR_Opr scratch_reg) 275 : MonitorAccessStub(obj_reg, lock_reg) 276 { 277 _info = new CodeEmitInfo(info); 278 _scratch_reg = scratch_reg; 279 _throw_imse_stub = throw_imse_stub; 280 if (_throw_imse_stub != NULL) { 281 assert(_scratch_reg != LIR_OprFact::illegalOpr, "must be"); 282 } 283 } 284 285 286 void MonitorEnterStub::emit_code(LIR_Assembler* ce) { 287 assert(__ rsp_offset() == 0, "frame size should be fixed"); 288 __ bind(_entry); 289 if (_throw_imse_stub != NULL) { 290 // When we come here, _obj_reg has already been checked to be non-null. 291 __ ldr(rscratch1, Address(_obj_reg->as_register(), oopDesc::mark_offset_in_bytes())); 292 __ mov(rscratch2, markOopDesc::always_locked_pattern); 293 __ andr(rscratch1, rscratch1, rscratch2); 294 295 __ cmp(rscratch1, rscratch2); 296 __ br(Assembler::NE, *_throw_imse_stub->entry()); 297 } 298 299 ce->store_parameter(_obj_reg->as_register(), 1); 300 ce->store_parameter(_lock_reg->as_register(), 0); 301 Runtime1::StubID enter_id; 302 if (ce->compilation()->has_fpu_code()) { 303 enter_id = Runtime1::monitorenter_id; 304 } else { 305 enter_id = Runtime1::monitorenter_nofpu_id; 306 } 307 __ far_call(RuntimeAddress(Runtime1::entry_for(enter_id))); 308 ce->add_call_info_here(_info); 309 ce->verify_oop_map(_info); 310 __ b(_continuation); 311 } 312 313 314 void MonitorExitStub::emit_code(LIR_Assembler* ce) { 315 __ bind(_entry); 316 if (_compute_lock) { 317 // lock_reg was destroyed by fast unlocking attempt => recompute it 318 ce->monitor_address(_monitor_ix, _lock_reg); |