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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 block->UpdateEnvironment(last_environment); | 811 block->UpdateEnvironment(last_environment); |
812 ASSERT(pred->argument_count() >= 0); | 812 ASSERT(pred->argument_count() >= 0); |
813 argument_count_ = pred->argument_count(); | 813 argument_count_ = pred->argument_count(); |
814 } else { | 814 } else { |
815 // We are at a state join => process phis. | 815 // We are at a state join => process phis. |
816 HBasicBlock* pred = block->predecessors()->at(0); | 816 HBasicBlock* pred = block->predecessors()->at(0); |
817 // No need to copy the environment, it cannot be used later. | 817 // No need to copy the environment, it cannot be used later. |
818 HEnvironment* last_environment = pred->last_environment(); | 818 HEnvironment* last_environment = pred->last_environment(); |
819 for (int i = 0; i < block->phis()->length(); ++i) { | 819 for (int i = 0; i < block->phis()->length(); ++i) { |
820 HPhi* phi = block->phis()->at(i); | 820 HPhi* phi = block->phis()->at(i); |
821 if (phi->merged_index() < last_environment->length()) { | 821 // TODO(mstarzinger): The length check below should actually not |
| 822 // be necessary, but some array stubs already rely on it. This |
| 823 // should be investigated and fixed. |
| 824 if (phi->HasMergedIndex() && |
| 825 phi->merged_index() < last_environment->length()) { |
822 last_environment->SetValueAt(phi->merged_index(), phi); | 826 last_environment->SetValueAt(phi->merged_index(), phi); |
823 } | 827 } |
824 } | 828 } |
825 for (int i = 0; i < block->deleted_phis()->length(); ++i) { | 829 for (int i = 0; i < block->deleted_phis()->length(); ++i) { |
826 if (block->deleted_phis()->at(i) < last_environment->length()) { | 830 if (block->deleted_phis()->at(i) < last_environment->length()) { |
827 last_environment->SetValueAt(block->deleted_phis()->at(i), | 831 last_environment->SetValueAt(block->deleted_phis()->at(i), |
828 graph_->GetConstantUndefined()); | 832 graph_->GetConstantUndefined()); |
829 } | 833 } |
830 } | 834 } |
831 block->UpdateEnvironment(last_environment); | 835 block->UpdateEnvironment(last_environment); |
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 | 2508 |
2505 | 2509 |
2506 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2510 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2507 LOperand* object = UseRegister(instr->object()); | 2511 LOperand* object = UseRegister(instr->object()); |
2508 LOperand* index = UseRegister(instr->index()); | 2512 LOperand* index = UseRegister(instr->index()); |
2509 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2513 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2510 } | 2514 } |
2511 | 2515 |
2512 | 2516 |
2513 } } // namespace v8::internal | 2517 } } // namespace v8::internal |
OLD | NEW |