| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 LInstruction* LChunkBuilder::DefineAsRegister(LInstruction* instr) { | 760 LInstruction* LChunkBuilder::DefineAsRegister(LInstruction* instr) { |
| 761 return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER)); | 761 return Define(instr, new LUnallocated(LUnallocated::MUST_HAVE_REGISTER)); |
| 762 } | 762 } |
| 763 | 763 |
| 764 | 764 |
| 765 LInstruction* LChunkBuilder::DefineAsSpilled(LInstruction* instr, int index) { | 765 LInstruction* LChunkBuilder::DefineAsSpilled(LInstruction* instr, int index) { |
| 766 return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index)); | 766 return Define(instr, new LUnallocated(LUnallocated::FIXED_SLOT, index)); |
| 767 } | 767 } |
| 768 | 768 |
| 769 | 769 |
| 770 LInstruction* LChunkBuilder::DefineSameAsAny(LInstruction* instr) { | |
| 771 return Define(instr, new LUnallocated(LUnallocated::SAME_AS_ANY_INPUT)); | |
| 772 } | |
| 773 | |
| 774 | |
| 775 LInstruction* LChunkBuilder::DefineSameAsFirst(LInstruction* instr) { | 770 LInstruction* LChunkBuilder::DefineSameAsFirst(LInstruction* instr) { |
| 776 return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT)); | 771 return Define(instr, new LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT)); |
| 777 } | 772 } |
| 778 | 773 |
| 779 | 774 |
| 780 LInstruction* LChunkBuilder::DefineFixed(LInstruction* instr, Register reg) { | 775 LInstruction* LChunkBuilder::DefineFixed(LInstruction* instr, Register reg) { |
| 781 return Define(instr, ToUnallocated(reg)); | 776 return Define(instr, ToUnallocated(reg)); |
| 782 } | 777 } |
| 783 | 778 |
| 784 | 779 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 last_environment->SetValueAt(block->deleted_phis()->at(i), | 1004 last_environment->SetValueAt(block->deleted_phis()->at(i), |
| 1010 graph_->GetConstantUndefined()); | 1005 graph_->GetConstantUndefined()); |
| 1011 } | 1006 } |
| 1012 block->UpdateEnvironment(last_environment); | 1007 block->UpdateEnvironment(last_environment); |
| 1013 // Pick up the outgoing argument count of one of the predecessors. | 1008 // Pick up the outgoing argument count of one of the predecessors. |
| 1014 argument_count_ = pred->argument_count(); | 1009 argument_count_ = pred->argument_count(); |
| 1015 } | 1010 } |
| 1016 HInstruction* current = block->first(); | 1011 HInstruction* current = block->first(); |
| 1017 int start = chunk_->instructions()->length(); | 1012 int start = chunk_->instructions()->length(); |
| 1018 while (current != NULL && !is_aborted()) { | 1013 while (current != NULL && !is_aborted()) { |
| 1019 if (FLAG_trace_environment) { | |
| 1020 PrintF("Process instruction %d\n", current->id()); | |
| 1021 } | |
| 1022 // Code for constants in registers is generated lazily. | 1014 // Code for constants in registers is generated lazily. |
| 1023 if (!current->EmitAtUses()) { | 1015 if (!current->EmitAtUses()) { |
| 1024 VisitInstruction(current); | 1016 VisitInstruction(current); |
| 1025 } | 1017 } |
| 1026 current = current->next(); | 1018 current = current->next(); |
| 1027 } | 1019 } |
| 1028 int end = chunk_->instructions()->length() - 1; | 1020 int end = chunk_->instructions()->length() - 1; |
| 1029 if (end >= start) { | 1021 if (end >= start) { |
| 1030 block->set_first_instruction_index(start); | 1022 block->set_first_instruction_index(start); |
| 1031 block->set_last_instruction_index(end); | 1023 block->set_last_instruction_index(end); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 stream->Add("]"); | 1110 stream->Add("]"); |
| 1119 } | 1111 } |
| 1120 | 1112 |
| 1121 | 1113 |
| 1122 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { | 1114 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { |
| 1123 if (hydrogen_env == NULL) return NULL; | 1115 if (hydrogen_env == NULL) return NULL; |
| 1124 | 1116 |
| 1125 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); | 1117 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); |
| 1126 int ast_id = hydrogen_env->ast_id(); | 1118 int ast_id = hydrogen_env->ast_id(); |
| 1127 ASSERT(ast_id != AstNode::kNoNumber); | 1119 ASSERT(ast_id != AstNode::kNoNumber); |
| 1128 int value_count = hydrogen_env->values()->length(); | 1120 int value_count = hydrogen_env->length(); |
| 1129 LEnvironment* result = new LEnvironment(hydrogen_env->closure(), | 1121 LEnvironment* result = new LEnvironment(hydrogen_env->closure(), |
| 1130 ast_id, | 1122 ast_id, |
| 1131 hydrogen_env->parameter_count(), | 1123 hydrogen_env->parameter_count(), |
| 1132 argument_count_, | 1124 argument_count_, |
| 1133 value_count, | 1125 value_count, |
| 1134 outer); | 1126 outer); |
| 1135 int argument_index = 0; | 1127 int argument_index = 0; |
| 1136 for (int i = 0; i < value_count; ++i) { | 1128 for (int i = 0; i < value_count; ++i) { |
| 1137 HValue* value = hydrogen_env->values()->at(i); | 1129 HValue* value = hydrogen_env->values()->at(i); |
| 1138 LOperand* op = NULL; | 1130 LOperand* op = NULL; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 ASSERT(compare->value()->representation().IsTagged()); | 1210 ASSERT(compare->value()->representation().IsTagged()); |
| 1219 | 1211 |
| 1220 return new LIsSmiAndBranch(Use(compare->value()), | 1212 return new LIsSmiAndBranch(Use(compare->value()), |
| 1221 first_id, | 1213 first_id, |
| 1222 second_id); | 1214 second_id); |
| 1223 } else if (v->IsHasInstanceType()) { | 1215 } else if (v->IsHasInstanceType()) { |
| 1224 HHasInstanceType* compare = HHasInstanceType::cast(v); | 1216 HHasInstanceType* compare = HHasInstanceType::cast(v); |
| 1225 ASSERT(compare->value()->representation().IsTagged()); | 1217 ASSERT(compare->value()->representation().IsTagged()); |
| 1226 | 1218 |
| 1227 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value()), | 1219 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value()), |
| 1228 TempRegister(), | |
| 1229 first_id, | 1220 first_id, |
| 1230 second_id); | 1221 second_id); |
| 1231 } else if (v->IsHasCachedArrayIndex()) { | 1222 } else if (v->IsHasCachedArrayIndex()) { |
| 1232 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); | 1223 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); |
| 1233 ASSERT(compare->value()->representation().IsTagged()); | 1224 ASSERT(compare->value()->representation().IsTagged()); |
| 1234 | 1225 |
| 1235 return new LHasCachedArrayIndexAndBranch( | 1226 return new LHasCachedArrayIndexAndBranch( |
| 1236 UseRegisterAtStart(compare->value()), first_id, second_id); | 1227 UseRegisterAtStart(compare->value()), first_id, second_id); |
| 1237 } else if (v->IsIsNull()) { | 1228 } else if (v->IsIsNull()) { |
| 1238 HIsNull* compare = HIsNull::cast(v); | 1229 HIsNull* compare = HIsNull::cast(v); |
| 1239 ASSERT(compare->value()->representation().IsTagged()); | 1230 ASSERT(compare->value()->representation().IsTagged()); |
| 1240 | 1231 |
| 1241 // We only need a temp register for non-strict compare. | |
| 1242 LOperand* temp = compare->is_strict() ? NULL : TempRegister(); | |
| 1243 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), | 1232 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), |
| 1244 compare->is_strict(), | 1233 compare->is_strict(), |
| 1245 temp, | |
| 1246 first_id, | 1234 first_id, |
| 1247 second_id); | 1235 second_id); |
| 1248 } else if (v->IsIsObject()) { | 1236 } else if (v->IsIsObject()) { |
| 1249 HIsObject* compare = HIsObject::cast(v); | 1237 HIsObject* compare = HIsObject::cast(v); |
| 1250 ASSERT(compare->value()->representation().IsTagged()); | 1238 ASSERT(compare->value()->representation().IsTagged()); |
| 1251 | 1239 |
| 1252 LOperand* temp1 = TempRegister(); | 1240 LOperand* temp1 = TempRegister(); |
| 1253 LOperand* temp2 = TempRegister(); | 1241 LOperand* temp2 = TempRegister(); |
| 1254 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()), | 1242 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()), |
| 1255 temp1, | 1243 temp1, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 } | 1276 } |
| 1289 } | 1277 } |
| 1290 return new LBranch(UseRegisterAtStart(v), first_id, second_id); | 1278 return new LBranch(UseRegisterAtStart(v), first_id, second_id); |
| 1291 } | 1279 } |
| 1292 | 1280 |
| 1293 | 1281 |
| 1294 LInstruction* LChunkBuilder::DoCompareMapAndBranch( | 1282 LInstruction* LChunkBuilder::DoCompareMapAndBranch( |
| 1295 HCompareMapAndBranch* instr) { | 1283 HCompareMapAndBranch* instr) { |
| 1296 ASSERT(instr->value()->representation().IsTagged()); | 1284 ASSERT(instr->value()->representation().IsTagged()); |
| 1297 LOperand* value = UseRegisterAtStart(instr->value()); | 1285 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1298 HBasicBlock* first = instr->FirstSuccessor(); | 1286 LOperand* temp = TempRegister(); |
| 1299 HBasicBlock* second = instr->SecondSuccessor(); | 1287 return new LCmpMapAndBranch(value, temp); |
| 1300 return new LCmpMapAndBranch(value, | |
| 1301 instr->map(), | |
| 1302 first->block_id(), | |
| 1303 second->block_id()); | |
| 1304 } | 1288 } |
| 1305 | 1289 |
| 1306 | 1290 |
| 1307 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { | 1291 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { |
| 1308 return DefineAsRegister(new LArgumentsLength(Use(length->value()))); | 1292 return DefineAsRegister(new LArgumentsLength(Use(length->value()))); |
| 1309 } | 1293 } |
| 1310 | 1294 |
| 1311 | 1295 |
| 1312 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { | 1296 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { |
| 1313 return DefineAsRegister(new LArgumentsElements); | 1297 return DefineAsRegister(new LArgumentsElements); |
| 1314 } | 1298 } |
| 1315 | 1299 |
| 1316 | 1300 |
| 1317 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 1301 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
| 1318 LInstruction* result = | 1302 LInstruction* result = |
| 1319 new LInstanceOf(UseFixed(instr->left(), r1), | 1303 new LInstanceOf(UseFixed(instr->left(), r0), |
| 1320 UseFixed(instr->right(), r0)); | 1304 UseFixed(instr->right(), r1)); |
| 1321 return MarkAsCall(DefineFixed(result, r0), instr); | 1305 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1322 } | 1306 } |
| 1323 | 1307 |
| 1324 | 1308 |
| 1325 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { | 1309 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { |
| 1326 LOperand* function = UseFixed(instr->function(), r1); | 1310 LOperand* function = UseFixed(instr->function(), r1); |
| 1327 LOperand* receiver = UseFixed(instr->receiver(), r0); | 1311 LOperand* receiver = UseFixed(instr->receiver(), r0); |
| 1328 LOperand* length = UseRegisterAtStart(instr->length()); | 1312 LOperand* length = UseRegisterAtStart(instr->length()); |
| 1329 LOperand* elements = UseRegisterAtStart(instr->elements()); | 1313 LOperand* elements = UseRegisterAtStart(instr->elements()); |
| 1330 LInstruction* result = new LApplyArguments(function, | 1314 LInstruction* result = new LApplyArguments(function, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 BuiltinFunctionId op = instr->op(); | 1347 BuiltinFunctionId op = instr->op(); |
| 1364 LOperand* input = UseRegisterAtStart(instr->value()); | 1348 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1365 LInstruction* result = new LUnaryMathOperation(input); | 1349 LInstruction* result = new LUnaryMathOperation(input); |
| 1366 switch (op) { | 1350 switch (op) { |
| 1367 case kMathAbs: | 1351 case kMathAbs: |
| 1368 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1352 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
| 1369 case kMathFloor: | 1353 case kMathFloor: |
| 1370 return AssignEnvironment(DefineAsRegister(result)); | 1354 return AssignEnvironment(DefineAsRegister(result)); |
| 1371 case kMathSqrt: | 1355 case kMathSqrt: |
| 1372 return DefineSameAsFirst(result); | 1356 return DefineSameAsFirst(result); |
| 1357 case kMathRound: |
| 1358 Abort("MathRound LUnaryMathOperation not implemented"); |
| 1359 return NULL; |
| 1373 case kMathPowHalf: | 1360 case kMathPowHalf: |
| 1374 Abort("MathPowHalf LUnaryMathOperation not implemented"); | 1361 Abort("MathPowHalf LUnaryMathOperation not implemented"); |
| 1375 return NULL; | 1362 return NULL; |
| 1376 case kMathLog: | 1363 case kMathLog: |
| 1377 Abort("MathLog LUnaryMathOperation not implemented"); | 1364 Abort("MathLog LUnaryMathOperation not implemented"); |
| 1378 return NULL; | 1365 return NULL; |
| 1379 case kMathCos: | 1366 case kMathCos: |
| 1380 Abort("MathCos LUnaryMathOperation not implemented"); | 1367 Abort("MathCos LUnaryMathOperation not implemented"); |
| 1381 return NULL; | 1368 return NULL; |
| 1382 case kMathSin: | 1369 case kMathSin: |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 | 1646 |
| 1660 | 1647 |
| 1661 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { | 1648 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { |
| 1662 ASSERT(instr->value()->representation().IsTagged()); | 1649 ASSERT(instr->value()->representation().IsTagged()); |
| 1663 LOperand* value = UseTempRegister(instr->value()); | 1650 LOperand* value = UseTempRegister(instr->value()); |
| 1664 | 1651 |
| 1665 return DefineSameAsFirst(new LClassOfTest(value, TempRegister())); | 1652 return DefineSameAsFirst(new LClassOfTest(value, TempRegister())); |
| 1666 } | 1653 } |
| 1667 | 1654 |
| 1668 | 1655 |
| 1669 LInstruction* LChunkBuilder::DoArrayLength(HArrayLength* instr) { | 1656 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { |
| 1670 LOperand* array = NULL; | 1657 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1671 LOperand* temporary = NULL; | 1658 return DefineAsRegister(new LJSArrayLength(array)); |
| 1672 | |
| 1673 if (instr->value()->IsLoadElements()) { | |
| 1674 array = UseRegisterAtStart(instr->value()); | |
| 1675 } else { | |
| 1676 array = UseRegister(instr->value()); | |
| 1677 temporary = TempRegister(); | |
| 1678 } | |
| 1679 | |
| 1680 LInstruction* result = new LArrayLength(array, temporary); | |
| 1681 return AssignEnvironment(DefineAsRegister(result)); | |
| 1682 } | 1659 } |
| 1683 | 1660 |
| 1684 | 1661 |
| 1662 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { |
| 1663 LOperand* array = UseRegisterAtStart(instr->value()); |
| 1664 return DefineAsRegister(new LFixedArrayLength(array)); |
| 1665 } |
| 1666 |
| 1667 |
| 1685 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { | 1668 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { |
| 1686 LOperand* object = UseRegister(instr->value()); | 1669 LOperand* object = UseRegister(instr->value()); |
| 1687 LInstruction* result = new LValueOf(object, TempRegister()); | 1670 LInstruction* result = new LValueOf(object, TempRegister()); |
| 1688 return AssignEnvironment(DefineSameAsFirst(result)); | 1671 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1689 } | 1672 } |
| 1690 | 1673 |
| 1691 | 1674 |
| 1692 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1675 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
| 1693 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), | 1676 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), |
| 1694 Use(instr->length()))); | 1677 Use(instr->length()))); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1771 | 1754 |
| 1772 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 1755 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
| 1773 LOperand* value = UseRegisterAtStart(instr->value()); | 1756 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1774 LOperand* temp = TempRegister(); | 1757 LOperand* temp = TempRegister(); |
| 1775 LInstruction* result = new LCheckInstanceType(value, temp); | 1758 LInstruction* result = new LCheckInstanceType(value, temp); |
| 1776 return AssignEnvironment(result); | 1759 return AssignEnvironment(result); |
| 1777 } | 1760 } |
| 1778 | 1761 |
| 1779 | 1762 |
| 1780 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 1763 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
| 1781 LOperand* temp = TempRegister(); | 1764 LOperand* temp1 = TempRegister(); |
| 1765 LOperand* temp2 = TempRegister(); |
| 1782 LInstruction* result = | 1766 LInstruction* result = |
| 1783 new LCheckPrototypeMaps(temp, | 1767 new LCheckPrototypeMaps(temp1, |
| 1768 temp2, |
| 1784 instr->holder(), | 1769 instr->holder(), |
| 1785 instr->receiver_map()); | 1770 instr->receiver_map()); |
| 1786 return AssignEnvironment(result); | 1771 return AssignEnvironment(result); |
| 1787 } | 1772 } |
| 1788 | 1773 |
| 1789 | 1774 |
| 1790 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { | 1775 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
| 1791 LOperand* value = UseRegisterAtStart(instr->value()); | 1776 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1792 return AssignEnvironment(new LCheckSmi(value, ne)); | 1777 return AssignEnvironment(new LCheckSmi(value, ne)); |
| 1793 } | 1778 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 } | 1832 } |
| 1848 | 1833 |
| 1849 | 1834 |
| 1850 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 1835 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
| 1851 LOperand* object = UseFixed(instr->object(), r0); | 1836 LOperand* object = UseFixed(instr->object(), r0); |
| 1852 LInstruction* result = DefineFixed(new LLoadNamedGeneric(object), r0); | 1837 LInstruction* result = DefineFixed(new LLoadNamedGeneric(object), r0); |
| 1853 return MarkAsCall(result, instr); | 1838 return MarkAsCall(result, instr); |
| 1854 } | 1839 } |
| 1855 | 1840 |
| 1856 | 1841 |
| 1842 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
| 1843 HLoadFunctionPrototype* instr) { |
| 1844 return AssignEnvironment(DefineAsRegister( |
| 1845 new LLoadFunctionPrototype(UseRegister(instr->function())))); |
| 1846 } |
| 1847 |
| 1848 |
| 1857 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) { | 1849 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) { |
| 1858 LOperand* input = UseRegisterAtStart(instr->value()); | 1850 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1859 return DefineSameAsFirst(new LLoadElements(input)); | 1851 return DefineSameAsFirst(new LLoadElements(input)); |
| 1860 } | 1852 } |
| 1861 | 1853 |
| 1862 | 1854 |
| 1863 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( | 1855 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
| 1864 HLoadKeyedFastElement* instr) { | 1856 HLoadKeyedFastElement* instr) { |
| 1865 Representation r = instr->representation(); | 1857 Representation r = instr->representation(); |
| 1866 LOperand* obj = UseRegisterAtStart(instr->object()); | 1858 LOperand* obj = UseRegisterAtStart(instr->object()); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2047 env->Drop(instr->pop_count()); | 2039 env->Drop(instr->pop_count()); |
| 2048 for (int i = 0; i < instr->values()->length(); ++i) { | 2040 for (int i = 0; i < instr->values()->length(); ++i) { |
| 2049 HValue* value = instr->values()->at(i); | 2041 HValue* value = instr->values()->at(i); |
| 2050 if (instr->HasAssignedIndexAt(i)) { | 2042 if (instr->HasAssignedIndexAt(i)) { |
| 2051 env->Bind(instr->GetAssignedIndexAt(i), value); | 2043 env->Bind(instr->GetAssignedIndexAt(i), value); |
| 2052 } else { | 2044 } else { |
| 2053 env->Push(value); | 2045 env->Push(value); |
| 2054 } | 2046 } |
| 2055 } | 2047 } |
| 2056 | 2048 |
| 2057 if (FLAG_trace_environment) { | 2049 ASSERT(env->length() == instr->environment_length()); |
| 2058 PrintF("Reconstructed environment ast_id=%d, instr_id=%d\n", | |
| 2059 instr->ast_id(), | |
| 2060 instr->id()); | |
| 2061 env->PrintToStd(); | |
| 2062 } | |
| 2063 ASSERT(env->values()->length() == instr->environment_height()); | |
| 2064 | 2050 |
| 2065 // If there is an instruction pending deoptimization environment create a | 2051 // If there is an instruction pending deoptimization environment create a |
| 2066 // lazy bailout instruction to capture the environment. | 2052 // lazy bailout instruction to capture the environment. |
| 2067 if (pending_deoptimization_ast_id_ == instr->ast_id()) { | 2053 if (pending_deoptimization_ast_id_ == instr->ast_id()) { |
| 2068 LInstruction* result = new LLazyBailout; | 2054 LInstruction* result = new LLazyBailout; |
| 2069 result = AssignEnvironment(result); | 2055 result = AssignEnvironment(result); |
| 2070 instructions_pending_deoptimization_environment_-> | 2056 instructions_pending_deoptimization_environment_-> |
| 2071 set_deoptimization_environment(result->environment()); | 2057 set_deoptimization_environment(result->environment()); |
| 2072 ClearInstructionPendingDeoptimizationEnvironment(); | 2058 ClearInstructionPendingDeoptimizationEnvironment(); |
| 2073 return result; | 2059 return result; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 void LPointerMap::PrintTo(StringStream* stream) const { | 2099 void LPointerMap::PrintTo(StringStream* stream) const { |
| 2114 stream->Add("{"); | 2100 stream->Add("{"); |
| 2115 for (int i = 0; i < pointer_operands_.length(); ++i) { | 2101 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 2116 if (i != 0) stream->Add(";"); | 2102 if (i != 0) stream->Add(";"); |
| 2117 pointer_operands_[i]->PrintTo(stream); | 2103 pointer_operands_[i]->PrintTo(stream); |
| 2118 } | 2104 } |
| 2119 stream->Add("} @%d", position()); | 2105 stream->Add("} @%d", position()); |
| 2120 } | 2106 } |
| 2121 | 2107 |
| 2122 } } // namespace v8::internal | 2108 } } // namespace v8::internal |
| OLD | NEW |