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

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

Issue 14344004: Fix bugs in IfBuilder and improve functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years, 8 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/ia32/lithium-ia32.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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 block->UpdateEnvironment(last_environment); 824 block->UpdateEnvironment(last_environment);
825 ASSERT(pred->argument_count() >= 0); 825 ASSERT(pred->argument_count() >= 0);
826 argument_count_ = pred->argument_count(); 826 argument_count_ = pred->argument_count();
827 } else { 827 } else {
828 // We are at a state join => process phis. 828 // We are at a state join => process phis.
829 HBasicBlock* pred = block->predecessors()->at(0); 829 HBasicBlock* pred = block->predecessors()->at(0);
830 // No need to copy the environment, it cannot be used later. 830 // No need to copy the environment, it cannot be used later.
831 HEnvironment* last_environment = pred->last_environment(); 831 HEnvironment* last_environment = pred->last_environment();
832 for (int i = 0; i < block->phis()->length(); ++i) { 832 for (int i = 0; i < block->phis()->length(); ++i) {
833 HPhi* phi = block->phis()->at(i); 833 HPhi* phi = block->phis()->at(i);
834 last_environment->SetValueAt(phi->merged_index(), phi); 834 if (phi->merged_index() < last_environment->length()) {
835 last_environment->SetValueAt(phi->merged_index(), phi);
836 }
835 } 837 }
836 for (int i = 0; i < block->deleted_phis()->length(); ++i) { 838 for (int i = 0; i < block->deleted_phis()->length(); ++i) {
837 last_environment->SetValueAt(block->deleted_phis()->at(i), 839 if (block->deleted_phis()->at(i) < last_environment->length()) {
838 graph_->GetConstantUndefined()); 840 last_environment->SetValueAt(block->deleted_phis()->at(i),
841 graph_->GetConstantUndefined());
842 }
839 } 843 }
840 block->UpdateEnvironment(last_environment); 844 block->UpdateEnvironment(last_environment);
841 // Pick up the outgoing argument count of one of the predecessors. 845 // Pick up the outgoing argument count of one of the predecessors.
842 argument_count_ = pred->argument_count(); 846 argument_count_ = pred->argument_count();
843 } 847 }
844 HInstruction* current = block->first(); 848 HInstruction* current = block->first();
845 int start = chunk_->instructions()->length(); 849 int start = chunk_->instructions()->length();
846 while (current != NULL && !is_aborted()) { 850 while (current != NULL && !is_aborted()) {
847 // Code for constants in registers is generated lazily. 851 // Code for constants in registers is generated lazily.
848 if (!current->EmitAtUses()) { 852 if (!current->EmitAtUses()) {
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2524 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2521 LOperand* object = UseRegister(instr->object()); 2525 LOperand* object = UseRegister(instr->object());
2522 LOperand* index = UseTempRegister(instr->index()); 2526 LOperand* index = UseTempRegister(instr->index());
2523 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2527 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2524 } 2528 }
2525 2529
2526 2530
2527 } } // namespace v8::internal 2531 } } // namespace v8::internal
2528 2532
2529 #endif // V8_TARGET_ARCH_X64 2533 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698