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

Side by Side Diff: src/hydrogen.cc

Issue 15832005: Make sure IfBuilder::Return clears the current block. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/code-stubs-hydrogen.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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 if (did_else_) { 815 if (did_else_) {
816 first_false_block_ = NULL; 816 first_false_block_ = NULL;
817 } else { 817 } else {
818 first_true_block_ = NULL; 818 first_true_block_ = NULL;
819 } 819 }
820 } 820 }
821 821
822 822
823 void HGraphBuilder::IfBuilder::Return(HValue* value) { 823 void HGraphBuilder::IfBuilder::Return(HValue* value) {
824 HBasicBlock* block = builder_->current_block(); 824 HBasicBlock* block = builder_->current_block();
825 block->Finish(new(zone()) HReturn(value, 825 HValue* context = builder_->environment()->LookupContext();
826 builder_->environment()->LookupContext(), 826 HValue* parameter_count = builder_->graph()->GetConstantMinus1();
827 builder_->graph()->GetConstantMinus1())); 827 block->FinishExit(new(zone()) HReturn(value, context, parameter_count));
828 builder_->set_current_block(NULL);
828 if (did_else_) { 829 if (did_else_) {
829 first_false_block_ = NULL; 830 first_false_block_ = NULL;
830 } else { 831 } else {
831 first_true_block_ = NULL; 832 first_true_block_ = NULL;
832 } 833 }
833 } 834 }
834 835
835 836
836 void HGraphBuilder::IfBuilder::End() { 837 void HGraphBuilder::IfBuilder::End() {
837 if (!captured_) { 838 if (!captured_) {
(...skipping 10659 matching lines...) Expand 10 before | Expand all | Expand 10 after
11497 } 11498 }
11498 } 11499 }
11499 11500
11500 #ifdef DEBUG 11501 #ifdef DEBUG
11501 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11502 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11502 if (allocator_ != NULL) allocator_->Verify(); 11503 if (allocator_ != NULL) allocator_->Verify();
11503 #endif 11504 #endif
11504 } 11505 }
11505 11506
11506 } } // namespace v8::internal 11507 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698