1030 if (obj == ciEnv::unloaded_ciobjarrayklass()) { 1031 BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error"); 1032 } 1033 jobject2reg_with_patching(klass_reg, obj, patching_info); 1034 __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path); 1035 1036 LIR_Opr result = rlock_result(x); 1037 __ move(reg, result); 1038 } 1039 1040 1041 void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { 1042 Values* dims = x->dims(); 1043 int i = dims->length(); 1044 LIRItemList* items = new LIRItemList(dims->length(), NULL); 1045 while (i-- > 0) { 1046 LIRItem* size = new LIRItem(dims->at(i), this); 1047 items->at_put(i, size); 1048 } 1049 1050 // need to get the info before, as the items may become invalid through item_free 1051 CodeEmitInfo* patching_info = NULL; 1052 if (!x->klass()->is_loaded() || PatchALot) { 1053 patching_info = state_for(x, x->state_before()); 1054 1055 // cannot re-use same xhandlers for multiple CodeEmitInfos, so 1056 // clone all handlers. 1057 x->set_exception_handlers(new XHandlers(x->exception_handlers())); 1058 } 1059 1060 CodeEmitInfo* info = state_for(x, x->state()); 1061 1062 i = dims->length(); 1063 while (i-- > 0) { 1064 LIRItem* size = items->at(i); 1065 size->load_nonconstant(); 1066 1067 store_stack_parameter(size->result(), in_ByteSize(i*4)); 1068 } 1069 1070 LIR_Opr reg = result_register_for(x->type()); 1071 jobject2reg_with_patching(reg, x->klass(), patching_info); 1072 1073 LIR_Opr rank = FrameMap::rbx_opr; 1074 __ move(LIR_OprFact::intConst(x->rank()), rank); 1075 LIR_Opr varargs = FrameMap::rcx_opr; 1076 __ move(FrameMap::rsp_opr, varargs); 1077 LIR_OprList* args = new LIR_OprList(3); 1078 args->append(reg); 1079 args->append(rank); | 1030 if (obj == ciEnv::unloaded_ciobjarrayklass()) { 1031 BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error"); 1032 } 1033 jobject2reg_with_patching(klass_reg, obj, patching_info); 1034 __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path); 1035 1036 LIR_Opr result = rlock_result(x); 1037 __ move(reg, result); 1038 } 1039 1040 1041 void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { 1042 Values* dims = x->dims(); 1043 int i = dims->length(); 1044 LIRItemList* items = new LIRItemList(dims->length(), NULL); 1045 while (i-- > 0) { 1046 LIRItem* size = new LIRItem(dims->at(i), this); 1047 items->at_put(i, size); 1048 } 1049 1050 // Evaluate state_for early since it may emit code. 1051 CodeEmitInfo* patching_info = NULL; 1052 if (!x->klass()->is_loaded() || PatchALot) { 1053 patching_info = state_for(x, x->state_before()); 1054 1055 // cannot re-use same xhandlers for multiple CodeEmitInfos, so 1056 // clone all handlers. This is handled transparently in other 1057 // places by the CodeEmitInfo cloning logic but is handled 1058 // specially here because a stub isn't being used. 1059 x->set_exception_handlers(new XHandlers(x->exception_handlers())); 1060 } 1061 CodeEmitInfo* info = state_for(x, x->state()); 1062 1063 i = dims->length(); 1064 while (i-- > 0) { 1065 LIRItem* size = items->at(i); 1066 size->load_nonconstant(); 1067 1068 store_stack_parameter(size->result(), in_ByteSize(i*4)); 1069 } 1070 1071 LIR_Opr reg = result_register_for(x->type()); 1072 jobject2reg_with_patching(reg, x->klass(), patching_info); 1073 1074 LIR_Opr rank = FrameMap::rbx_opr; 1075 __ move(LIR_OprFact::intConst(x->rank()), rank); 1076 LIR_Opr varargs = FrameMap::rcx_opr; 1077 __ move(FrameMap::rsp_opr, varargs); 1078 LIR_OprList* args = new LIR_OprList(3); 1079 args->append(reg); 1080 args->append(rank); |