| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 block->UpdateEnvironment(last_environment); | 621 block->UpdateEnvironment(last_environment); |
| 622 ASSERT(pred->argument_count() >= 0); | 622 ASSERT(pred->argument_count() >= 0); |
| 623 argument_count_ = pred->argument_count(); | 623 argument_count_ = pred->argument_count(); |
| 624 } else { | 624 } else { |
| 625 // We are at a state join => process phis. | 625 // We are at a state join => process phis. |
| 626 HBasicBlock* pred = block->predecessors()->at(0); | 626 HBasicBlock* pred = block->predecessors()->at(0); |
| 627 // No need to copy the environment, it cannot be used later. | 627 // No need to copy the environment, it cannot be used later. |
| 628 HEnvironment* last_environment = pred->last_environment(); | 628 HEnvironment* last_environment = pred->last_environment(); |
| 629 for (int i = 0; i < block->phis()->length(); ++i) { | 629 for (int i = 0; i < block->phis()->length(); ++i) { |
| 630 HPhi* phi = block->phis()->at(i); | 630 HPhi* phi = block->phis()->at(i); |
| 631 if (phi->merged_index() < last_environment->length()) { | 631 if (phi->HasMergedIndex()) { |
| 632 last_environment->SetValueAt(phi->merged_index(), phi); | 632 last_environment->SetValueAt(phi->merged_index(), phi); |
| 633 } | 633 } |
| 634 } | 634 } |
| 635 for (int i = 0; i < block->deleted_phis()->length(); ++i) { | 635 for (int i = 0; i < block->deleted_phis()->length(); ++i) { |
| 636 if (block->deleted_phis()->at(i) < last_environment->length()) { | 636 if (block->deleted_phis()->at(i) < last_environment->length()) { |
| 637 last_environment->SetValueAt(block->deleted_phis()->at(i), | 637 last_environment->SetValueAt(block->deleted_phis()->at(i), |
| 638 graph_->GetConstantUndefined()); | 638 graph_->GetConstantUndefined()); |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 block->UpdateEnvironment(last_environment); | 641 block->UpdateEnvironment(last_environment); |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1342 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
| 1343 ASSERT(instr->left()->representation().IsTagged()); | 1343 ASSERT(instr->left()->representation().IsTagged()); |
| 1344 ASSERT(instr->right()->representation().IsTagged()); | 1344 ASSERT(instr->right()->representation().IsTagged()); |
| 1345 LOperand* left = UseFixed(instr->left(), x1); | 1345 LOperand* left = UseFixed(instr->left(), x1); |
| 1346 LOperand* right = UseFixed(instr->right(), x0); | 1346 LOperand* right = UseFixed(instr->right(), x0); |
| 1347 LCmpT* result = new(zone()) LCmpT(left, right); | 1347 LCmpT* result = new(zone()) LCmpT(left, right); |
| 1348 return MarkAsCall(DefineFixed(result, x0), instr); | 1348 return MarkAsCall(DefineFixed(result, x0), instr); |
| 1349 } | 1349 } |
| 1350 | 1350 |
| 1351 | 1351 |
| 1352 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( |
| 1353 HCompareHoleAndBranch* instr) { |
| 1354 LOperand* object = UseRegister(instr->object()); |
| 1355 if (instr->representation().IsTagged()) { |
| 1356 return new(zone()) LCmpHoleAndBranchT(object); |
| 1357 } else { |
| 1358 LOperand* temp = TempRegister(); |
| 1359 return new(zone()) LCmpHoleAndBranchD(object, temp); |
| 1360 } |
| 1361 } |
| 1362 |
| 1363 |
| 1352 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( | 1364 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
| 1353 HCompareObjectEqAndBranch* instr) { | 1365 HCompareObjectEqAndBranch* instr) { |
| 1354 LOperand* left = UseRegisterAtStart(instr->left()); | 1366 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1355 LOperand* right = UseRegisterAtStart(instr->right()); | 1367 LOperand* right = UseRegisterAtStart(instr->right()); |
| 1356 return new(zone()) LCmpObjectEqAndBranch(left, right); | 1368 return new(zone()) LCmpObjectEqAndBranch(left, right); |
| 1357 } | 1369 } |
| 1358 | 1370 |
| 1359 | 1371 |
| 1360 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1372 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
| 1361 ASSERT(instr->value()->representation().IsTagged()); | 1373 ASSERT(instr->value()->representation().IsTagged()); |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 return MarkAsCall(result, instr); | 1742 return MarkAsCall(result, instr); |
| 1731 } | 1743 } |
| 1732 | 1744 |
| 1733 | 1745 |
| 1734 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 1746 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
| 1735 LOperand* object = UseRegisterAtStart(instr->object()); | 1747 LOperand* object = UseRegisterAtStart(instr->object()); |
| 1736 return DefineAsRegister(new(zone()) LLoadNamedField(object)); | 1748 return DefineAsRegister(new(zone()) LLoadNamedField(object)); |
| 1737 } | 1749 } |
| 1738 | 1750 |
| 1739 | 1751 |
| 1740 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( | |
| 1741 HLoadNamedFieldPolymorphic* instr) { | |
| 1742 ASSERT(instr->representation().IsTagged()); | |
| 1743 if (instr->need_generic()) { | |
| 1744 LOperand* obj = UseFixed(instr->object(), x0); | |
| 1745 LLoadNamedFieldPolymorphic* result = | |
| 1746 new(zone()) LLoadNamedFieldPolymorphic(obj); | |
| 1747 return MarkAsCall(DefineFixed(result, x0), instr); | |
| 1748 } else { | |
| 1749 LOperand* obj = UseRegister(instr->object()); | |
| 1750 LLoadNamedFieldPolymorphic* result = | |
| 1751 new(zone()) LLoadNamedFieldPolymorphic(obj); | |
| 1752 return AssignEnvironment(DefineAsRegister(result)); | |
| 1753 } | |
| 1754 } | |
| 1755 | |
| 1756 | |
| 1757 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 1752 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
| 1758 LOperand* object = UseFixed(instr->object(), x0); | 1753 LOperand* object = UseFixed(instr->object(), x0); |
| 1759 LInstruction* result = DefineFixed(new(zone()) LLoadNamedGeneric(object), x0); | 1754 LInstruction* result = DefineFixed(new(zone()) LLoadNamedGeneric(object), x0); |
| 1760 return MarkAsCall(result, instr); | 1755 return MarkAsCall(result, instr); |
| 1761 } | 1756 } |
| 1762 | 1757 |
| 1763 | 1758 |
| 1764 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { | 1759 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { |
| 1765 LOperand* map = UseRegisterAtStart(instr->value()); | 1760 LOperand* map = UseRegisterAtStart(instr->value()); |
| 1766 return DefineAsRegister(new(zone()) LMapEnumLength(map)); | 1761 return DefineAsRegister(new(zone()) LMapEnumLength(map)); |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2536 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2531 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
| 2537 LOperand* receiver = UseRegister(instr->receiver()); | 2532 LOperand* receiver = UseRegister(instr->receiver()); |
| 2538 LOperand* function = UseRegisterAtStart(instr->function()); | 2533 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2539 LOperand* temp = TempRegister(); | 2534 LOperand* temp = TempRegister(); |
| 2540 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); | 2535 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); |
| 2541 return AssignEnvironment(DefineAsRegister(result)); | 2536 return AssignEnvironment(DefineAsRegister(result)); |
| 2542 } | 2537 } |
| 2543 | 2538 |
| 2544 | 2539 |
| 2545 } } // namespace v8::internal | 2540 } } // namespace v8::internal |
| OLD | NEW |