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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 block->UpdateEnvironment(last_environment); | 863 block->UpdateEnvironment(last_environment); |
864 ASSERT(pred->argument_count() >= 0); | 864 ASSERT(pred->argument_count() >= 0); |
865 argument_count_ = pred->argument_count(); | 865 argument_count_ = pred->argument_count(); |
866 } else { | 866 } else { |
867 // We are at a state join => process phis. | 867 // We are at a state join => process phis. |
868 HBasicBlock* pred = block->predecessors()->at(0); | 868 HBasicBlock* pred = block->predecessors()->at(0); |
869 // No need to copy the environment, it cannot be used later. | 869 // No need to copy the environment, it cannot be used later. |
870 HEnvironment* last_environment = pred->last_environment(); | 870 HEnvironment* last_environment = pred->last_environment(); |
871 for (int i = 0; i < block->phis()->length(); ++i) { | 871 for (int i = 0; i < block->phis()->length(); ++i) { |
872 HPhi* phi = block->phis()->at(i); | 872 HPhi* phi = block->phis()->at(i); |
873 if (phi->merged_index() < last_environment->length()) { | 873 // TODO(mstarzinger): The length check below should actually not |
| 874 // be necessary, but some array stubs already rely on it. This |
| 875 // should be investigated and fixed. |
| 876 if (phi->HasMergedIndex() && |
| 877 phi->merged_index() < last_environment->length()) { |
874 last_environment->SetValueAt(phi->merged_index(), phi); | 878 last_environment->SetValueAt(phi->merged_index(), phi); |
875 } | 879 } |
876 } | 880 } |
877 for (int i = 0; i < block->deleted_phis()->length(); ++i) { | 881 for (int i = 0; i < block->deleted_phis()->length(); ++i) { |
878 if (block->deleted_phis()->at(i) < last_environment->length()) { | 882 if (block->deleted_phis()->at(i) < last_environment->length()) { |
879 last_environment->SetValueAt(block->deleted_phis()->at(i), | 883 last_environment->SetValueAt(block->deleted_phis()->at(i), |
880 graph_->GetConstantUndefined()); | 884 graph_->GetConstantUndefined()); |
881 } | 885 } |
882 } | 886 } |
883 block->UpdateEnvironment(last_environment); | 887 block->UpdateEnvironment(last_environment); |
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2749 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2753 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2750 LOperand* object = UseRegister(instr->object()); | 2754 LOperand* object = UseRegister(instr->object()); |
2751 LOperand* index = UseTempRegister(instr->index()); | 2755 LOperand* index = UseTempRegister(instr->index()); |
2752 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2756 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2753 } | 2757 } |
2754 | 2758 |
2755 | 2759 |
2756 } } // namespace v8::internal | 2760 } } // namespace v8::internal |
2757 | 2761 |
2758 #endif // V8_TARGET_ARCH_IA32 | 2762 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |