comparison src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @ 2029:6ce496c8fc07

Merge
author coleenp
date Thu, 16 Dec 2010 09:31:55 -0500
parents 0cb042fd2d4b
children 037c727f35fb
comparison
equal deleted inserted replaced
2028:450ece4d8a10 2029:6ce496c8fc07
872 } 872 }
873 873
874 874
875 void LIRGenerator::do_ArrayCopy(Intrinsic* x) { 875 void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
876 assert(x->number_of_arguments() == 5, "wrong type"); 876 assert(x->number_of_arguments() == 5, "wrong type");
877
878 // Make all state_for calls early since they can emit code
879 CodeEmitInfo* info = state_for(x, x->state());
880
877 LIRItem src(x->argument_at(0), this); 881 LIRItem src(x->argument_at(0), this);
878 LIRItem src_pos(x->argument_at(1), this); 882 LIRItem src_pos(x->argument_at(1), this);
879 LIRItem dst(x->argument_at(2), this); 883 LIRItem dst(x->argument_at(2), this);
880 LIRItem dst_pos(x->argument_at(3), this); 884 LIRItem dst_pos(x->argument_at(3), this);
881 LIRItem length(x->argument_at(4), this); 885 LIRItem length(x->argument_at(4), this);
914 918
915 int flags; 919 int flags;
916 ciArrayKlass* expected_type; 920 ciArrayKlass* expected_type;
917 arraycopy_helper(x, &flags, &expected_type); 921 arraycopy_helper(x, &flags, &expected_type);
918 922
919 CodeEmitInfo* info = state_for(x, x->state()); // we may want to have stack (deoptimization?)
920 __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint 923 __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint
921 } 924 }
922 925
923 926
924 // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f 927 // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
1149 stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); 1152 stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
1150 } else { 1153 } else {
1151 stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); 1154 stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
1152 } 1155 }
1153 LIR_Opr reg = rlock_result(x); 1156 LIR_Opr reg = rlock_result(x);
1157 LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1158 if (!x->klass()->is_loaded() || UseCompressedOops) {
1159 tmp3 = new_register(objectType);
1160 }
1154 __ checkcast(reg, obj.result(), x->klass(), 1161 __ checkcast(reg, obj.result(), x->klass(),
1155 new_register(objectType), new_register(objectType), 1162 new_register(objectType), new_register(objectType), tmp3,
1156 !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr,
1157 x->direct_compare(), info_for_exception, patching_info, stub, 1163 x->direct_compare(), info_for_exception, patching_info, stub,
1158 x->profiled_method(), x->profiled_bci()); 1164 x->profiled_method(), x->profiled_bci());
1159 } 1165 }
1160 1166
1161 1167
1168 if ((!x->klass()->is_loaded() || PatchALot)) { 1174 if ((!x->klass()->is_loaded() || PatchALot)) {
1169 // must do this before locking the destination register as an oop register 1175 // must do this before locking the destination register as an oop register
1170 patching_info = state_for(x, x->state_before()); 1176 patching_info = state_for(x, x->state_before());
1171 } 1177 }
1172 obj.load_item(); 1178 obj.load_item();
1179 LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
1180 if (!x->klass()->is_loaded() || UseCompressedOops) {
1181 tmp3 = new_register(objectType);
1182 }
1173 __ instanceof(reg, obj.result(), x->klass(), 1183 __ instanceof(reg, obj.result(), x->klass(),
1174 new_register(objectType), new_register(objectType), 1184 new_register(objectType), new_register(objectType), tmp3,
1175 !x->klass()->is_loaded() ? new_register(objectType) : LIR_OprFact::illegalOpr,
1176 x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci()); 1185 x->direct_compare(), patching_info, x->profiled_method(), x->profiled_bci());
1177 } 1186 }
1178 1187
1179 1188
1180 void LIRGenerator::do_If(If* x) { 1189 void LIRGenerator::do_If(If* x) {