| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 | 774 |
| 775 | 775 |
| 776 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 776 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
| 777 HBinaryOperation* instr) { | 777 HBinaryOperation* instr) { |
| 778 HValue* left = instr->left(); | 778 HValue* left = instr->left(); |
| 779 HValue* right = instr->right(); | 779 HValue* right = instr->right(); |
| 780 ASSERT(left->representation().IsTagged()); | 780 ASSERT(left->representation().IsTagged()); |
| 781 ASSERT(right->representation().IsTagged()); | 781 ASSERT(right->representation().IsTagged()); |
| 782 LOperand* context = UseFixed(instr->context(), cp); |
| 782 LOperand* left_operand = UseFixed(left, r1); | 783 LOperand* left_operand = UseFixed(left, r1); |
| 783 LOperand* right_operand = UseFixed(right, r0); | 784 LOperand* right_operand = UseFixed(right, r0); |
| 784 LArithmeticT* result = | 785 LArithmeticT* result = |
| 785 new(zone()) LArithmeticT(op, left_operand, right_operand); | 786 new(zone()) LArithmeticT(op, context, left_operand, right_operand); |
| 786 return MarkAsCall(DefineFixed(result, r0), instr); | 787 return MarkAsCall(DefineFixed(result, r0), instr); |
| 787 } | 788 } |
| 788 | 789 |
| 789 | 790 |
| 790 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { | 791 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { |
| 791 ASSERT(is_building()); | 792 ASSERT(is_building()); |
| 792 current_block_ = block; | 793 current_block_ = block; |
| 793 next_block_ = next_block; | 794 next_block_ = next_block; |
| 794 if (block->IsStartBlock()) { | 795 if (block->IsStartBlock()) { |
| 795 block->UpdateEnvironment(graph_->start_environment()); | 796 block->UpdateEnvironment(graph_->start_environment()); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 } | 1038 } |
| 1038 | 1039 |
| 1039 | 1040 |
| 1040 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 1041 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |
| 1041 info()->MarkAsRequiresFrame(); | 1042 info()->MarkAsRequiresFrame(); |
| 1042 return DefineAsRegister(new(zone()) LArgumentsElements); | 1043 return DefineAsRegister(new(zone()) LArgumentsElements); |
| 1043 } | 1044 } |
| 1044 | 1045 |
| 1045 | 1046 |
| 1046 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 1047 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
| 1048 LOperand* context = UseFixed(instr->context(), cp); |
| 1047 LInstanceOf* result = | 1049 LInstanceOf* result = |
| 1048 new(zone()) LInstanceOf(UseFixed(instr->left(), r0), | 1050 new(zone()) LInstanceOf(context, UseFixed(instr->left(), r0), |
| 1049 UseFixed(instr->right(), r1)); | 1051 UseFixed(instr->right(), r1)); |
| 1050 return MarkAsCall(DefineFixed(result, r0), instr); | 1052 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1051 } | 1053 } |
| 1052 | 1054 |
| 1053 | 1055 |
| 1054 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( | 1056 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( |
| 1055 HInstanceOfKnownGlobal* instr) { | 1057 HInstanceOfKnownGlobal* instr) { |
| 1056 LInstanceOfKnownGlobal* result = | 1058 LInstanceOfKnownGlobal* result = |
| 1057 new(zone()) LInstanceOfKnownGlobal(UseFixed(instr->left(), r0), | 1059 new(zone()) LInstanceOfKnownGlobal( |
| 1058 FixedTemp(r4)); | 1060 UseFixed(instr->context(), cp), |
| 1061 UseFixed(instr->left(), r0), |
| 1062 FixedTemp(r4)); |
| 1059 return MarkAsCall(DefineFixed(result, r0), instr); | 1063 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1060 } | 1064 } |
| 1061 | 1065 |
| 1062 | 1066 |
| 1063 LInstruction* LChunkBuilder::DoInstanceSize(HInstanceSize* instr) { | 1067 LInstruction* LChunkBuilder::DoInstanceSize(HInstanceSize* instr) { |
| 1064 LOperand* object = UseRegisterAtStart(instr->object()); | 1068 LOperand* object = UseRegisterAtStart(instr->object()); |
| 1065 return DefineAsRegister(new(zone()) LInstanceSize(object)); | 1069 return DefineAsRegister(new(zone()) LInstanceSize(object)); |
| 1066 } | 1070 } |
| 1067 | 1071 |
| 1068 | 1072 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 | 1116 |
| 1113 | 1117 |
| 1114 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 1118 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
| 1115 return instr->HasNoUses() | 1119 return instr->HasNoUses() |
| 1116 ? NULL | 1120 ? NULL |
| 1117 : DefineAsRegister(new(zone()) LThisFunction); | 1121 : DefineAsRegister(new(zone()) LThisFunction); |
| 1118 } | 1122 } |
| 1119 | 1123 |
| 1120 | 1124 |
| 1121 LInstruction* LChunkBuilder::DoContext(HContext* instr) { | 1125 LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
| 1122 // If there is a non-return use, the context must be allocated in a register. | 1126 if (instr->HasNoUses()) return NULL; |
| 1123 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { | 1127 |
| 1124 if (!it.value()->IsReturn()) { | 1128 if (info()->IsStub()) { |
| 1125 return DefineAsRegister(new(zone()) LContext); | 1129 return DefineFixed(new(zone()) LContext, cp); |
| 1126 } | |
| 1127 } | 1130 } |
| 1128 | 1131 |
| 1129 return NULL; | 1132 return DefineAsRegister(new(zone()) LContext); |
| 1130 } | 1133 } |
| 1131 | 1134 |
| 1132 | 1135 |
| 1133 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { | 1136 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { |
| 1134 LOperand* context = UseRegisterAtStart(instr->value()); | 1137 LOperand* context = UseRegisterAtStart(instr->value()); |
| 1135 return DefineAsRegister(new(zone()) LOuterContext(context)); | 1138 return DefineAsRegister(new(zone()) LOuterContext(context)); |
| 1136 } | 1139 } |
| 1137 | 1140 |
| 1138 | 1141 |
| 1139 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { | 1142 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) { |
| 1140 return MarkAsCall(new(zone()) LDeclareGlobals, instr); | 1143 LOperand* context = UseFixed(instr->context(), cp); |
| 1144 return MarkAsCall(new(zone()) LDeclareGlobals(context), instr); |
| 1141 } | 1145 } |
| 1142 | 1146 |
| 1143 | 1147 |
| 1144 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { | 1148 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { |
| 1145 LOperand* context = UseRegisterAtStart(instr->value()); | 1149 LOperand* context = UseRegisterAtStart(instr->value()); |
| 1146 return DefineAsRegister(new(zone()) LGlobalObject(context)); | 1150 return DefineAsRegister(new(zone()) LGlobalObject(context)); |
| 1147 } | 1151 } |
| 1148 | 1152 |
| 1149 | 1153 |
| 1150 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { | 1154 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { |
| 1151 LOperand* global_object = UseRegisterAtStart(instr->value()); | 1155 LOperand* global_object = UseRegisterAtStart(instr->value()); |
| 1152 return DefineAsRegister(new(zone()) LGlobalReceiver(global_object)); | 1156 return DefineAsRegister(new(zone()) LGlobalReceiver(global_object)); |
| 1153 } | 1157 } |
| 1154 | 1158 |
| 1155 | 1159 |
| 1156 LInstruction* LChunkBuilder::DoCallConstantFunction( | 1160 LInstruction* LChunkBuilder::DoCallConstantFunction( |
| 1157 HCallConstantFunction* instr) { | 1161 HCallConstantFunction* instr) { |
| 1158 argument_count_ -= instr->argument_count(); | 1162 argument_count_ -= instr->argument_count(); |
| 1159 return MarkAsCall(DefineFixed(new(zone()) LCallConstantFunction, r0), instr); | 1163 return MarkAsCall(DefineFixed(new(zone()) LCallConstantFunction, r0), instr); |
| 1160 } | 1164 } |
| 1161 | 1165 |
| 1162 | 1166 |
| 1163 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1167 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
| 1168 LOperand* context = UseFixed(instr->context(), cp); |
| 1164 LOperand* function = UseFixed(instr->function(), r1); | 1169 LOperand* function = UseFixed(instr->function(), r1); |
| 1165 argument_count_ -= instr->argument_count(); | 1170 argument_count_ -= instr->argument_count(); |
| 1166 LInvokeFunction* result = new(zone()) LInvokeFunction(function); | 1171 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); |
| 1167 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1172 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1168 } | 1173 } |
| 1169 | 1174 |
| 1170 | 1175 |
| 1171 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1176 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1172 switch (instr->op()) { | 1177 switch (instr->op()) { |
| 1173 case kMathFloor: return DoMathFloor(instr); | 1178 case kMathFloor: return DoMathFloor(instr); |
| 1174 case kMathRound: return DoMathRound(instr); | 1179 case kMathRound: return DoMathRound(instr); |
| 1175 case kMathAbs: return DoMathAbs(instr); | 1180 case kMathAbs: return DoMathAbs(instr); |
| 1176 case kMathLog: return DoMathLog(instr); | 1181 case kMathLog: return DoMathLog(instr); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1196 | 1201 |
| 1197 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { | 1202 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { |
| 1198 LOperand* input = UseRegister(instr->value()); | 1203 LOperand* input = UseRegister(instr->value()); |
| 1199 LOperand* temp = FixedTemp(d3); | 1204 LOperand* temp = FixedTemp(d3); |
| 1200 LMathRound* result = new(zone()) LMathRound(input, temp); | 1205 LMathRound* result = new(zone()) LMathRound(input, temp); |
| 1201 return AssignEnvironment(DefineAsRegister(result)); | 1206 return AssignEnvironment(DefineAsRegister(result)); |
| 1202 } | 1207 } |
| 1203 | 1208 |
| 1204 | 1209 |
| 1205 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { | 1210 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { |
| 1211 Representation r = instr->value()->representation(); |
| 1212 LOperand* context = (r.IsDouble() || r.IsSmiOrInteger32()) |
| 1213 ? NULL |
| 1214 : UseFixed(instr->context(), cp); |
| 1206 LOperand* input = UseRegister(instr->value()); | 1215 LOperand* input = UseRegister(instr->value()); |
| 1207 LMathAbs* result = new(zone()) LMathAbs(input); | 1216 LMathAbs* result = new(zone()) LMathAbs(context, input); |
| 1208 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1217 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1209 } | 1218 } |
| 1210 | 1219 |
| 1211 | 1220 |
| 1212 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 1221 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |
| 1213 LOperand* input = UseFixedDouble(instr->value(), d2); | 1222 LOperand* input = UseFixedDouble(instr->value(), d2); |
| 1214 LMathLog* result = new(zone()) LMathLog(input); | 1223 LMathLog* result = new(zone()) LMathLog(input); |
| 1215 return MarkAsCall(DefineFixedDouble(result, d2), instr); | 1224 return MarkAsCall(DefineFixedDouble(result, d2), instr); |
| 1216 } | 1225 } |
| 1217 | 1226 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { | 1268 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { |
| 1260 LOperand* input = UseFixedDouble(instr->value(), d2); | 1269 LOperand* input = UseFixedDouble(instr->value(), d2); |
| 1261 LOperand* temp = FixedTemp(d3); | 1270 LOperand* temp = FixedTemp(d3); |
| 1262 LMathPowHalf* result = new(zone()) LMathPowHalf(input, temp); | 1271 LMathPowHalf* result = new(zone()) LMathPowHalf(input, temp); |
| 1263 return DefineFixedDouble(result, d2); | 1272 return DefineFixedDouble(result, d2); |
| 1264 } | 1273 } |
| 1265 | 1274 |
| 1266 | 1275 |
| 1267 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { | 1276 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { |
| 1268 ASSERT(instr->key()->representation().IsTagged()); | 1277 ASSERT(instr->key()->representation().IsTagged()); |
| 1278 LOperand* context = UseFixed(instr->context(), cp); |
| 1269 argument_count_ -= instr->argument_count(); | 1279 argument_count_ -= instr->argument_count(); |
| 1270 LOperand* key = UseFixed(instr->key(), r2); | 1280 LOperand* key = UseFixed(instr->key(), r2); |
| 1271 return MarkAsCall(DefineFixed(new(zone()) LCallKeyed(key), r0), instr); | 1281 return MarkAsCall( |
| 1282 DefineFixed(new(zone()) LCallKeyed(context, key), r0), instr); |
| 1272 } | 1283 } |
| 1273 | 1284 |
| 1274 | 1285 |
| 1275 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { | 1286 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { |
| 1287 LOperand* context = UseFixed(instr->context(), cp); |
| 1276 argument_count_ -= instr->argument_count(); | 1288 argument_count_ -= instr->argument_count(); |
| 1277 return MarkAsCall(DefineFixed(new(zone()) LCallNamed, r0), instr); | 1289 return MarkAsCall(DefineFixed(new(zone()) LCallNamed(context), r0), instr); |
| 1278 } | 1290 } |
| 1279 | 1291 |
| 1280 | 1292 |
| 1281 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) { | 1293 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) { |
| 1294 LOperand* context = UseFixed(instr->context(), cp); |
| 1282 argument_count_ -= instr->argument_count(); | 1295 argument_count_ -= instr->argument_count(); |
| 1283 return MarkAsCall(DefineFixed(new(zone()) LCallGlobal, r0), instr); | 1296 return MarkAsCall(DefineFixed(new(zone()) LCallGlobal(context), r0), instr); |
| 1284 } | 1297 } |
| 1285 | 1298 |
| 1286 | 1299 |
| 1287 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) { | 1300 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) { |
| 1288 argument_count_ -= instr->argument_count(); | 1301 argument_count_ -= instr->argument_count(); |
| 1289 return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, r0), instr); | 1302 return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, r0), instr); |
| 1290 } | 1303 } |
| 1291 | 1304 |
| 1292 | 1305 |
| 1293 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { | 1306 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { |
| 1307 LOperand* context = UseFixed(instr->context(), cp); |
| 1294 LOperand* constructor = UseFixed(instr->constructor(), r1); | 1308 LOperand* constructor = UseFixed(instr->constructor(), r1); |
| 1295 argument_count_ -= instr->argument_count(); | 1309 argument_count_ -= instr->argument_count(); |
| 1296 LCallNew* result = new(zone()) LCallNew(constructor); | 1310 LCallNew* result = new(zone()) LCallNew(context, constructor); |
| 1297 return MarkAsCall(DefineFixed(result, r0), instr); | 1311 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1298 } | 1312 } |
| 1299 | 1313 |
| 1300 | 1314 |
| 1301 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { | 1315 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { |
| 1316 LOperand* context = UseFixed(instr->context(), cp); |
| 1302 LOperand* constructor = UseFixed(instr->constructor(), r1); | 1317 LOperand* constructor = UseFixed(instr->constructor(), r1); |
| 1303 argument_count_ -= instr->argument_count(); | 1318 argument_count_ -= instr->argument_count(); |
| 1304 LCallNewArray* result = new(zone()) LCallNewArray(constructor); | 1319 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); |
| 1305 return MarkAsCall(DefineFixed(result, r0), instr); | 1320 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1306 } | 1321 } |
| 1307 | 1322 |
| 1308 | 1323 |
| 1309 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1324 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| 1325 LOperand* context = UseFixed(instr->context(), cp); |
| 1310 LOperand* function = UseFixed(instr->function(), r1); | 1326 LOperand* function = UseFixed(instr->function(), r1); |
| 1311 argument_count_ -= instr->argument_count(); | 1327 argument_count_ -= instr->argument_count(); |
| 1312 return MarkAsCall(DefineFixed(new(zone()) LCallFunction(function), r0), | 1328 return MarkAsCall( |
| 1313 instr); | 1329 DefineFixed(new(zone()) LCallFunction(context, function), r0), instr); |
| 1314 } | 1330 } |
| 1315 | 1331 |
| 1316 | 1332 |
| 1317 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1333 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| 1318 argument_count_ -= instr->argument_count(); | 1334 argument_count_ -= instr->argument_count(); |
| 1319 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime, r0), instr); | 1335 LOperand* context = UseFixed(instr->context(), cp); |
| 1336 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r0), instr); |
| 1320 } | 1337 } |
| 1321 | 1338 |
| 1322 | 1339 |
| 1323 LInstruction* LChunkBuilder::DoRor(HRor* instr) { | 1340 LInstruction* LChunkBuilder::DoRor(HRor* instr) { |
| 1324 return DoShift(Token::ROR, instr); | 1341 return DoShift(Token::ROR, instr); |
| 1325 } | 1342 } |
| 1326 | 1343 |
| 1327 | 1344 |
| 1328 LInstruction* LChunkBuilder::DoShr(HShr* instr) { | 1345 LInstruction* LChunkBuilder::DoShr(HShr* instr) { |
| 1329 return DoShift(Token::SHR, instr); | 1346 return DoShift(Token::SHR, instr); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 LOperand* scratch3 = TempRegister(); | 1729 LOperand* scratch3 = TempRegister(); |
| 1713 LRandom* result = new(zone()) LRandom( | 1730 LRandom* result = new(zone()) LRandom( |
| 1714 global_object, scratch, scratch2, scratch3); | 1731 global_object, scratch, scratch2, scratch3); |
| 1715 return DefineFixedDouble(result, d7); | 1732 return DefineFixedDouble(result, d7); |
| 1716 } | 1733 } |
| 1717 | 1734 |
| 1718 | 1735 |
| 1719 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1736 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
| 1720 ASSERT(instr->left()->representation().IsTagged()); | 1737 ASSERT(instr->left()->representation().IsTagged()); |
| 1721 ASSERT(instr->right()->representation().IsTagged()); | 1738 ASSERT(instr->right()->representation().IsTagged()); |
| 1739 LOperand* context = UseFixed(instr->context(), cp); |
| 1722 LOperand* left = UseFixed(instr->left(), r1); | 1740 LOperand* left = UseFixed(instr->left(), r1); |
| 1723 LOperand* right = UseFixed(instr->right(), r0); | 1741 LOperand* right = UseFixed(instr->right(), r0); |
| 1724 LCmpT* result = new(zone()) LCmpT(left, right); | 1742 LCmpT* result = new(zone()) LCmpT(context, left, right); |
| 1725 return MarkAsCall(DefineFixed(result, r0), instr); | 1743 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1726 } | 1744 } |
| 1727 | 1745 |
| 1728 | 1746 |
| 1729 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( | 1747 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( |
| 1730 HCompareNumericAndBranch* instr) { | 1748 HCompareNumericAndBranch* instr) { |
| 1731 Representation r = instr->representation(); | 1749 Representation r = instr->representation(); |
| 1732 if (r.IsSmiOrInteger32()) { | 1750 if (r.IsSmiOrInteger32()) { |
| 1733 ASSERT(instr->left()->representation().Equals(r)); | 1751 ASSERT(instr->left()->representation().Equals(r)); |
| 1734 ASSERT(instr->right()->representation().Equals(r)); | 1752 ASSERT(instr->right()->representation().Equals(r)); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1788 ASSERT(instr->value()->representation().IsTagged()); | 1806 ASSERT(instr->value()->representation().IsTagged()); |
| 1789 LOperand* value = UseRegisterAtStart(instr->value()); | 1807 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1790 return new(zone()) LIsUndetectableAndBranch(value, TempRegister()); | 1808 return new(zone()) LIsUndetectableAndBranch(value, TempRegister()); |
| 1791 } | 1809 } |
| 1792 | 1810 |
| 1793 | 1811 |
| 1794 LInstruction* LChunkBuilder::DoStringCompareAndBranch( | 1812 LInstruction* LChunkBuilder::DoStringCompareAndBranch( |
| 1795 HStringCompareAndBranch* instr) { | 1813 HStringCompareAndBranch* instr) { |
| 1796 ASSERT(instr->left()->representation().IsTagged()); | 1814 ASSERT(instr->left()->representation().IsTagged()); |
| 1797 ASSERT(instr->right()->representation().IsTagged()); | 1815 ASSERT(instr->right()->representation().IsTagged()); |
| 1816 LOperand* context = UseFixed(instr->context(), cp); |
| 1798 LOperand* left = UseFixed(instr->left(), r1); | 1817 LOperand* left = UseFixed(instr->left(), r1); |
| 1799 LOperand* right = UseFixed(instr->right(), r0); | 1818 LOperand* right = UseFixed(instr->right(), r0); |
| 1800 LStringCompareAndBranch* result = | 1819 LStringCompareAndBranch* result = |
| 1801 new(zone()) LStringCompareAndBranch(left, right); | 1820 new(zone()) LStringCompareAndBranch(context, left, right); |
| 1802 return MarkAsCall(result, instr); | 1821 return MarkAsCall(result, instr); |
| 1803 } | 1822 } |
| 1804 | 1823 |
| 1805 | 1824 |
| 1806 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( | 1825 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( |
| 1807 HHasInstanceTypeAndBranch* instr) { | 1826 HHasInstanceTypeAndBranch* instr) { |
| 1808 ASSERT(instr->value()->representation().IsTagged()); | 1827 ASSERT(instr->value()->representation().IsTagged()); |
| 1809 LOperand* value = UseRegisterAtStart(instr->value()); | 1828 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1810 return new(zone()) LHasInstanceTypeAndBranch(value); | 1829 return new(zone()) LHasInstanceTypeAndBranch(value); |
| 1811 } | 1830 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 } | 1897 } |
| 1879 | 1898 |
| 1880 | 1899 |
| 1881 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation( | 1900 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation( |
| 1882 HBoundsCheckBaseIndexInformation* instr) { | 1901 HBoundsCheckBaseIndexInformation* instr) { |
| 1883 UNREACHABLE(); | 1902 UNREACHABLE(); |
| 1884 return NULL; | 1903 return NULL; |
| 1885 } | 1904 } |
| 1886 | 1905 |
| 1887 | 1906 |
| 1907 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) { |
| 1908 // The control instruction marking the end of a block that completed |
| 1909 // abruptly (e.g., threw an exception). There is nothing specific to do. |
| 1910 return NULL; |
| 1911 } |
| 1912 |
| 1913 |
| 1888 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { | 1914 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { |
| 1915 LOperand* context = UseFixed(instr->context(), cp); |
| 1889 LOperand* value = UseFixed(instr->value(), r0); | 1916 LOperand* value = UseFixed(instr->value(), r0); |
| 1890 return MarkAsCall(new(zone()) LThrow(value), instr); | 1917 return MarkAsCall(new(zone()) LThrow(context, value), instr); |
| 1891 } | 1918 } |
| 1892 | 1919 |
| 1893 | 1920 |
| 1894 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) { | 1921 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) { |
| 1895 return NULL; | 1922 return NULL; |
| 1896 } | 1923 } |
| 1897 | 1924 |
| 1898 | 1925 |
| 1899 LInstruction* LChunkBuilder::DoForceRepresentation(HForceRepresentation* bad) { | 1926 LInstruction* LChunkBuilder::DoForceRepresentation(HForceRepresentation* bad) { |
| 1900 // All HForceRepresentation instructions should be eliminated in the | 1927 // All HForceRepresentation instructions should be eliminated in the |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2060 ASSERT(input_rep.IsSmiOrTagged()); | 2087 ASSERT(input_rep.IsSmiOrTagged()); |
| 2061 // Register allocator doesn't (yet) support allocation of double | 2088 // Register allocator doesn't (yet) support allocation of double |
| 2062 // temps. Reserve d1 explicitly. | 2089 // temps. Reserve d1 explicitly. |
| 2063 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, FixedTemp(d11)); | 2090 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, FixedTemp(d11)); |
| 2064 return AssignEnvironment(DefineAsRegister(result)); | 2091 return AssignEnvironment(DefineAsRegister(result)); |
| 2065 } | 2092 } |
| 2066 } | 2093 } |
| 2067 | 2094 |
| 2068 | 2095 |
| 2069 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 2096 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
| 2097 LOperand* context = info()->IsStub() |
| 2098 ? UseFixed(instr->context(), cp) |
| 2099 : NULL; |
| 2070 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); | 2100 LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count()); |
| 2071 return new(zone()) LReturn(UseFixed(instr->value(), r0), | 2101 return new(zone()) LReturn(UseFixed(instr->value(), r0), context, |
| 2072 parameter_count); | 2102 parameter_count); |
| 2073 } | 2103 } |
| 2074 | 2104 |
| 2075 | 2105 |
| 2076 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 2106 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
| 2077 Representation r = instr->representation(); | 2107 Representation r = instr->representation(); |
| 2078 if (r.IsSmi()) { | 2108 if (r.IsSmi()) { |
| 2079 return DefineAsRegister(new(zone()) LConstantS); | 2109 return DefineAsRegister(new(zone()) LConstantS); |
| 2080 } else if (r.IsInteger32()) { | 2110 } else if (r.IsInteger32()) { |
| 2081 return DefineAsRegister(new(zone()) LConstantI); | 2111 return DefineAsRegister(new(zone()) LConstantI); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2094 | 2124 |
| 2095 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { | 2125 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { |
| 2096 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; | 2126 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; |
| 2097 return instr->RequiresHoleCheck() | 2127 return instr->RequiresHoleCheck() |
| 2098 ? AssignEnvironment(DefineAsRegister(result)) | 2128 ? AssignEnvironment(DefineAsRegister(result)) |
| 2099 : DefineAsRegister(result); | 2129 : DefineAsRegister(result); |
| 2100 } | 2130 } |
| 2101 | 2131 |
| 2102 | 2132 |
| 2103 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 2133 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
| 2134 LOperand* context = UseFixed(instr->context(), cp); |
| 2104 LOperand* global_object = UseFixed(instr->global_object(), r0); | 2135 LOperand* global_object = UseFixed(instr->global_object(), r0); |
| 2105 LLoadGlobalGeneric* result = new(zone()) LLoadGlobalGeneric(global_object); | 2136 LLoadGlobalGeneric* result = |
| 2137 new(zone()) LLoadGlobalGeneric(context, global_object); |
| 2106 return MarkAsCall(DefineFixed(result, r0), instr); | 2138 return MarkAsCall(DefineFixed(result, r0), instr); |
| 2107 } | 2139 } |
| 2108 | 2140 |
| 2109 | 2141 |
| 2110 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | 2142 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
| 2111 LOperand* value = UseRegister(instr->value()); | 2143 LOperand* value = UseRegister(instr->value()); |
| 2112 // Use a temp to check the value in the cell in the case where we perform | 2144 // Use a temp to check the value in the cell in the case where we perform |
| 2113 // a hole check. | 2145 // a hole check. |
| 2114 return instr->RequiresHoleCheck() | 2146 return instr->RequiresHoleCheck() |
| 2115 ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) | 2147 ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) |
| 2116 : new(zone()) LStoreGlobalCell(value, NULL); | 2148 : new(zone()) LStoreGlobalCell(value, NULL); |
| 2117 } | 2149 } |
| 2118 | 2150 |
| 2119 | 2151 |
| 2120 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { | 2152 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { |
| 2153 LOperand* context = UseFixed(instr->context(), cp); |
| 2121 LOperand* global_object = UseFixed(instr->global_object(), r1); | 2154 LOperand* global_object = UseFixed(instr->global_object(), r1); |
| 2122 LOperand* value = UseFixed(instr->value(), r0); | 2155 LOperand* value = UseFixed(instr->value(), r0); |
| 2123 LStoreGlobalGeneric* result = | 2156 LStoreGlobalGeneric* result = |
| 2124 new(zone()) LStoreGlobalGeneric(global_object, value); | 2157 new(zone()) LStoreGlobalGeneric(context, global_object, value); |
| 2125 return MarkAsCall(result, instr); | 2158 return MarkAsCall(result, instr); |
| 2126 } | 2159 } |
| 2127 | 2160 |
| 2128 | 2161 |
| 2129 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2162 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 2130 LOperand* context = UseRegisterAtStart(instr->value()); | 2163 LOperand* context = UseRegisterAtStart(instr->value()); |
| 2131 LInstruction* result = | 2164 LInstruction* result = |
| 2132 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | 2165 DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
| 2133 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; | 2166 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; |
| 2134 } | 2167 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2149 } | 2182 } |
| 2150 | 2183 |
| 2151 | 2184 |
| 2152 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 2185 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
| 2153 LOperand* obj = UseRegisterAtStart(instr->object()); | 2186 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 2154 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); | 2187 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
| 2155 } | 2188 } |
| 2156 | 2189 |
| 2157 | 2190 |
| 2158 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 2191 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
| 2192 LOperand* context = UseFixed(instr->context(), cp); |
| 2159 LOperand* object = UseFixed(instr->object(), r0); | 2193 LOperand* object = UseFixed(instr->object(), r0); |
| 2160 LInstruction* result = DefineFixed(new(zone()) LLoadNamedGeneric(object), r0); | 2194 LInstruction* result = |
| 2195 DefineFixed(new(zone()) LLoadNamedGeneric(context, object), r0); |
| 2161 return MarkAsCall(result, instr); | 2196 return MarkAsCall(result, instr); |
| 2162 } | 2197 } |
| 2163 | 2198 |
| 2164 | 2199 |
| 2165 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 2200 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
| 2166 HLoadFunctionPrototype* instr) { | 2201 HLoadFunctionPrototype* instr) { |
| 2167 return AssignEnvironment(DefineAsRegister( | 2202 return AssignEnvironment(DefineAsRegister( |
| 2168 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); | 2203 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); |
| 2169 } | 2204 } |
| 2170 | 2205 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 DefineAsRegister(result); | 2246 DefineAsRegister(result); |
| 2212 // An unsigned int array load might overflow and cause a deopt, make sure it | 2247 // An unsigned int array load might overflow and cause a deopt, make sure it |
| 2213 // has an environment. | 2248 // has an environment. |
| 2214 bool can_deoptimize = instr->RequiresHoleCheck() || | 2249 bool can_deoptimize = instr->RequiresHoleCheck() || |
| 2215 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); | 2250 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); |
| 2216 return can_deoptimize ? AssignEnvironment(result) : result; | 2251 return can_deoptimize ? AssignEnvironment(result) : result; |
| 2217 } | 2252 } |
| 2218 | 2253 |
| 2219 | 2254 |
| 2220 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2255 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| 2256 LOperand* context = UseFixed(instr->context(), cp); |
| 2221 LOperand* object = UseFixed(instr->object(), r1); | 2257 LOperand* object = UseFixed(instr->object(), r1); |
| 2222 LOperand* key = UseFixed(instr->key(), r0); | 2258 LOperand* key = UseFixed(instr->key(), r0); |
| 2223 | 2259 |
| 2224 LInstruction* result = | 2260 LInstruction* result = |
| 2225 DefineFixed(new(zone()) LLoadKeyedGeneric(object, key), r0); | 2261 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key), r0); |
| 2226 return MarkAsCall(result, instr); | 2262 return MarkAsCall(result, instr); |
| 2227 } | 2263 } |
| 2228 | 2264 |
| 2229 | 2265 |
| 2230 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2266 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
| 2231 if (!instr->is_external()) { | 2267 if (!instr->is_external()) { |
| 2232 ASSERT(instr->elements()->representation().IsTagged()); | 2268 ASSERT(instr->elements()->representation().IsTagged()); |
| 2233 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2269 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| 2234 LOperand* object = NULL; | 2270 LOperand* object = NULL; |
| 2235 LOperand* key = NULL; | 2271 LOperand* key = NULL; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2264 (instr->elements_kind() == EXTERNAL_DOUBLE_ELEMENTS)))); | 2300 (instr->elements_kind() == EXTERNAL_DOUBLE_ELEMENTS)))); |
| 2265 ASSERT(instr->elements()->representation().IsExternal()); | 2301 ASSERT(instr->elements()->representation().IsExternal()); |
| 2266 LOperand* val = UseRegister(instr->value()); | 2302 LOperand* val = UseRegister(instr->value()); |
| 2267 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2303 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 2268 LOperand* external_pointer = UseRegister(instr->elements()); | 2304 LOperand* external_pointer = UseRegister(instr->elements()); |
| 2269 return new(zone()) LStoreKeyed(external_pointer, key, val); | 2305 return new(zone()) LStoreKeyed(external_pointer, key, val); |
| 2270 } | 2306 } |
| 2271 | 2307 |
| 2272 | 2308 |
| 2273 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2309 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| 2310 LOperand* context = UseFixed(instr->context(), cp); |
| 2274 LOperand* obj = UseFixed(instr->object(), r2); | 2311 LOperand* obj = UseFixed(instr->object(), r2); |
| 2275 LOperand* key = UseFixed(instr->key(), r1); | 2312 LOperand* key = UseFixed(instr->key(), r1); |
| 2276 LOperand* val = UseFixed(instr->value(), r0); | 2313 LOperand* val = UseFixed(instr->value(), r0); |
| 2277 | 2314 |
| 2278 ASSERT(instr->object()->representation().IsTagged()); | 2315 ASSERT(instr->object()->representation().IsTagged()); |
| 2279 ASSERT(instr->key()->representation().IsTagged()); | 2316 ASSERT(instr->key()->representation().IsTagged()); |
| 2280 ASSERT(instr->value()->representation().IsTagged()); | 2317 ASSERT(instr->value()->representation().IsTagged()); |
| 2281 | 2318 |
| 2282 return MarkAsCall(new(zone()) LStoreKeyedGeneric(obj, key, val), instr); | 2319 return MarkAsCall( |
| 2320 new(zone()) LStoreKeyedGeneric(context, obj, key, val), instr); |
| 2283 } | 2321 } |
| 2284 | 2322 |
| 2285 | 2323 |
| 2286 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2324 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
| 2287 HTransitionElementsKind* instr) { | 2325 HTransitionElementsKind* instr) { |
| 2288 LOperand* object = UseRegister(instr->object()); | 2326 LOperand* object = UseRegister(instr->object()); |
| 2289 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2327 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
| 2290 LOperand* new_map_reg = TempRegister(); | 2328 LOperand* new_map_reg = TempRegister(); |
| 2291 LTransitionElementsKind* result = | 2329 LTransitionElementsKind* result = |
| 2292 new(zone()) LTransitionElementsKind(object, new_map_reg); | 2330 new(zone()) LTransitionElementsKind(object, NULL, new_map_reg); |
| 2293 return result; | 2331 return result; |
| 2294 } else { | 2332 } else { |
| 2333 LOperand* context = UseFixed(instr->context(), cp); |
| 2295 LTransitionElementsKind* result = | 2334 LTransitionElementsKind* result = |
| 2296 new(zone()) LTransitionElementsKind(object, NULL); | 2335 new(zone()) LTransitionElementsKind(object, context, NULL); |
| 2297 return AssignPointerMap(result); | 2336 return AssignPointerMap(result); |
| 2298 } | 2337 } |
| 2299 } | 2338 } |
| 2300 | 2339 |
| 2301 | 2340 |
| 2302 LInstruction* LChunkBuilder::DoTrapAllocationMemento( | 2341 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
| 2303 HTrapAllocationMemento* instr) { | 2342 HTrapAllocationMemento* instr) { |
| 2304 LOperand* object = UseRegister(instr->object()); | 2343 LOperand* object = UseRegister(instr->object()); |
| 2305 LOperand* temp = TempRegister(); | 2344 LOperand* temp = TempRegister(); |
| 2306 LTrapAllocationMemento* result = | 2345 LTrapAllocationMemento* result = |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 instr->field_representation().IsHeapObject()) { | 2384 instr->field_representation().IsHeapObject()) { |
| 2346 if (!instr->value()->type().IsHeapObject()) { | 2385 if (!instr->value()->type().IsHeapObject()) { |
| 2347 return AssignEnvironment(result); | 2386 return AssignEnvironment(result); |
| 2348 } | 2387 } |
| 2349 } | 2388 } |
| 2350 return result; | 2389 return result; |
| 2351 } | 2390 } |
| 2352 | 2391 |
| 2353 | 2392 |
| 2354 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2393 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
| 2394 LOperand* context = UseFixed(instr->context(), cp); |
| 2355 LOperand* obj = UseFixed(instr->object(), r1); | 2395 LOperand* obj = UseFixed(instr->object(), r1); |
| 2356 LOperand* val = UseFixed(instr->value(), r0); | 2396 LOperand* val = UseFixed(instr->value(), r0); |
| 2357 | 2397 |
| 2358 LInstruction* result = new(zone()) LStoreNamedGeneric(obj, val); | 2398 LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val); |
| 2359 return MarkAsCall(result, instr); | 2399 return MarkAsCall(result, instr); |
| 2360 } | 2400 } |
| 2361 | 2401 |
| 2362 | 2402 |
| 2363 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2403 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
| 2404 LOperand* context = UseFixed(instr->context(), cp); |
| 2364 LOperand* left = UseRegisterAtStart(instr->left()); | 2405 LOperand* left = UseRegisterAtStart(instr->left()); |
| 2365 LOperand* right = UseRegisterAtStart(instr->right()); | 2406 LOperand* right = UseRegisterAtStart(instr->right()); |
| 2366 return MarkAsCall(DefineFixed(new(zone()) LStringAdd(left, right), r0), | 2407 return MarkAsCall( |
| 2367 instr); | 2408 DefineFixed(new(zone()) LStringAdd(context, left, right), r0), |
| 2409 instr); |
| 2368 } | 2410 } |
| 2369 | 2411 |
| 2370 | 2412 |
| 2371 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2413 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
| 2372 LOperand* string = UseTempRegister(instr->string()); | 2414 LOperand* string = UseTempRegister(instr->string()); |
| 2373 LOperand* index = UseTempRegister(instr->index()); | 2415 LOperand* index = UseTempRegister(instr->index()); |
| 2374 LStringCharCodeAt* result = new(zone()) LStringCharCodeAt(string, index); | 2416 LOperand* context = UseAny(instr->context()); |
| 2417 LStringCharCodeAt* result = |
| 2418 new(zone()) LStringCharCodeAt(context, string, index); |
| 2375 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 2419 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 2376 } | 2420 } |
| 2377 | 2421 |
| 2378 | 2422 |
| 2379 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { | 2423 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { |
| 2380 LOperand* char_code = UseRegister(instr->value()); | 2424 LOperand* char_code = UseRegister(instr->value()); |
| 2381 LStringCharFromCode* result = new(zone()) LStringCharFromCode(char_code); | 2425 LOperand* context = UseAny(instr->context()); |
| 2426 LStringCharFromCode* result = |
| 2427 new(zone()) LStringCharFromCode(context, char_code); |
| 2382 return AssignPointerMap(DefineAsRegister(result)); | 2428 return AssignPointerMap(DefineAsRegister(result)); |
| 2383 } | 2429 } |
| 2384 | 2430 |
| 2385 | 2431 |
| 2386 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { | 2432 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
| 2387 info()->MarkAsDeferredCalling(); | 2433 info()->MarkAsDeferredCalling(); |
| 2434 LOperand* context = UseAny(instr->context()); |
| 2388 LOperand* size = instr->size()->IsConstant() | 2435 LOperand* size = instr->size()->IsConstant() |
| 2389 ? UseConstant(instr->size()) | 2436 ? UseConstant(instr->size()) |
| 2390 : UseTempRegister(instr->size()); | 2437 : UseTempRegister(instr->size()); |
| 2391 LOperand* temp1 = TempRegister(); | 2438 LOperand* temp1 = TempRegister(); |
| 2392 LOperand* temp2 = TempRegister(); | 2439 LOperand* temp2 = TempRegister(); |
| 2393 LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); | 2440 LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2); |
| 2394 return AssignPointerMap(DefineAsRegister(result)); | 2441 return AssignPointerMap(DefineAsRegister(result)); |
| 2395 } | 2442 } |
| 2396 | 2443 |
| 2397 | 2444 |
| 2398 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { | 2445 LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { |
| 2399 return MarkAsCall(DefineFixed(new(zone()) LRegExpLiteral, r0), instr); | 2446 LOperand* context = UseFixed(instr->context(), cp); |
| 2447 return MarkAsCall( |
| 2448 DefineFixed(new(zone()) LRegExpLiteral(context), r0), instr); |
| 2400 } | 2449 } |
| 2401 | 2450 |
| 2402 | 2451 |
| 2403 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { | 2452 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { |
| 2404 return MarkAsCall(DefineFixed(new(zone()) LFunctionLiteral, r0), instr); | 2453 LOperand* context = UseFixed(instr->context(), cp); |
| 2454 return MarkAsCall( |
| 2455 DefineFixed(new(zone()) LFunctionLiteral(context), r0), instr); |
| 2405 } | 2456 } |
| 2406 | 2457 |
| 2407 | 2458 |
| 2408 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { | 2459 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { |
| 2409 ASSERT(argument_count_ == 0); | 2460 ASSERT(argument_count_ == 0); |
| 2410 allocator_->MarkAsOsrEntry(); | 2461 allocator_->MarkAsOsrEntry(); |
| 2411 current_block_->last_environment()->set_ast_id(instr->ast_id()); | 2462 current_block_->last_environment()->set_ast_id(instr->ast_id()); |
| 2412 return AssignEnvironment(new(zone()) LOsrEntry); | 2463 return AssignEnvironment(new(zone()) LOsrEntry); |
| 2413 } | 2464 } |
| 2414 | 2465 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2441 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2492 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
| 2442 Abort(kTooManySpillSlotsNeededForOSR); | 2493 Abort(kTooManySpillSlotsNeededForOSR); |
| 2443 spill_index = 0; | 2494 spill_index = 0; |
| 2444 } | 2495 } |
| 2445 } | 2496 } |
| 2446 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2497 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
| 2447 } | 2498 } |
| 2448 | 2499 |
| 2449 | 2500 |
| 2450 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2501 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
| 2502 LOperand* context = UseFixed(instr->context(), cp); |
| 2451 argument_count_ -= instr->argument_count(); | 2503 argument_count_ -= instr->argument_count(); |
| 2452 return MarkAsCall(DefineFixed(new(zone()) LCallStub, r0), instr); | 2504 return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r0), instr); |
| 2453 } | 2505 } |
| 2454 | 2506 |
| 2455 | 2507 |
| 2456 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 2508 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
| 2457 // There are no real uses of the arguments object. | 2509 // There are no real uses of the arguments object. |
| 2458 // arguments.length and element access are supported directly on | 2510 // arguments.length and element access are supported directly on |
| 2459 // stack arguments, and any real arguments object use causes a bailout. | 2511 // stack arguments, and any real arguments object use causes a bailout. |
| 2460 // So this value is never used. | 2512 // So this value is never used. |
| 2461 return NULL; | 2513 return NULL; |
| 2462 } | 2514 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2487 | 2539 |
| 2488 | 2540 |
| 2489 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { | 2541 LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |
| 2490 LOperand* object = UseFixed(instr->value(), r0); | 2542 LOperand* object = UseFixed(instr->value(), r0); |
| 2491 LToFastProperties* result = new(zone()) LToFastProperties(object); | 2543 LToFastProperties* result = new(zone()) LToFastProperties(object); |
| 2492 return MarkAsCall(DefineFixed(result, r0), instr); | 2544 return MarkAsCall(DefineFixed(result, r0), instr); |
| 2493 } | 2545 } |
| 2494 | 2546 |
| 2495 | 2547 |
| 2496 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { | 2548 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { |
| 2497 LTypeof* result = new(zone()) LTypeof(UseFixed(instr->value(), r0)); | 2549 LOperand* context = UseFixed(instr->context(), cp); |
| 2550 LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), r0)); |
| 2498 return MarkAsCall(DefineFixed(result, r0), instr); | 2551 return MarkAsCall(DefineFixed(result, r0), instr); |
| 2499 } | 2552 } |
| 2500 | 2553 |
| 2501 | 2554 |
| 2502 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { | 2555 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { |
| 2503 return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value())); | 2556 return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value())); |
| 2504 } | 2557 } |
| 2505 | 2558 |
| 2506 | 2559 |
| 2507 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( | 2560 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2526 pending_deoptimization_ast_id_ = BailoutId::None(); | 2579 pending_deoptimization_ast_id_ = BailoutId::None(); |
| 2527 return result; | 2580 return result; |
| 2528 } | 2581 } |
| 2529 | 2582 |
| 2530 return NULL; | 2583 return NULL; |
| 2531 } | 2584 } |
| 2532 | 2585 |
| 2533 | 2586 |
| 2534 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { | 2587 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { |
| 2535 if (instr->is_function_entry()) { | 2588 if (instr->is_function_entry()) { |
| 2536 return MarkAsCall(new(zone()) LStackCheck, instr); | 2589 LOperand* context = UseFixed(instr->context(), cp); |
| 2590 return MarkAsCall(new(zone()) LStackCheck(context), instr); |
| 2537 } else { | 2591 } else { |
| 2538 ASSERT(instr->is_backwards_branch()); | 2592 ASSERT(instr->is_backwards_branch()); |
| 2539 return AssignEnvironment(AssignPointerMap(new(zone()) LStackCheck)); | 2593 LOperand* context = UseAny(instr->context()); |
| 2594 return AssignEnvironment( |
| 2595 AssignPointerMap(new(zone()) LStackCheck(context))); |
| 2540 } | 2596 } |
| 2541 } | 2597 } |
| 2542 | 2598 |
| 2543 | 2599 |
| 2544 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2600 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2545 HEnvironment* outer = current_block_->last_environment(); | 2601 HEnvironment* outer = current_block_->last_environment(); |
| 2546 HConstant* undefined = graph()->GetConstantUndefined(); | 2602 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2547 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2603 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2548 instr->arguments_count(), | 2604 instr->arguments_count(), |
| 2549 instr->function(), | 2605 instr->function(), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2574 | 2630 |
| 2575 HEnvironment* outer = current_block_->last_environment()-> | 2631 HEnvironment* outer = current_block_->last_environment()-> |
| 2576 DiscardInlined(false); | 2632 DiscardInlined(false); |
| 2577 current_block_->UpdateEnvironment(outer); | 2633 current_block_->UpdateEnvironment(outer); |
| 2578 | 2634 |
| 2579 return pop; | 2635 return pop; |
| 2580 } | 2636 } |
| 2581 | 2637 |
| 2582 | 2638 |
| 2583 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { | 2639 LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { |
| 2640 LOperand* context = UseFixed(instr->context(), cp); |
| 2584 LOperand* object = UseFixed(instr->enumerable(), r0); | 2641 LOperand* object = UseFixed(instr->enumerable(), r0); |
| 2585 LForInPrepareMap* result = new(zone()) LForInPrepareMap(object); | 2642 LForInPrepareMap* result = new(zone()) LForInPrepareMap(context, object); |
| 2586 return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); | 2643 return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY); |
| 2587 } | 2644 } |
| 2588 | 2645 |
| 2589 | 2646 |
| 2590 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { | 2647 LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) { |
| 2591 LOperand* map = UseRegister(instr->map()); | 2648 LOperand* map = UseRegister(instr->map()); |
| 2592 return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map))); | 2649 return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map))); |
| 2593 } | 2650 } |
| 2594 | 2651 |
| 2595 | 2652 |
| 2596 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { | 2653 LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) { |
| 2597 LOperand* value = UseRegisterAtStart(instr->value()); | 2654 LOperand* value = UseRegisterAtStart(instr->value()); |
| 2598 LOperand* map = UseRegisterAtStart(instr->map()); | 2655 LOperand* map = UseRegisterAtStart(instr->map()); |
| 2599 return AssignEnvironment(new(zone()) LCheckMapValue(value, map)); | 2656 return AssignEnvironment(new(zone()) LCheckMapValue(value, map)); |
| 2600 } | 2657 } |
| 2601 | 2658 |
| 2602 | 2659 |
| 2603 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2660 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2604 LOperand* object = UseRegister(instr->object()); | 2661 LOperand* object = UseRegister(instr->object()); |
| 2605 LOperand* index = UseRegister(instr->index()); | 2662 LOperand* index = UseRegister(instr->index()); |
| 2606 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2663 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2607 } | 2664 } |
| 2608 | 2665 |
| 2609 | 2666 |
| 2610 } } // namespace v8::internal | 2667 } } // namespace v8::internal |
| OLD | NEW |