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

Side by Side Diff: src/x64/lithium-x64.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/mips/lithium-mips.cc ('k') | no next file » | 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // TODO(mstarzinger): The length check below should actually not 817 if (phi->HasMergedIndex()) {
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()) {
822 last_environment->SetValueAt(phi->merged_index(), phi); 818 last_environment->SetValueAt(phi->merged_index(), phi);
823 } 819 }
824 } 820 }
825 for (int i = 0; i < block->deleted_phis()->length(); ++i) { 821 for (int i = 0; i < block->deleted_phis()->length(); ++i) {
826 if (block->deleted_phis()->at(i) < last_environment->length()) { 822 if (block->deleted_phis()->at(i) < last_environment->length()) {
827 last_environment->SetValueAt(block->deleted_phis()->at(i), 823 last_environment->SetValueAt(block->deleted_phis()->at(i),
828 graph_->GetConstantUndefined()); 824 graph_->GetConstantUndefined());
829 } 825 }
830 } 826 }
831 block->UpdateEnvironment(last_environment); 827 block->UpdateEnvironment(last_environment);
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after
2546 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2542 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2547 LOperand* object = UseRegister(instr->object()); 2543 LOperand* object = UseRegister(instr->object());
2548 LOperand* index = UseTempRegister(instr->index()); 2544 LOperand* index = UseTempRegister(instr->index());
2549 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2545 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2550 } 2546 }
2551 2547
2552 2548
2553 } } // namespace v8::internal 2549 } } // namespace v8::internal
2554 2550
2555 #endif // V8_TARGET_ARCH_X64 2551 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698