| 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 block->UpdateEnvironment(last_environment); | 807 block->UpdateEnvironment(last_environment); |
| 808 ASSERT(pred->argument_count() >= 0); | 808 ASSERT(pred->argument_count() >= 0); |
| 809 argument_count_ = pred->argument_count(); | 809 argument_count_ = pred->argument_count(); |
| 810 } else { | 810 } else { |
| 811 // We are at a state join => process phis. | 811 // We are at a state join => process phis. |
| 812 HBasicBlock* pred = block->predecessors()->at(0); | 812 HBasicBlock* pred = block->predecessors()->at(0); |
| 813 // No need to copy the environment, it cannot be used later. | 813 // No need to copy the environment, it cannot be used later. |
| 814 HEnvironment* last_environment = pred->last_environment(); | 814 HEnvironment* last_environment = pred->last_environment(); |
| 815 for (int i = 0; i < block->phis()->length(); ++i) { | 815 for (int i = 0; i < block->phis()->length(); ++i) { |
| 816 HPhi* phi = block->phis()->at(i); | 816 HPhi* phi = block->phis()->at(i); |
| 817 if (phi->merged_index() < last_environment->length()) { | 817 // TODO(mstarzinger): The length check below should actually not |
| 818 // be necessary, but some array stubs already rely on it. This |
| 819 // should be investigated and fixed. |
| 820 if (phi->HasMergedIndex() && |
| 821 phi->merged_index() < last_environment->length()) { |
| 818 last_environment->SetValueAt(phi->merged_index(), phi); | 822 last_environment->SetValueAt(phi->merged_index(), phi); |
| 819 } | 823 } |
| 820 } | 824 } |
| 821 for (int i = 0; i < block->deleted_phis()->length(); ++i) { | 825 for (int i = 0; i < block->deleted_phis()->length(); ++i) { |
| 822 if (block->deleted_phis()->at(i) < last_environment->length()) { | 826 if (block->deleted_phis()->at(i) < last_environment->length()) { |
| 823 last_environment->SetValueAt(block->deleted_phis()->at(i), | 827 last_environment->SetValueAt(block->deleted_phis()->at(i), |
| 824 graph_->GetConstantUndefined()); | 828 graph_->GetConstantUndefined()); |
| 825 } | 829 } |
| 826 } | 830 } |
| 827 block->UpdateEnvironment(last_environment); | 831 block->UpdateEnvironment(last_environment); |
| (...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2542 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2546 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2543 LOperand* object = UseRegister(instr->object()); | 2547 LOperand* object = UseRegister(instr->object()); |
| 2544 LOperand* index = UseTempRegister(instr->index()); | 2548 LOperand* index = UseTempRegister(instr->index()); |
| 2545 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2549 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2546 } | 2550 } |
| 2547 | 2551 |
| 2548 | 2552 |
| 2549 } } // namespace v8::internal | 2553 } } // namespace v8::internal |
| 2550 | 2554 |
| 2551 #endif // V8_TARGET_ARCH_X64 | 2555 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |