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

Side by Side Diff: src/hydrogen-gvn.cc

Issue 19235010: Minor cleanup of GVN state pushing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | « no previous file | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 dominated_index_++; 705 dominated_index_++;
706 if (dominated_index_ == length_ - 1) { 706 if (dominated_index_ == length_ - 1) {
707 // No need to copy the map for the last child in the dominator tree. 707 // No need to copy the map for the last child in the dominator tree.
708 Initialize(block_->dominated_blocks()->at(dominated_index_), 708 Initialize(block_->dominated_blocks()->at(dominated_index_),
709 map(), 709 map(),
710 dominators(), 710 dominators(),
711 false, 711 false,
712 zone); 712 zone);
713 return this; 713 return this;
714 } else if (dominated_index_ < length_) { 714 } else if (dominated_index_ < length_) {
715 return push(zone, 715 return push(zone, block_->dominated_blocks()->at(dominated_index_));
716 block_->dominated_blocks()->at(dominated_index_),
717 dominators());
718 } else { 716 } else {
719 return NULL; 717 return NULL;
720 } 718 }
721 } 719 }
722 720
723 GvnBasicBlockState* push(Zone* zone, 721 GvnBasicBlockState* push(Zone* zone, HBasicBlock* block) {
724 HBasicBlock* block,
725 HSideEffectMap* dominators) {
726 if (next_ == NULL) { 722 if (next_ == NULL) {
727 next_ = 723 next_ =
728 new(zone) GvnBasicBlockState(this, block, map(), dominators, zone); 724 new(zone) GvnBasicBlockState(this, block, map(), dominators(), zone);
729 } else { 725 } else {
730 next_->Initialize(block, map(), dominators, true, zone); 726 next_->Initialize(block, map(), dominators(), true, zone);
731 } 727 }
732 return next_; 728 return next_;
733 } 729 }
734 GvnBasicBlockState* pop() { 730 GvnBasicBlockState* pop() {
735 GvnBasicBlockState* result = previous_; 731 GvnBasicBlockState* result = previous_;
736 while (result != NULL && result->is_done()) { 732 while (result != NULL && result->is_done()) {
737 TRACE_GVN_2("Backtracking from block B%d to block b%d\n", 733 TRACE_GVN_2("Backtracking from block B%d to block b%d\n",
738 block()->block_id(), 734 block()->block_id(),
739 previous_->block()->block_id()) 735 previous_->block()->block_id())
740 result = result->previous_; 736 result = result->previous_;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 dominated); 846 dominated);
851 successor_map->Kill(side_effects_on_all_paths); 847 successor_map->Kill(side_effects_on_all_paths);
852 successor_dominators->Kill(side_effects_on_all_paths); 848 successor_dominators->Kill(side_effects_on_all_paths);
853 } 849 }
854 } 850 }
855 current = next; 851 current = next;
856 } 852 }
857 } 853 }
858 854
859 } } // namespace v8::internal 855 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698