OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // |
| 3 // Copyright IBM Corp. 2012, 2013. All rights reserved. |
| 4 // |
2 // Use of this source code is governed by a BSD-style license that can be | 5 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 6 // found in the LICENSE file. |
4 | 7 |
5 #include "src/v8.h" | 8 #include "src/v8.h" |
6 | 9 |
7 #include "src/arm/lithium-arm.h" | |
8 #include "src/arm/lithium-codegen-arm.h" | |
9 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
10 #include "src/lithium-allocator-inl.h" | 11 #include "src/lithium-allocator-inl.h" |
| 12 #include "src/ppc/lithium-codegen-ppc.h" |
| 13 #include "src/ppc/lithium-ppc.h" |
11 | 14 |
12 namespace v8 { | 15 namespace v8 { |
13 namespace internal { | 16 namespace internal { |
14 | 17 |
15 #define DEFINE_COMPILE(type) \ | 18 #define DEFINE_COMPILE(type) \ |
16 void L##type::CompileToNative(LCodeGen* generator) { \ | 19 void L##type::CompileToNative(LCodeGen* generator) { \ |
17 generator->Do##type(this); \ | 20 generator->Do##type(this); \ |
18 } | 21 } |
19 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) | 22 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) |
20 #undef DEFINE_COMPILE | 23 #undef DEFINE_COMPILE |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 722 } |
720 } | 723 } |
721 | 724 |
722 | 725 |
723 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, | 726 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, |
724 HArithmeticBinaryOperation* instr) { | 727 HArithmeticBinaryOperation* instr) { |
725 ASSERT(instr->representation().IsDouble()); | 728 ASSERT(instr->representation().IsDouble()); |
726 ASSERT(instr->left()->representation().IsDouble()); | 729 ASSERT(instr->left()->representation().IsDouble()); |
727 ASSERT(instr->right()->representation().IsDouble()); | 730 ASSERT(instr->right()->representation().IsDouble()); |
728 if (op == Token::MOD) { | 731 if (op == Token::MOD) { |
729 LOperand* left = UseFixedDouble(instr->left(), d0); | 732 LOperand* left = UseFixedDouble(instr->left(), d1); |
730 LOperand* right = UseFixedDouble(instr->right(), d1); | 733 LOperand* right = UseFixedDouble(instr->right(), d2); |
731 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | 734 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |
732 return MarkAsCall(DefineFixedDouble(result, d0), instr); | 735 // We call a C function for double modulo. It can't trigger a GC. We need |
| 736 // to use fixed result register for the call. |
| 737 // TODO(fschneider): Allow any register as input registers. |
| 738 return MarkAsCall(DefineFixedDouble(result, d1), instr); |
733 } else { | 739 } else { |
734 LOperand* left = UseRegisterAtStart(instr->left()); | 740 LOperand* left = UseRegisterAtStart(instr->left()); |
735 LOperand* right = UseRegisterAtStart(instr->right()); | 741 LOperand* right = UseRegisterAtStart(instr->right()); |
736 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | 742 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |
737 return DefineAsRegister(result); | 743 return DefineAsRegister(result); |
738 } | 744 } |
739 } | 745 } |
740 | 746 |
741 | 747 |
742 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 748 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
743 HBinaryOperation* instr) { | 749 HBinaryOperation* instr) { |
744 HValue* left = instr->left(); | 750 HValue* left = instr->left(); |
745 HValue* right = instr->right(); | 751 HValue* right = instr->right(); |
746 ASSERT(left->representation().IsTagged()); | 752 ASSERT(left->representation().IsTagged()); |
747 ASSERT(right->representation().IsTagged()); | 753 ASSERT(right->representation().IsTagged()); |
748 LOperand* context = UseFixed(instr->context(), cp); | 754 LOperand* context = UseFixed(instr->context(), cp); |
749 LOperand* left_operand = UseFixed(left, r1); | 755 LOperand* left_operand = UseFixed(left, r4); |
750 LOperand* right_operand = UseFixed(right, r0); | 756 LOperand* right_operand = UseFixed(right, r3); |
751 LArithmeticT* result = | 757 LArithmeticT* result = |
752 new(zone()) LArithmeticT(op, context, left_operand, right_operand); | 758 new(zone()) LArithmeticT(op, context, left_operand, right_operand); |
753 return MarkAsCall(DefineFixed(result, r0), instr); | 759 return MarkAsCall(DefineFixed(result, r3), instr); |
754 } | 760 } |
755 | 761 |
756 | 762 |
757 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { | 763 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { |
758 ASSERT(is_building()); | 764 ASSERT(is_building()); |
759 current_block_ = block; | 765 current_block_ = block; |
760 next_block_ = next_block; | 766 next_block_ = next_block; |
761 if (block->IsStartBlock()) { | 767 if (block->IsStartBlock()) { |
762 block->UpdateEnvironment(graph_->start_environment()); | 768 block->UpdateEnvironment(graph_->start_environment()); |
763 argument_count_ = 0; | 769 argument_count_ = 0; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 | 981 |
976 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 982 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |
977 info()->MarkAsRequiresFrame(); | 983 info()->MarkAsRequiresFrame(); |
978 return DefineAsRegister(new(zone()) LArgumentsElements); | 984 return DefineAsRegister(new(zone()) LArgumentsElements); |
979 } | 985 } |
980 | 986 |
981 | 987 |
982 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 988 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
983 LOperand* context = UseFixed(instr->context(), cp); | 989 LOperand* context = UseFixed(instr->context(), cp); |
984 LInstanceOf* result = | 990 LInstanceOf* result = |
985 new(zone()) LInstanceOf(context, UseFixed(instr->left(), r0), | 991 new(zone()) LInstanceOf(context, UseFixed(instr->left(), r3), |
986 UseFixed(instr->right(), r1)); | 992 UseFixed(instr->right(), r4)); |
987 return MarkAsCall(DefineFixed(result, r0), instr); | 993 return MarkAsCall(DefineFixed(result, r3), instr); |
988 } | 994 } |
989 | 995 |
990 | 996 |
991 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( | 997 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( |
992 HInstanceOfKnownGlobal* instr) { | 998 HInstanceOfKnownGlobal* instr) { |
993 LInstanceOfKnownGlobal* result = | 999 LInstanceOfKnownGlobal* result = |
994 new(zone()) LInstanceOfKnownGlobal( | 1000 new(zone()) LInstanceOfKnownGlobal( |
995 UseFixed(instr->context(), cp), | 1001 UseFixed(instr->context(), cp), |
996 UseFixed(instr->left(), r0), | 1002 UseFixed(instr->left(), r3), |
997 FixedTemp(r4)); | 1003 FixedTemp(r7)); |
998 return MarkAsCall(DefineFixed(result, r0), instr); | 1004 return MarkAsCall(DefineFixed(result, r3), instr); |
999 } | 1005 } |
1000 | 1006 |
1001 | 1007 |
1002 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 1008 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
1003 LOperand* receiver = UseRegisterAtStart(instr->receiver()); | 1009 LOperand* receiver = UseRegisterAtStart(instr->receiver()); |
1004 LOperand* function = UseRegisterAtStart(instr->function()); | 1010 LOperand* function = UseRegisterAtStart(instr->function()); |
1005 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 1011 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |
1006 return AssignEnvironment(DefineAsRegister(result)); | 1012 return AssignEnvironment(DefineAsRegister(result)); |
1007 } | 1013 } |
1008 | 1014 |
1009 | 1015 |
1010 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { | 1016 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { |
1011 LOperand* function = UseFixed(instr->function(), r1); | 1017 LOperand* function = UseFixed(instr->function(), r4); |
1012 LOperand* receiver = UseFixed(instr->receiver(), r0); | 1018 LOperand* receiver = UseFixed(instr->receiver(), r3); |
1013 LOperand* length = UseFixed(instr->length(), r2); | 1019 LOperand* length = UseFixed(instr->length(), r5); |
1014 LOperand* elements = UseFixed(instr->elements(), r3); | 1020 LOperand* elements = UseFixed(instr->elements(), r6); |
1015 LApplyArguments* result = new(zone()) LApplyArguments(function, | 1021 LApplyArguments* result = new(zone()) LApplyArguments(function, |
1016 receiver, | 1022 receiver, |
1017 length, | 1023 length, |
1018 elements); | 1024 elements); |
1019 return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); | 1025 return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY); |
1020 } | 1026 } |
1021 | 1027 |
1022 | 1028 |
1023 LInstruction* LChunkBuilder::DoPushArguments(HPushArguments* instr) { | 1029 LInstruction* LChunkBuilder::DoPushArguments(HPushArguments* instr) { |
1024 int argc = instr->OperandCount(); | 1030 int argc = instr->OperandCount(); |
1025 for (int i = 0; i < argc; ++i) { | 1031 for (int i = 0; i < argc; ++i) { |
1026 LOperand* argument = Use(instr->argument(i)); | 1032 LOperand* argument = Use(instr->argument(i)); |
1027 AddInstruction(new(zone()) LPushArgument(argument), instr); | 1033 AddInstruction(new(zone()) LPushArgument(argument), instr); |
1028 } | 1034 } |
1029 return NULL; | 1035 return NULL; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1072 |
1067 | 1073 |
1068 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1074 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
1069 LOperand* context = UseFixed(instr->context(), cp); | 1075 LOperand* context = UseFixed(instr->context(), cp); |
1070 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); | 1076 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); |
1071 } | 1077 } |
1072 | 1078 |
1073 | 1079 |
1074 LInstruction* LChunkBuilder::DoCallJSFunction( | 1080 LInstruction* LChunkBuilder::DoCallJSFunction( |
1075 HCallJSFunction* instr) { | 1081 HCallJSFunction* instr) { |
1076 LOperand* function = UseFixed(instr->function(), r1); | 1082 LOperand* function = UseFixed(instr->function(), r4); |
1077 | 1083 |
1078 LCallJSFunction* result = new(zone()) LCallJSFunction(function); | 1084 LCallJSFunction* result = new(zone()) LCallJSFunction(function); |
1079 | 1085 |
1080 return MarkAsCall(DefineFixed(result, r0), instr); | 1086 return MarkAsCall(DefineFixed(result, r3), instr); |
1081 } | 1087 } |
1082 | 1088 |
1083 | 1089 |
1084 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1090 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1085 HCallWithDescriptor* instr) { | 1091 HCallWithDescriptor* instr) { |
1086 const InterfaceDescriptor* descriptor = instr->descriptor(); | 1092 const InterfaceDescriptor* descriptor = instr->descriptor(); |
1087 | 1093 |
1088 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1094 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1089 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1095 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
1090 ops.Add(target, zone()); | 1096 ops.Add(target, zone()); |
1091 for (int i = 1; i < instr->OperandCount(); i++) { | 1097 for (int i = 1; i < instr->OperandCount(); i++) { |
1092 LOperand* op = UseFixed(instr->OperandAt(i), | 1098 LOperand* op = UseFixed(instr->OperandAt(i), |
1093 descriptor->GetParameterRegister(i - 1)); | 1099 descriptor->GetParameterRegister(i - 1)); |
1094 ops.Add(op, zone()); | 1100 ops.Add(op, zone()); |
1095 } | 1101 } |
1096 | 1102 |
1097 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1103 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1098 descriptor, ops, zone()); | 1104 descriptor, ops, zone()); |
1099 return MarkAsCall(DefineFixed(result, r0), instr); | 1105 return MarkAsCall(DefineFixed(result, r3), instr); |
1100 } | 1106 } |
1101 | 1107 |
1102 | 1108 |
1103 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1109 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
1104 LOperand* context = UseFixed(instr->context(), cp); | 1110 LOperand* context = UseFixed(instr->context(), cp); |
1105 LOperand* function = UseFixed(instr->function(), r1); | 1111 LOperand* function = UseFixed(instr->function(), r4); |
1106 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); | 1112 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
1107 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1113 return MarkAsCall(DefineFixed(result, r3), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
1108 } | 1114 } |
1109 | 1115 |
1110 | 1116 |
1111 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1117 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1112 switch (instr->op()) { | 1118 switch (instr->op()) { |
1113 case kMathFloor: return DoMathFloor(instr); | 1119 case kMathFloor: return DoMathFloor(instr); |
1114 case kMathRound: return DoMathRound(instr); | 1120 case kMathRound: return DoMathRound(instr); |
1115 case kMathAbs: return DoMathAbs(instr); | 1121 case kMathAbs: return DoMathAbs(instr); |
1116 case kMathLog: return DoMathLog(instr); | 1122 case kMathLog: return DoMathLog(instr); |
1117 case kMathExp: return DoMathExp(instr); | 1123 case kMathExp: return DoMathExp(instr); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 DefineAsRegister(new(zone()) LMathAbs(context, input)); | 1156 DefineAsRegister(new(zone()) LMathAbs(context, input)); |
1151 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); | 1157 if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result); |
1152 if (!r.IsDouble()) result = AssignEnvironment(result); | 1158 if (!r.IsDouble()) result = AssignEnvironment(result); |
1153 return result; | 1159 return result; |
1154 } | 1160 } |
1155 | 1161 |
1156 | 1162 |
1157 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 1163 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |
1158 ASSERT(instr->representation().IsDouble()); | 1164 ASSERT(instr->representation().IsDouble()); |
1159 ASSERT(instr->value()->representation().IsDouble()); | 1165 ASSERT(instr->value()->representation().IsDouble()); |
1160 LOperand* input = UseFixedDouble(instr->value(), d0); | 1166 LOperand* input = UseFixedDouble(instr->value(), d1); |
1161 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d0), instr); | 1167 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d1), instr); |
1162 } | 1168 } |
1163 | 1169 |
1164 | 1170 |
1165 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { | 1171 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { |
1166 LOperand* input = UseRegisterAtStart(instr->value()); | 1172 LOperand* input = UseRegisterAtStart(instr->value()); |
1167 LMathClz32* result = new(zone()) LMathClz32(input); | 1173 LMathClz32* result = new(zone()) LMathClz32(input); |
1168 return DefineAsRegister(result); | 1174 return DefineAsRegister(result); |
1169 } | 1175 } |
1170 | 1176 |
1171 | 1177 |
(...skipping 18 matching lines...) Expand all Loading... |
1190 | 1196 |
1191 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { | 1197 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { |
1192 LOperand* input = UseRegisterAtStart(instr->value()); | 1198 LOperand* input = UseRegisterAtStart(instr->value()); |
1193 LMathPowHalf* result = new(zone()) LMathPowHalf(input); | 1199 LMathPowHalf* result = new(zone()) LMathPowHalf(input); |
1194 return DefineAsRegister(result); | 1200 return DefineAsRegister(result); |
1195 } | 1201 } |
1196 | 1202 |
1197 | 1203 |
1198 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { | 1204 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { |
1199 LOperand* context = UseFixed(instr->context(), cp); | 1205 LOperand* context = UseFixed(instr->context(), cp); |
1200 LOperand* constructor = UseFixed(instr->constructor(), r1); | 1206 LOperand* constructor = UseFixed(instr->constructor(), r4); |
1201 LCallNew* result = new(zone()) LCallNew(context, constructor); | 1207 LCallNew* result = new(zone()) LCallNew(context, constructor); |
1202 return MarkAsCall(DefineFixed(result, r0), instr); | 1208 return MarkAsCall(DefineFixed(result, r3), instr); |
1203 } | 1209 } |
1204 | 1210 |
1205 | 1211 |
1206 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { | 1212 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { |
1207 LOperand* context = UseFixed(instr->context(), cp); | 1213 LOperand* context = UseFixed(instr->context(), cp); |
1208 LOperand* constructor = UseFixed(instr->constructor(), r1); | 1214 LOperand* constructor = UseFixed(instr->constructor(), r4); |
1209 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); | 1215 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); |
1210 return MarkAsCall(DefineFixed(result, r0), instr); | 1216 return MarkAsCall(DefineFixed(result, r3), instr); |
1211 } | 1217 } |
1212 | 1218 |
1213 | 1219 |
1214 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1220 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
1215 LOperand* context = UseFixed(instr->context(), cp); | 1221 LOperand* context = UseFixed(instr->context(), cp); |
1216 LOperand* function = UseFixed(instr->function(), r1); | 1222 LOperand* function = UseFixed(instr->function(), r4); |
1217 LCallFunction* call = new(zone()) LCallFunction(context, function); | 1223 LCallFunction* call = new(zone()) LCallFunction(context, function); |
1218 return MarkAsCall(DefineFixed(call, r0), instr); | 1224 return MarkAsCall(DefineFixed(call, r3), instr); |
1219 } | 1225 } |
1220 | 1226 |
1221 | 1227 |
1222 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1228 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
1223 LOperand* context = UseFixed(instr->context(), cp); | 1229 LOperand* context = UseFixed(instr->context(), cp); |
1224 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r0), instr); | 1230 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r3), instr); |
1225 } | 1231 } |
1226 | 1232 |
1227 | 1233 |
1228 LInstruction* LChunkBuilder::DoRor(HRor* instr) { | 1234 LInstruction* LChunkBuilder::DoRor(HRor* instr) { |
1229 return DoShift(Token::ROR, instr); | 1235 return DoShift(Token::ROR, instr); |
1230 } | 1236 } |
1231 | 1237 |
1232 | 1238 |
1233 LInstruction* LChunkBuilder::DoShr(HShr* instr) { | 1239 LInstruction* LChunkBuilder::DoShr(HShr* instr) { |
1234 return DoShift(Token::SHR, instr); | 1240 return DoShift(Token::SHR, instr); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 return result; | 1300 return result; |
1295 } | 1301 } |
1296 | 1302 |
1297 | 1303 |
1298 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) { | 1304 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) { |
1299 ASSERT(instr->representation().IsSmiOrInteger32()); | 1305 ASSERT(instr->representation().IsSmiOrInteger32()); |
1300 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1306 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1301 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1307 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1302 LOperand* dividend = UseRegister(instr->left()); | 1308 LOperand* dividend = UseRegister(instr->left()); |
1303 LOperand* divisor = UseRegister(instr->right()); | 1309 LOperand* divisor = UseRegister(instr->right()); |
1304 LOperand* temp = | |
1305 CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); | |
1306 LInstruction* result = | 1310 LInstruction* result = |
1307 DefineAsRegister(new(zone()) LDivI(dividend, divisor, temp)); | 1311 DefineAsRegister(new(zone()) LDivI(dividend, divisor)); |
1308 if (instr->CheckFlag(HValue::kCanBeDivByZero) || | 1312 if (instr->CheckFlag(HValue::kCanBeDivByZero) || |
1309 instr->CheckFlag(HValue::kBailoutOnMinusZero) || | 1313 instr->CheckFlag(HValue::kBailoutOnMinusZero) || |
1310 (instr->CheckFlag(HValue::kCanOverflow) && | 1314 (instr->CheckFlag(HValue::kCanOverflow) && |
1311 (!CpuFeatures::IsSupported(SUDIV) || | 1315 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) || |
1312 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) || | |
1313 (!instr->IsMathFloorOfDiv() && | 1316 (!instr->IsMathFloorOfDiv() && |
1314 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { | 1317 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { |
1315 result = AssignEnvironment(result); | 1318 result = AssignEnvironment(result); |
1316 } | 1319 } |
1317 return result; | 1320 return result; |
1318 } | 1321 } |
1319 | 1322 |
1320 | 1323 |
1321 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { | 1324 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { |
1322 if (instr->representation().IsSmiOrInteger32()) { | 1325 if (instr->representation().IsSmiOrInteger32()) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 return result; | 1370 return result; |
1368 } | 1371 } |
1369 | 1372 |
1370 | 1373 |
1371 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { | 1374 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { |
1372 ASSERT(instr->representation().IsSmiOrInteger32()); | 1375 ASSERT(instr->representation().IsSmiOrInteger32()); |
1373 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1376 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1374 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1377 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1375 LOperand* dividend = UseRegister(instr->left()); | 1378 LOperand* dividend = UseRegister(instr->left()); |
1376 LOperand* divisor = UseRegister(instr->right()); | 1379 LOperand* divisor = UseRegister(instr->right()); |
1377 LOperand* temp = | 1380 LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor); |
1378 CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); | |
1379 LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor, temp); | |
1380 return AssignEnvironment(DefineAsRegister(div)); | 1381 return AssignEnvironment(DefineAsRegister(div)); |
1381 } | 1382 } |
1382 | 1383 |
1383 | 1384 |
1384 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { | 1385 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { |
1385 if (instr->RightIsPowerOf2()) { | 1386 if (instr->RightIsPowerOf2()) { |
1386 return DoFlooringDivByPowerOf2I(instr); | 1387 return DoFlooringDivByPowerOf2I(instr); |
1387 } else if (instr->right()->IsConstant()) { | 1388 } else if (instr->right()->IsConstant()) { |
1388 return DoFlooringDivByConstI(instr); | 1389 return DoFlooringDivByConstI(instr); |
1389 } else { | 1390 } else { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 return result; | 1422 return result; |
1422 } | 1423 } |
1423 | 1424 |
1424 | 1425 |
1425 LInstruction* LChunkBuilder::DoModI(HMod* instr) { | 1426 LInstruction* LChunkBuilder::DoModI(HMod* instr) { |
1426 ASSERT(instr->representation().IsSmiOrInteger32()); | 1427 ASSERT(instr->representation().IsSmiOrInteger32()); |
1427 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1428 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1428 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1429 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1429 LOperand* dividend = UseRegister(instr->left()); | 1430 LOperand* dividend = UseRegister(instr->left()); |
1430 LOperand* divisor = UseRegister(instr->right()); | 1431 LOperand* divisor = UseRegister(instr->right()); |
1431 LOperand* temp = | |
1432 CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); | |
1433 LOperand* temp2 = | |
1434 CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister(); | |
1435 LInstruction* result = DefineAsRegister(new(zone()) LModI( | 1432 LInstruction* result = DefineAsRegister(new(zone()) LModI( |
1436 dividend, divisor, temp, temp2)); | 1433 dividend, divisor)); |
1437 if (instr->CheckFlag(HValue::kCanBeDivByZero) || | 1434 if (instr->CheckFlag(HValue::kCanBeDivByZero) || |
1438 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1435 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1439 result = AssignEnvironment(result); | 1436 result = AssignEnvironment(result); |
1440 } | 1437 } |
1441 return result; | 1438 return result; |
1442 } | 1439 } |
1443 | 1440 |
1444 | 1441 |
1445 LInstruction* LChunkBuilder::DoMod(HMod* instr) { | 1442 LInstruction* LChunkBuilder::DoMod(HMod* instr) { |
1446 if (instr->representation().IsSmiOrInteger32()) { | 1443 if (instr->representation().IsSmiOrInteger32()) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 } else if (instr->representation().IsDouble()) { | 1500 } else if (instr->representation().IsDouble()) { |
1504 if (instr->HasOneUse() && (instr->uses().value()->IsAdd() || | 1501 if (instr->HasOneUse() && (instr->uses().value()->IsAdd() || |
1505 instr->uses().value()->IsSub())) { | 1502 instr->uses().value()->IsSub())) { |
1506 HBinaryOperation* use = HBinaryOperation::cast(instr->uses().value()); | 1503 HBinaryOperation* use = HBinaryOperation::cast(instr->uses().value()); |
1507 | 1504 |
1508 if (use->IsAdd() && instr == use->left()) { | 1505 if (use->IsAdd() && instr == use->left()) { |
1509 // This mul is the lhs of an add. The add and mul will be folded into a | 1506 // This mul is the lhs of an add. The add and mul will be folded into a |
1510 // multiply-add in DoAdd. | 1507 // multiply-add in DoAdd. |
1511 return NULL; | 1508 return NULL; |
1512 } | 1509 } |
1513 if (instr == use->right() && use->IsAdd() && !use->left()->IsMul()) { | 1510 if (instr == use->right() && use->IsAdd() && |
| 1511 !(use->left()->IsMul() && use->left()->HasOneUse())) { |
1514 // This mul is the rhs of an add, where the lhs is not another mul. | 1512 // This mul is the rhs of an add, where the lhs is not another mul. |
1515 // The add and mul will be folded into a multiply-add in DoAdd. | 1513 // The add and mul will be folded into a multiply-add in DoAdd. |
1516 return NULL; | 1514 return NULL; |
1517 } | 1515 } |
1518 if (instr == use->right() && use->IsSub()) { | 1516 if (instr == use->left() && use->IsSub()) { |
1519 // This mul is the rhs of a sub. The sub and mul will be folded into a | 1517 // This mul is the lhs of a sub. The mul and sub will be folded into a |
1520 // multiply-sub in DoSub. | 1518 // multiply-sub in DoSub. |
1521 return NULL; | 1519 return NULL; |
1522 } | 1520 } |
1523 } | 1521 } |
1524 | 1522 |
1525 return DoArithmeticD(Token::MUL, instr); | 1523 return DoArithmeticD(Token::MUL, instr); |
1526 } else { | 1524 } else { |
1527 return DoArithmeticT(Token::MUL, instr); | 1525 return DoArithmeticT(Token::MUL, instr); |
1528 } | 1526 } |
1529 } | 1527 } |
1530 | 1528 |
1531 | 1529 |
1532 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 1530 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
1533 if (instr->representation().IsSmiOrInteger32()) { | 1531 if (instr->representation().IsSmiOrInteger32()) { |
1534 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1532 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1535 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1533 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1536 | 1534 |
1537 if (instr->left()->IsConstant()) { | 1535 if (instr->left()->IsConstant() && |
| 1536 !instr->CheckFlag(HValue::kCanOverflow)) { |
1538 // If lhs is constant, do reverse subtraction instead. | 1537 // If lhs is constant, do reverse subtraction instead. |
1539 return DoRSub(instr); | 1538 return DoRSub(instr); |
1540 } | 1539 } |
1541 | 1540 |
1542 LOperand* left = UseRegisterAtStart(instr->left()); | 1541 LOperand* left = UseRegisterAtStart(instr->left()); |
1543 LOperand* right = UseOrConstantAtStart(instr->right()); | 1542 LOperand* right = UseOrConstantAtStart(instr->right()); |
1544 LSubI* sub = new(zone()) LSubI(left, right); | 1543 LSubI* sub = new(zone()) LSubI(left, right); |
1545 LInstruction* result = DefineAsRegister(sub); | 1544 LInstruction* result = DefineAsRegister(sub); |
1546 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1545 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1547 result = AssignEnvironment(result); | 1546 result = AssignEnvironment(result); |
1548 } | 1547 } |
1549 return result; | 1548 return result; |
1550 } else if (instr->representation().IsDouble()) { | 1549 } else if (instr->representation().IsDouble()) { |
1551 if (instr->right()->IsMul() && instr->right()->HasOneUse()) { | 1550 if (instr->left()->IsMul() && instr->left()->HasOneUse()) { |
1552 return DoMultiplySub(instr->left(), HMul::cast(instr->right())); | 1551 return DoMultiplySub(instr->right(), HMul::cast(instr->left())); |
1553 } | 1552 } |
1554 | 1553 |
1555 return DoArithmeticD(Token::SUB, instr); | 1554 return DoArithmeticD(Token::SUB, instr); |
1556 } else { | 1555 } else { |
1557 return DoArithmeticT(Token::SUB, instr); | 1556 return DoArithmeticT(Token::SUB, instr); |
1558 } | 1557 } |
1559 } | 1558 } |
1560 | 1559 |
1561 | 1560 |
1562 LInstruction* LChunkBuilder::DoRSub(HSub* instr) { | 1561 LInstruction* LChunkBuilder::DoRSub(HSub* instr) { |
1563 ASSERT(instr->representation().IsSmiOrInteger32()); | 1562 ASSERT(instr->representation().IsSmiOrInteger32()); |
1564 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1563 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1565 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1564 ASSERT(instr->right()->representation().Equals(instr->representation())); |
| 1565 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
1566 | 1566 |
1567 // Note: The lhs of the subtraction becomes the rhs of the | 1567 // Note: The lhs of the subtraction becomes the rhs of the |
1568 // reverse-subtraction. | 1568 // reverse-subtraction. |
1569 LOperand* left = UseRegisterAtStart(instr->right()); | 1569 LOperand* left = UseRegisterAtStart(instr->right()); |
1570 LOperand* right = UseOrConstantAtStart(instr->left()); | 1570 LOperand* right = UseOrConstantAtStart(instr->left()); |
1571 LRSubI* rsb = new(zone()) LRSubI(left, right); | 1571 LRSubI* rsb = new(zone()) LRSubI(left, right); |
1572 LInstruction* result = DefineAsRegister(rsb); | 1572 LInstruction* result = DefineAsRegister(rsb); |
1573 if (instr->CheckFlag(HValue::kCanOverflow)) { | |
1574 result = AssignEnvironment(result); | |
1575 } | |
1576 return result; | 1573 return result; |
1577 } | 1574 } |
1578 | 1575 |
1579 | 1576 |
1580 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { | 1577 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { |
1581 LOperand* multiplier_op = UseRegisterAtStart(mul->left()); | 1578 LOperand* multiplier_op = UseRegisterAtStart(mul->left()); |
1582 LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); | 1579 LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); |
1583 LOperand* addend_op = UseRegisterAtStart(addend); | 1580 LOperand* addend_op = UseRegisterAtStart(addend); |
1584 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, | 1581 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, |
1585 multiplicand_op)); | 1582 multiplicand_op)); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); | 1650 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); |
1654 } | 1651 } |
1655 | 1652 |
1656 | 1653 |
1657 LInstruction* LChunkBuilder::DoPower(HPower* instr) { | 1654 LInstruction* LChunkBuilder::DoPower(HPower* instr) { |
1658 ASSERT(instr->representation().IsDouble()); | 1655 ASSERT(instr->representation().IsDouble()); |
1659 // We call a C function for double power. It can't trigger a GC. | 1656 // We call a C function for double power. It can't trigger a GC. |
1660 // We need to use fixed result register for the call. | 1657 // We need to use fixed result register for the call. |
1661 Representation exponent_type = instr->right()->representation(); | 1658 Representation exponent_type = instr->right()->representation(); |
1662 ASSERT(instr->left()->representation().IsDouble()); | 1659 ASSERT(instr->left()->representation().IsDouble()); |
1663 LOperand* left = UseFixedDouble(instr->left(), d0); | 1660 LOperand* left = UseFixedDouble(instr->left(), d1); |
1664 LOperand* right = exponent_type.IsDouble() ? | 1661 LOperand* right = exponent_type.IsDouble() ? |
1665 UseFixedDouble(instr->right(), d1) : | 1662 UseFixedDouble(instr->right(), d2) : |
1666 UseFixed(instr->right(), r2); | 1663 UseFixed(instr->right(), r5); |
1667 LPower* result = new(zone()) LPower(left, right); | 1664 LPower* result = new(zone()) LPower(left, right); |
1668 return MarkAsCall(DefineFixedDouble(result, d2), | 1665 return MarkAsCall(DefineFixedDouble(result, d3), |
1669 instr, | 1666 instr, |
1670 CAN_DEOPTIMIZE_EAGERLY); | 1667 CAN_DEOPTIMIZE_EAGERLY); |
1671 } | 1668 } |
1672 | 1669 |
1673 | 1670 |
1674 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1671 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
1675 ASSERT(instr->left()->representation().IsTagged()); | 1672 ASSERT(instr->left()->representation().IsTagged()); |
1676 ASSERT(instr->right()->representation().IsTagged()); | 1673 ASSERT(instr->right()->representation().IsTagged()); |
1677 LOperand* context = UseFixed(instr->context(), cp); | 1674 LOperand* context = UseFixed(instr->context(), cp); |
1678 LOperand* left = UseFixed(instr->left(), r1); | 1675 LOperand* left = UseFixed(instr->left(), r4); |
1679 LOperand* right = UseFixed(instr->right(), r0); | 1676 LOperand* right = UseFixed(instr->right(), r3); |
1680 LCmpT* result = new(zone()) LCmpT(context, left, right); | 1677 LCmpT* result = new(zone()) LCmpT(context, left, right); |
1681 return MarkAsCall(DefineFixed(result, r0), instr); | 1678 return MarkAsCall(DefineFixed(result, r3), instr); |
1682 } | 1679 } |
1683 | 1680 |
1684 | 1681 |
1685 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( | 1682 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |
1686 HCompareNumericAndBranch* instr) { | 1683 HCompareNumericAndBranch* instr) { |
1687 Representation r = instr->representation(); | 1684 Representation r = instr->representation(); |
1688 if (r.IsSmiOrInteger32()) { | 1685 if (r.IsSmiOrInteger32()) { |
1689 ASSERT(instr->left()->representation().Equals(r)); | 1686 ASSERT(instr->left()->representation().Equals(r)); |
1690 ASSERT(instr->right()->representation().Equals(r)); | 1687 ASSERT(instr->right()->representation().Equals(r)); |
1691 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 1688 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 LOperand* value = UseRegisterAtStart(instr->value()); | 1750 LOperand* value = UseRegisterAtStart(instr->value()); |
1754 return new(zone()) LIsUndetectableAndBranch(value, TempRegister()); | 1751 return new(zone()) LIsUndetectableAndBranch(value, TempRegister()); |
1755 } | 1752 } |
1756 | 1753 |
1757 | 1754 |
1758 LInstruction* LChunkBuilder::DoStringCompareAndBranch( | 1755 LInstruction* LChunkBuilder::DoStringCompareAndBranch( |
1759 HStringCompareAndBranch* instr) { | 1756 HStringCompareAndBranch* instr) { |
1760 ASSERT(instr->left()->representation().IsTagged()); | 1757 ASSERT(instr->left()->representation().IsTagged()); |
1761 ASSERT(instr->right()->representation().IsTagged()); | 1758 ASSERT(instr->right()->representation().IsTagged()); |
1762 LOperand* context = UseFixed(instr->context(), cp); | 1759 LOperand* context = UseFixed(instr->context(), cp); |
1763 LOperand* left = UseFixed(instr->left(), r1); | 1760 LOperand* left = UseFixed(instr->left(), r4); |
1764 LOperand* right = UseFixed(instr->right(), r0); | 1761 LOperand* right = UseFixed(instr->right(), r3); |
1765 LStringCompareAndBranch* result = | 1762 LStringCompareAndBranch* result = |
1766 new(zone()) LStringCompareAndBranch(context, left, right); | 1763 new(zone()) LStringCompareAndBranch(context, left, right); |
1767 return MarkAsCall(result, instr); | 1764 return MarkAsCall(result, instr); |
1768 } | 1765 } |
1769 | 1766 |
1770 | 1767 |
1771 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( | 1768 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( |
1772 HHasInstanceTypeAndBranch* instr) { | 1769 HHasInstanceTypeAndBranch* instr) { |
1773 ASSERT(instr->value()->representation().IsTagged()); | 1770 ASSERT(instr->value()->representation().IsTagged()); |
1774 LOperand* value = UseRegisterAtStart(instr->value()); | 1771 LOperand* value = UseRegisterAtStart(instr->value()); |
(...skipping 26 matching lines...) Expand all Loading... |
1801 } | 1798 } |
1802 | 1799 |
1803 | 1800 |
1804 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { | 1801 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { |
1805 LOperand* map = UseRegisterAtStart(instr->value()); | 1802 LOperand* map = UseRegisterAtStart(instr->value()); |
1806 return DefineAsRegister(new(zone()) LMapEnumLength(map)); | 1803 return DefineAsRegister(new(zone()) LMapEnumLength(map)); |
1807 } | 1804 } |
1808 | 1805 |
1809 | 1806 |
1810 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { | 1807 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { |
1811 LOperand* object = UseFixed(instr->value(), r0); | 1808 LOperand* object = UseFixed(instr->value(), r3); |
1812 LDateField* result = | 1809 LDateField* result = |
1813 new(zone()) LDateField(object, FixedTemp(r1), instr->index()); | 1810 new(zone()) LDateField(object, FixedTemp(r4), instr->index()); |
1814 return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); | 1811 return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY); |
1815 } | 1812 } |
1816 | 1813 |
1817 | 1814 |
1818 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) { | 1815 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) { |
1819 LOperand* string = UseRegisterAtStart(instr->string()); | 1816 LOperand* string = UseRegisterAtStart(instr->string()); |
1820 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); | 1817 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |
1821 return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index)); | 1818 return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index)); |
1822 } | 1819 } |
1823 | 1820 |
1824 | 1821 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { | 2013 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
2017 HValue* value = instr->value(); | 2014 HValue* value = instr->value(); |
2018 Representation input_rep = value->representation(); | 2015 Representation input_rep = value->representation(); |
2019 LOperand* reg = UseRegister(value); | 2016 LOperand* reg = UseRegister(value); |
2020 if (input_rep.IsDouble()) { | 2017 if (input_rep.IsDouble()) { |
2021 return DefineAsRegister(new(zone()) LClampDToUint8(reg)); | 2018 return DefineAsRegister(new(zone()) LClampDToUint8(reg)); |
2022 } else if (input_rep.IsInteger32()) { | 2019 } else if (input_rep.IsInteger32()) { |
2023 return DefineAsRegister(new(zone()) LClampIToUint8(reg)); | 2020 return DefineAsRegister(new(zone()) LClampIToUint8(reg)); |
2024 } else { | 2021 } else { |
2025 ASSERT(input_rep.IsSmiOrTagged()); | 2022 ASSERT(input_rep.IsSmiOrTagged()); |
2026 // Register allocator doesn't (yet) support allocation of double | |
2027 // temps. Reserve d1 explicitly. | |
2028 LClampTToUint8* result = | 2023 LClampTToUint8* result = |
2029 new(zone()) LClampTToUint8(reg, TempDoubleRegister()); | 2024 new(zone()) LClampTToUint8(reg, TempDoubleRegister()); |
2030 return AssignEnvironment(DefineAsRegister(result)); | 2025 return AssignEnvironment(DefineAsRegister(result)); |
2031 } | 2026 } |
2032 } | 2027 } |
2033 | 2028 |
2034 | 2029 |
2035 LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) { | 2030 LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) { |
2036 HValue* value = instr->value(); | 2031 HValue* value = instr->value(); |
2037 ASSERT(value->representation().IsDouble()); | 2032 ASSERT(value->representation().IsDouble()); |
2038 return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value))); | 2033 return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value))); |
2039 } | 2034 } |
2040 | 2035 |
2041 | 2036 |
2042 LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) { | 2037 LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) { |
2043 LOperand* lo = UseRegister(instr->lo()); | 2038 LOperand* lo = UseRegister(instr->lo()); |
2044 LOperand* hi = UseRegister(instr->hi()); | 2039 LOperand* hi = UseRegister(instr->hi()); |
2045 return DefineAsRegister(new(zone()) LConstructDouble(hi, lo)); | 2040 return DefineAsRegister(new(zone()) LConstructDouble(hi, lo)); |
2046 } | 2041 } |
2047 | 2042 |
2048 | 2043 |
2049 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 2044 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
2050 LOperand* context = info()->IsStub() | 2045 LOperand* context = info()->IsStub() |
2051 ? UseFixed(instr->context(), cp) | 2046 ? UseFixed(instr->context(), cp) |
2052 : NULL; | 2047 : NULL; |
2053 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); | 2048 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); |
2054 return new(zone()) LReturn(UseFixed(instr->value(), r0), context, | 2049 return new(zone()) LReturn(UseFixed(instr->value(), r3), context, |
2055 parameter_count); | 2050 parameter_count); |
2056 } | 2051 } |
2057 | 2052 |
2058 | 2053 |
2059 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 2054 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
2060 Representation r = instr->representation(); | 2055 Representation r = instr->representation(); |
2061 if (r.IsSmi()) { | 2056 if (r.IsSmi()) { |
2062 return DefineAsRegister(new(zone()) LConstantS); | 2057 return DefineAsRegister(new(zone()) LConstantS); |
2063 } else if (r.IsInteger32()) { | 2058 } else if (r.IsInteger32()) { |
2064 return DefineAsRegister(new(zone()) LConstantI); | 2059 return DefineAsRegister(new(zone()) LConstantI); |
(...skipping 21 matching lines...) Expand all Loading... |
2086 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 2081 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
2087 LOperand* context = UseFixed(instr->context(), cp); | 2082 LOperand* context = UseFixed(instr->context(), cp); |
2088 LOperand* global_object = UseFixed(instr->global_object(), | 2083 LOperand* global_object = UseFixed(instr->global_object(), |
2089 LoadIC::ReceiverRegister()); | 2084 LoadIC::ReceiverRegister()); |
2090 LOperand* vector = NULL; | 2085 LOperand* vector = NULL; |
2091 if (FLAG_vector_ics) { | 2086 if (FLAG_vector_ics) { |
2092 vector = FixedTemp(LoadIC::VectorRegister()); | 2087 vector = FixedTemp(LoadIC::VectorRegister()); |
2093 } | 2088 } |
2094 LLoadGlobalGeneric* result = | 2089 LLoadGlobalGeneric* result = |
2095 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2090 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
2096 return MarkAsCall(DefineFixed(result, r0), instr); | 2091 return MarkAsCall(DefineFixed(result, r3), instr); |
2097 } | 2092 } |
2098 | 2093 |
2099 | 2094 |
2100 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | 2095 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
2101 LOperand* value = UseRegister(instr->value()); | 2096 LOperand* value = UseRegister(instr->value()); |
2102 // Use a temp to check the value in the cell in the case where we perform | 2097 // Use a temp to check the value in the cell in the case where we perform |
2103 // a hole check. | 2098 // a hole check. |
2104 return instr->RequiresHoleCheck() | 2099 return instr->RequiresHoleCheck() |
2105 ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) | 2100 ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) |
2106 : new(zone()) LStoreGlobalCell(value, NULL); | 2101 : new(zone()) LStoreGlobalCell(value, NULL); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 | 2139 |
2145 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 2140 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
2146 LOperand* context = UseFixed(instr->context(), cp); | 2141 LOperand* context = UseFixed(instr->context(), cp); |
2147 LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); | 2142 LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); |
2148 LOperand* vector = NULL; | 2143 LOperand* vector = NULL; |
2149 if (FLAG_vector_ics) { | 2144 if (FLAG_vector_ics) { |
2150 vector = FixedTemp(LoadIC::VectorRegister()); | 2145 vector = FixedTemp(LoadIC::VectorRegister()); |
2151 } | 2146 } |
2152 | 2147 |
2153 LInstruction* result = | 2148 LInstruction* result = |
2154 DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), r0); | 2149 DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), r3); |
2155 return MarkAsCall(result, instr); | 2150 return MarkAsCall(result, instr); |
2156 } | 2151 } |
2157 | 2152 |
2158 | 2153 |
2159 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 2154 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
2160 HLoadFunctionPrototype* instr) { | 2155 HLoadFunctionPrototype* instr) { |
2161 return AssignEnvironment(DefineAsRegister( | 2156 return AssignEnvironment(DefineAsRegister( |
2162 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); | 2157 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); |
2163 } | 2158 } |
2164 | 2159 |
2165 | 2160 |
2166 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { | 2161 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { |
2167 return DefineAsRegister(new(zone()) LLoadRoot); | 2162 return DefineAsRegister(new(zone()) LLoadRoot); |
2168 } | 2163 } |
2169 | 2164 |
2170 | 2165 |
2171 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 2166 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
2172 ASSERT(instr->key()->representation().IsSmiOrInteger32()); | 2167 ASSERT(instr->key()->representation().IsSmiOrInteger32()); |
2173 ElementsKind elements_kind = instr->elements_kind(); | 2168 ElementsKind elements_kind = instr->elements_kind(); |
2174 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2169 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2175 LInstruction* result = NULL; | 2170 LInstruction* result = NULL; |
2176 | 2171 |
2177 if (!instr->is_typed_elements()) { | 2172 if (!instr->is_typed_elements()) { |
2178 LOperand* obj = NULL; | 2173 LOperand* obj = NULL; |
2179 if (instr->representation().IsDouble()) { | 2174 if (instr->representation().IsDouble()) { |
2180 obj = UseRegister(instr->elements()); | 2175 obj = UseRegister(instr->elements()); |
2181 } else { | 2176 } else { |
2182 ASSERT(instr->representation().IsSmiOrTagged()); | |
2183 obj = UseRegisterAtStart(instr->elements()); | 2177 obj = UseRegisterAtStart(instr->elements()); |
2184 } | 2178 } |
2185 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2179 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); |
2186 } else { | 2180 } else { |
2187 ASSERT( | 2181 ASSERT( |
2188 (instr->representation().IsInteger32() && | 2182 (instr->representation().IsInteger32() && |
2189 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2183 !IsDoubleOrFloatElementsKind(elements_kind)) || |
2190 (instr->representation().IsDouble() && | 2184 (instr->representation().IsDouble() && |
2191 IsDoubleOrFloatElementsKind(elements_kind))); | 2185 IsDoubleOrFloatElementsKind(elements_kind))); |
2192 LOperand* backing_store = UseRegister(instr->elements()); | 2186 LOperand* backing_store = UseRegister(instr->elements()); |
(...skipping 18 matching lines...) Expand all Loading... |
2211 LOperand* context = UseFixed(instr->context(), cp); | 2205 LOperand* context = UseFixed(instr->context(), cp); |
2212 LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); | 2206 LOperand* object = UseFixed(instr->object(), LoadIC::ReceiverRegister()); |
2213 LOperand* key = UseFixed(instr->key(), LoadIC::NameRegister()); | 2207 LOperand* key = UseFixed(instr->key(), LoadIC::NameRegister()); |
2214 LOperand* vector = NULL; | 2208 LOperand* vector = NULL; |
2215 if (FLAG_vector_ics) { | 2209 if (FLAG_vector_ics) { |
2216 vector = FixedTemp(LoadIC::VectorRegister()); | 2210 vector = FixedTemp(LoadIC::VectorRegister()); |
2217 } | 2211 } |
2218 | 2212 |
2219 LInstruction* result = | 2213 LInstruction* result = |
2220 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), | 2214 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), |
2221 r0); | 2215 r3); |
2222 return MarkAsCall(result, instr); | 2216 return MarkAsCall(result, instr); |
2223 } | 2217 } |
2224 | 2218 |
2225 | 2219 |
2226 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2220 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
2227 if (!instr->is_typed_elements()) { | 2221 if (!instr->is_typed_elements()) { |
2228 ASSERT(instr->elements()->representation().IsTagged()); | 2222 ASSERT(instr->elements()->representation().IsTagged()); |
2229 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2223 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
2230 LOperand* object = NULL; | 2224 LOperand* object = NULL; |
2231 LOperand* key = NULL; | 2225 LOperand* key = NULL; |
2232 LOperand* val = NULL; | 2226 LOperand* val = NULL; |
2233 | 2227 |
2234 if (instr->value()->representation().IsDouble()) { | 2228 if (instr->value()->representation().IsDouble()) { |
2235 object = UseRegisterAtStart(instr->elements()); | 2229 object = UseRegisterAtStart(instr->elements()); |
2236 val = UseRegister(instr->value()); | 2230 val = UseRegister(instr->value()); |
2237 key = UseRegisterOrConstantAtStart(instr->key()); | 2231 key = UseRegisterOrConstantAtStart(instr->key()); |
2238 } else { | 2232 } else { |
2239 ASSERT(instr->value()->representation().IsSmiOrTagged()); | |
2240 if (needs_write_barrier) { | 2233 if (needs_write_barrier) { |
2241 object = UseTempRegister(instr->elements()); | 2234 object = UseTempRegister(instr->elements()); |
2242 val = UseTempRegister(instr->value()); | 2235 val = UseTempRegister(instr->value()); |
2243 key = UseTempRegister(instr->key()); | 2236 key = UseTempRegister(instr->key()); |
2244 } else { | 2237 } else { |
2245 object = UseRegisterAtStart(instr->elements()); | 2238 object = UseRegisterAtStart(instr->elements()); |
2246 val = UseRegisterAtStart(instr->value()); | 2239 val = UseRegisterAtStart(instr->value()); |
2247 key = UseRegisterOrConstantAtStart(instr->key()); | 2240 key = UseRegisterOrConstantAtStart(instr->key()); |
2248 } | 2241 } |
2249 } | 2242 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 | 2277 |
2285 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2278 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
2286 HTransitionElementsKind* instr) { | 2279 HTransitionElementsKind* instr) { |
2287 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2280 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
2288 LOperand* object = UseRegister(instr->object()); | 2281 LOperand* object = UseRegister(instr->object()); |
2289 LOperand* new_map_reg = TempRegister(); | 2282 LOperand* new_map_reg = TempRegister(); |
2290 LTransitionElementsKind* result = | 2283 LTransitionElementsKind* result = |
2291 new(zone()) LTransitionElementsKind(object, NULL, new_map_reg); | 2284 new(zone()) LTransitionElementsKind(object, NULL, new_map_reg); |
2292 return result; | 2285 return result; |
2293 } else { | 2286 } else { |
2294 LOperand* object = UseFixed(instr->object(), r0); | 2287 LOperand* object = UseFixed(instr->object(), r3); |
2295 LOperand* context = UseFixed(instr->context(), cp); | 2288 LOperand* context = UseFixed(instr->context(), cp); |
2296 LTransitionElementsKind* result = | 2289 LTransitionElementsKind* result = |
2297 new(zone()) LTransitionElementsKind(object, context, NULL); | 2290 new(zone()) LTransitionElementsKind(object, context, NULL); |
2298 return MarkAsCall(result, instr); | 2291 return MarkAsCall(result, instr); |
2299 } | 2292 } |
2300 } | 2293 } |
2301 | 2294 |
2302 | 2295 |
2303 LInstruction* LChunkBuilder::DoTrapAllocationMemento( | 2296 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
2304 HTrapAllocationMemento* instr) { | 2297 HTrapAllocationMemento* instr) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2348 LOperand* obj = UseFixed(instr->object(), StoreIC::ReceiverRegister()); | 2341 LOperand* obj = UseFixed(instr->object(), StoreIC::ReceiverRegister()); |
2349 LOperand* val = UseFixed(instr->value(), StoreIC::ValueRegister()); | 2342 LOperand* val = UseFixed(instr->value(), StoreIC::ValueRegister()); |
2350 | 2343 |
2351 LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val); | 2344 LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val); |
2352 return MarkAsCall(result, instr); | 2345 return MarkAsCall(result, instr); |
2353 } | 2346 } |
2354 | 2347 |
2355 | 2348 |
2356 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2349 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
2357 LOperand* context = UseFixed(instr->context(), cp); | 2350 LOperand* context = UseFixed(instr->context(), cp); |
2358 LOperand* left = UseFixed(instr->left(), r1); | 2351 LOperand* left = UseFixed(instr->left(), r4); |
2359 LOperand* right = UseFixed(instr->right(), r0); | 2352 LOperand* right = UseFixed(instr->right(), r3); |
2360 return MarkAsCall( | 2353 return MarkAsCall( |
2361 DefineFixed(new(zone()) LStringAdd(context, left, right), r0), | 2354 DefineFixed(new(zone()) LStringAdd(context, left, right), r3), |
2362 instr); | 2355 instr); |
2363 } | 2356 } |
2364 | 2357 |
2365 | 2358 |
2366 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2359 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
2367 LOperand* string = UseTempRegister(instr->string()); | 2360 LOperand* string = UseTempRegister(instr->string()); |
2368 LOperand* index = UseTempRegister(instr->index()); | 2361 LOperand* index = UseTempRegister(instr->index()); |
2369 LOperand* context = UseAny(instr->context()); | 2362 LOperand* context = UseAny(instr->context()); |
2370 LStringCharCodeAt* result = | 2363 LStringCharCodeAt* result = |
2371 new(zone()) LStringCharCodeAt(context, string, index); | 2364 new(zone()) LStringCharCodeAt(context, string, index); |
(...skipping 17 matching lines...) Expand all Loading... |
2389 LOperand* temp1 = TempRegister(); | 2382 LOperand* temp1 = TempRegister(); |
2390 LOperand* temp2 = TempRegister(); | 2383 LOperand* temp2 = TempRegister(); |
2391 LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2); | 2384 LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2); |
2392 return AssignPointerMap(DefineAsRegister(result)); | 2385 return AssignPointerMap(DefineAsRegister(result)); |
2393 } | 2386 } |
2394 | 2387 |
2395 | 2388 |
2396 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { | 2389 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { |
2397 LOperand* context = UseFixed(instr->context(), cp); | 2390 LOperand* context = UseFixed(instr->context(), cp); |
2398 return MarkAsCall( | 2391 return MarkAsCall( |
2399 DefineFixed(new(zone()) LRegExpLiteral(context), r0), instr); | 2392 DefineFixed(new(zone()) LRegExpLiteral(context), r3), instr); |
2400 } | 2393 } |
2401 | 2394 |
2402 | 2395 |
2403 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { | 2396 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { |
2404 LOperand* context = UseFixed(instr->context(), cp); | 2397 LOperand* context = UseFixed(instr->context(), cp); |
2405 return MarkAsCall( | 2398 return MarkAsCall( |
2406 DefineFixed(new(zone()) LFunctionLiteral(context), r0), instr); | 2399 DefineFixed(new(zone()) LFunctionLiteral(context), r3), instr); |
2407 } | 2400 } |
2408 | 2401 |
2409 | 2402 |
2410 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { | 2403 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { |
2411 ASSERT(argument_count_ == 0); | 2404 ASSERT(argument_count_ == 0); |
2412 allocator_->MarkAsOsrEntry(); | 2405 allocator_->MarkAsOsrEntry(); |
2413 current_block_->last_environment()->set_ast_id(instr->ast_id()); | 2406 current_block_->last_environment()->set_ast_id(instr->ast_id()); |
2414 return AssignEnvironment(new(zone()) LOsrEntry); | 2407 return AssignEnvironment(new(zone()) LOsrEntry); |
2415 } | 2408 } |
2416 | 2409 |
(...skipping 27 matching lines...) Expand all Loading... |
2444 Abort(kTooManySpillSlotsNeededForOSR); | 2437 Abort(kTooManySpillSlotsNeededForOSR); |
2445 spill_index = 0; | 2438 spill_index = 0; |
2446 } | 2439 } |
2447 } | 2440 } |
2448 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2441 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
2449 } | 2442 } |
2450 | 2443 |
2451 | 2444 |
2452 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2445 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
2453 LOperand* context = UseFixed(instr->context(), cp); | 2446 LOperand* context = UseFixed(instr->context(), cp); |
2454 return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r0), instr); | 2447 return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r3), instr); |
2455 } | 2448 } |
2456 | 2449 |
2457 | 2450 |
2458 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 2451 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
2459 // There are no real uses of the arguments object. | 2452 // There are no real uses of the arguments object. |
2460 // arguments.length and element access are supported directly on | 2453 // arguments.length and element access are supported directly on |
2461 // stack arguments, and any real arguments object use causes a bailout. | 2454 // stack arguments, and any real arguments object use causes a bailout. |
2462 // So this value is never used. | 2455 // So this value is never used. |
2463 return NULL; | 2456 return NULL; |
2464 } | 2457 } |
(...skipping 10 matching lines...) Expand all Loading... |
2475 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { | 2468 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
2476 info()->MarkAsRequiresFrame(); | 2469 info()->MarkAsRequiresFrame(); |
2477 LOperand* args = UseRegister(instr->arguments()); | 2470 LOperand* args = UseRegister(instr->arguments()); |
2478 LOperand* length = UseRegisterOrConstantAtStart(instr->length()); | 2471 LOperand* length = UseRegisterOrConstantAtStart(instr->length()); |
2479 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); | 2472 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |
2480 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); | 2473 return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); |
2481 } | 2474 } |
2482 | 2475 |
2483 | 2476 |
2484 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { | 2477 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |
2485 LOperand* object = UseFixed(instr->value(), r0); | 2478 LOperand* object = UseFixed(instr->value(), r3); |
2486 LToFastProperties* result = new(zone()) LToFastProperties(object); | 2479 LToFastProperties* result = new(zone()) LToFastProperties(object); |
2487 return MarkAsCall(DefineFixed(result, r0), instr); | 2480 return MarkAsCall(DefineFixed(result, r3), instr); |
2488 } | 2481 } |
2489 | 2482 |
2490 | 2483 |
2491 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { | 2484 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { |
2492 LOperand* context = UseFixed(instr->context(), cp); | 2485 LOperand* context = UseFixed(instr->context(), cp); |
2493 LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), r0)); | 2486 LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), r3)); |
2494 return MarkAsCall(DefineFixed(result, r0), instr); | 2487 return MarkAsCall(DefineFixed(result, r3), instr); |
2495 } | 2488 } |
2496 | 2489 |
2497 | 2490 |
2498 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { | 2491 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { |
2499 return new(zone()) LTypeofIsAndBranch(UseRegister(instr->value())); | 2492 return new(zone()) LTypeofIsAndBranch(UseRegister(instr->value())); |
2500 } | 2493 } |
2501 | 2494 |
2502 | 2495 |
2503 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( | 2496 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( |
2504 HIsConstructCallAndBranch* instr) { | 2497 HIsConstructCallAndBranch* instr) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2559 HEnvironment* outer = current_block_->last_environment()-> | 2552 HEnvironment* outer = current_block_->last_environment()-> |
2560 DiscardInlined(false); | 2553 DiscardInlined(false); |
2561 current_block_->UpdateEnvironment(outer); | 2554 current_block_->UpdateEnvironment(outer); |
2562 | 2555 |
2563 return pop; | 2556 return pop; |
2564 } | 2557 } |
2565 | 2558 |
2566 | 2559 |
2567 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { | 2560 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { |
2568 LOperand* context = UseFixed(instr->context(), cp); | 2561 LOperand* context = UseFixed(instr->context(), cp); |
2569 LOperand* object = UseFixed(instr->enumerable(), r0); | 2562 LOperand* object = UseFixed(instr->enumerable(), r3); |
2570 LForInPrepareMap* result = new(zone()) LForInPrepareMap(context, object); | 2563 LForInPrepareMap* result = new(zone()) LForInPrepareMap(context, object); |
2571 return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); | 2564 return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY); |
2572 } | 2565 } |
2573 | 2566 |
2574 | 2567 |
2575 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { | 2568 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { |
2576 LOperand* map = UseRegister(instr->map()); | 2569 LOperand* map = UseRegister(instr->map()); |
2577 return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map))); | 2570 return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map))); |
2578 } | 2571 } |
2579 | 2572 |
2580 | 2573 |
2581 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { | 2574 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { |
(...skipping 21 matching lines...) Expand all Loading... |
2603 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2596 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
2604 HAllocateBlockContext* instr) { | 2597 HAllocateBlockContext* instr) { |
2605 LOperand* context = UseFixed(instr->context(), cp); | 2598 LOperand* context = UseFixed(instr->context(), cp); |
2606 LOperand* function = UseRegisterAtStart(instr->function()); | 2599 LOperand* function = UseRegisterAtStart(instr->function()); |
2607 LAllocateBlockContext* result = | 2600 LAllocateBlockContext* result = |
2608 new(zone()) LAllocateBlockContext(context, function); | 2601 new(zone()) LAllocateBlockContext(context, function); |
2609 return MarkAsCall(DefineFixed(result, cp), instr); | 2602 return MarkAsCall(DefineFixed(result, cp), instr); |
2610 } | 2603 } |
2611 | 2604 |
2612 } } // namespace v8::internal | 2605 } } // namespace v8::internal |
OLD | NEW |