Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 22589005: Make sure polymorphic element access creates non-replaying phis. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO(mstarzinger): The length check below should actually not 873 if (phi->HasMergedIndex()) {
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()) {
878 last_environment->SetValueAt(phi->merged_index(), phi); 874 last_environment->SetValueAt(phi->merged_index(), phi);
879 } 875 }
880 } 876 }
881 for (int i = 0; i < block->deleted_phis()->length(); ++i) { 877 for (int i = 0; i < block->deleted_phis()->length(); ++i) {
882 if (block->deleted_phis()->at(i) < last_environment->length()) { 878 if (block->deleted_phis()->at(i) < last_environment->length()) {
883 last_environment->SetValueAt(block->deleted_phis()->at(i), 879 last_environment->SetValueAt(block->deleted_phis()->at(i),
884 graph_->GetConstantUndefined()); 880 graph_->GetConstantUndefined());
885 } 881 }
886 } 882 }
887 block->UpdateEnvironment(last_environment); 883 block->UpdateEnvironment(last_environment);
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2749 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2754 LOperand* object = UseRegister(instr->object()); 2750 LOperand* object = UseRegister(instr->object());
2755 LOperand* index = UseTempRegister(instr->index()); 2751 LOperand* index = UseTempRegister(instr->index());
2756 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2752 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2757 } 2753 }
2758 2754
2759 2755
2760 } } // namespace v8::internal 2756 } } // namespace v8::internal
2761 2757
2762 #endif // V8_TARGET_ARCH_IA32 2758 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698