1244 LIRItem length(x->length(), this); 1245 // in case of patching (i.e., object class is not yet loaded), we need to reexecute the instruction 1246 // and therefore provide the state before the parameters have been consumed 1247 CodeEmitInfo* patching_info = NULL; 1248 if (!x->klass()->is_loaded() || PatchALot) { 1249 patching_info = state_for(x, x->state_before()); 1250 } 1251 1252 CodeEmitInfo* info = state_for(x, x->state()); 1253 1254 const LIR_Opr reg = result_register_for(x->type()); 1255 LIR_Opr tmp1 = FrameMap::rcx_oop_opr; 1256 LIR_Opr tmp2 = FrameMap::rsi_oop_opr; 1257 LIR_Opr tmp3 = FrameMap::rdi_oop_opr; 1258 LIR_Opr tmp4 = reg; 1259 LIR_Opr klass_reg = FrameMap::rdx_metadata_opr; 1260 1261 length.load_item_force(FrameMap::rbx_opr); 1262 LIR_Opr len = length.result(); 1263 1264 CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info); 1265 ciKlass* obj = (ciKlass*) ciObjArrayKlass::make(x->klass()); 1266 if (obj == ciEnv::unloaded_ciobjarrayklass()) { 1267 BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error"); 1268 } 1269 klass2reg_with_patching(klass_reg, obj, patching_info); 1270 __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path); 1271 1272 LIR_Opr result = rlock_result(x); 1273 __ move(reg, result); 1274 } 1275 1276 1277 void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { 1278 Values* dims = x->dims(); 1279 int i = dims->length(); 1280 LIRItemList* items = new LIRItemList(i, i, NULL); 1281 while (i-- > 0) { 1282 LIRItem* size = new LIRItem(dims->at(i), this); 1283 items->at_put(i, size); 1284 } 1285 1286 // Evaluate state_for early since it may emit code. 1287 CodeEmitInfo* patching_info = NULL; 1288 if (!x->klass()->is_loaded() || PatchALot) { 1289 patching_info = state_for(x, x->state_before()); 1290 | 1244 LIRItem length(x->length(), this); 1245 // in case of patching (i.e., object class is not yet loaded), we need to reexecute the instruction 1246 // and therefore provide the state before the parameters have been consumed 1247 CodeEmitInfo* patching_info = NULL; 1248 if (!x->klass()->is_loaded() || PatchALot) { 1249 patching_info = state_for(x, x->state_before()); 1250 } 1251 1252 CodeEmitInfo* info = state_for(x, x->state()); 1253 1254 const LIR_Opr reg = result_register_for(x->type()); 1255 LIR_Opr tmp1 = FrameMap::rcx_oop_opr; 1256 LIR_Opr tmp2 = FrameMap::rsi_oop_opr; 1257 LIR_Opr tmp3 = FrameMap::rdi_oop_opr; 1258 LIR_Opr tmp4 = reg; 1259 LIR_Opr klass_reg = FrameMap::rdx_metadata_opr; 1260 1261 length.load_item_force(FrameMap::rbx_opr); 1262 LIR_Opr len = length.result(); 1263 1264 ciKlass* obj = (ciKlass*) x->exact_type(); 1265 CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info, obj->is_value_array_klass()); 1266 if (obj == ciEnv::unloaded_ciobjarrayklass()) { 1267 BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error"); 1268 } 1269 klass2reg_with_patching(klass_reg, obj, patching_info); 1270 if (obj->is_value_array_klass()) { 1271 // This check is valid even if the class is not yet loaded, because the class has a "Q" signature. 1272 __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_VALUETYPE, klass_reg, slow_path); 1273 } else { 1274 __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path); 1275 } 1276 1277 LIR_Opr result = rlock_result(x); 1278 __ move(reg, result); 1279 } 1280 1281 1282 void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { 1283 Values* dims = x->dims(); 1284 int i = dims->length(); 1285 LIRItemList* items = new LIRItemList(i, i, NULL); 1286 while (i-- > 0) { 1287 LIRItem* size = new LIRItem(dims->at(i), this); 1288 items->at_put(i, size); 1289 } 1290 1291 // Evaluate state_for early since it may emit code. 1292 CodeEmitInfo* patching_info = NULL; 1293 if (!x->klass()->is_loaded() || PatchALot) { 1294 patching_info = state_for(x, x->state_before()); 1295 |