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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 502043002: Fix continue statements within for-in loops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | test/cctest/compiler/test-run-jsbranches.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/control-builders.h" 8 #include "src/compiler/control-builders.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } 737 }
738 // Replace 'value' in environment. 738 // Replace 'value' in environment.
739 environment()->Push(res); 739 environment()->Push(res);
740 test_should_filter.Else(); 740 test_should_filter.Else();
741 test_should_filter.End(); 741 test_should_filter.End();
742 } 742 }
743 value = environment()->Pop(); 743 value = environment()->Pop();
744 // Bind value and do loop body. 744 // Bind value and do loop body.
745 VisitForInAssignment(stmt->each(), value); 745 VisitForInAssignment(stmt->each(), value);
746 VisitIterationBody(stmt, &for_loop, 5); 746 VisitIterationBody(stmt, &for_loop, 5);
747 for_loop.EndBody();
747 // Inc counter and continue. 748 // Inc counter and continue.
748 Node* index_inc = 749 Node* index_inc =
749 NewNode(javascript()->Add(), index, jsgraph()->OneConstant()); 750 NewNode(javascript()->Add(), index, jsgraph()->OneConstant());
750 // TODO(jarin): provide real bailout id. 751 // TODO(jarin): provide real bailout id.
751 PrepareFrameState(index_inc, BailoutId::None()); 752 PrepareFrameState(index_inc, BailoutId::None());
752 environment()->Poke(0, index_inc); 753 environment()->Poke(0, index_inc);
753 for_loop.EndBody();
754 for_loop.EndLoop(); 754 for_loop.EndLoop();
755 environment()->Drop(5); 755 environment()->Drop(5);
756 // PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); 756 // PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
757 } 757 }
758 have_no_properties.End(); 758 have_no_properties.End();
759 } 759 }
760 is_null.End(); 760 is_null.End();
761 } 761 }
762 is_undefined.End(); 762 is_undefined.End();
763 } 763 }
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 2031
2032 // Continue with the original environment. 2032 // Continue with the original environment.
2033 set_environment(continuation_env); 2033 set_environment(continuation_env);
2034 NewNode(common()->Continuation()); 2034 NewNode(common()->Continuation());
2035 } 2035 }
2036 } 2036 }
2037 2037
2038 } 2038 }
2039 } 2039 }
2040 } // namespace v8::internal::compiler 2040 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-jsbranches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698