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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 block->UpdateEnvironment(last_environment); | 816 block->UpdateEnvironment(last_environment); |
817 ASSERT(pred->argument_count() >= 0); | 817 ASSERT(pred->argument_count() >= 0); |
818 argument_count_ = pred->argument_count(); | 818 argument_count_ = pred->argument_count(); |
819 } else { | 819 } else { |
820 // We are at a state join => process phis. | 820 // We are at a state join => process phis. |
821 HBasicBlock* pred = block->predecessors()->at(0); | 821 HBasicBlock* pred = block->predecessors()->at(0); |
822 // No need to copy the environment, it cannot be used later. | 822 // No need to copy the environment, it cannot be used later. |
823 HEnvironment* last_environment = pred->last_environment(); | 823 HEnvironment* last_environment = pred->last_environment(); |
824 for (int i = 0; i < block->phis()->length(); ++i) { | 824 for (int i = 0; i < block->phis()->length(); ++i) { |
825 HPhi* phi = block->phis()->at(i); | 825 HPhi* phi = block->phis()->at(i); |
826 last_environment->SetValueAt(phi->merged_index(), phi); | 826 if (phi->merged_index() < last_environment->length()) { |
| 827 last_environment->SetValueAt(phi->merged_index(), phi); |
| 828 } |
827 } | 829 } |
828 for (int i = 0; i < block->deleted_phis()->length(); ++i) { | 830 for (int i = 0; i < block->deleted_phis()->length(); ++i) { |
829 last_environment->SetValueAt(block->deleted_phis()->at(i), | 831 if (block->deleted_phis()->at(i) < last_environment->length()) { |
830 graph_->GetConstantUndefined()); | 832 last_environment->SetValueAt(block->deleted_phis()->at(i), |
| 833 graph_->GetConstantUndefined()); |
| 834 } |
831 } | 835 } |
832 block->UpdateEnvironment(last_environment); | 836 block->UpdateEnvironment(last_environment); |
833 // Pick up the outgoing argument count of one of the predecessors. | 837 // Pick up the outgoing argument count of one of the predecessors. |
834 argument_count_ = pred->argument_count(); | 838 argument_count_ = pred->argument_count(); |
835 } | 839 } |
836 HInstruction* current = block->first(); | 840 HInstruction* current = block->first(); |
837 int start = chunk_->instructions()->length(); | 841 int start = chunk_->instructions()->length(); |
838 while (current != NULL && !is_aborted()) { | 842 while (current != NULL && !is_aborted()) { |
839 // Code for constants in registers is generated lazily. | 843 // Code for constants in registers is generated lazily. |
840 if (!current->EmitAtUses()) { | 844 if (!current->EmitAtUses()) { |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 | 2473 |
2470 | 2474 |
2471 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2475 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2472 LOperand* object = UseRegister(instr->object()); | 2476 LOperand* object = UseRegister(instr->object()); |
2473 LOperand* index = UseRegister(instr->index()); | 2477 LOperand* index = UseRegister(instr->index()); |
2474 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2478 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2475 } | 2479 } |
2476 | 2480 |
2477 | 2481 |
2478 } } // namespace v8::internal | 2482 } } // namespace v8::internal |
OLD | NEW |