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

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

Issue 640203004: Fix AstGraphBuilder for loops like for(;;). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/cctest.status » ('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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 603
604 604
605 void AstGraphBuilder::VisitForStatement(ForStatement* stmt) { 605 void AstGraphBuilder::VisitForStatement(ForStatement* stmt) {
606 LoopBuilder for_loop(this); 606 LoopBuilder for_loop(this);
607 VisitIfNotNull(stmt->init()); 607 VisitIfNotNull(stmt->init());
608 for_loop.BeginLoop(); 608 for_loop.BeginLoop();
609 if (stmt->cond() != NULL) { 609 if (stmt->cond() != NULL) {
610 VisitForTest(stmt->cond()); 610 VisitForTest(stmt->cond());
611 Node* condition = environment()->Pop(); 611 Node* condition = environment()->Pop();
612 for_loop.BreakUnless(condition); 612 for_loop.BreakUnless(condition);
613 } else {
614 for_loop.BreakUnless(jsgraph()->TrueConstant());
613 } 615 }
614 VisitIterationBody(stmt, &for_loop, 0); 616 VisitIterationBody(stmt, &for_loop, 0);
615 for_loop.EndBody(); 617 for_loop.EndBody();
616 VisitIfNotNull(stmt->next()); 618 VisitIfNotNull(stmt->next());
617 for_loop.EndLoop(); 619 for_loop.EndLoop();
618 } 620 }
619 621
620 622
621 // TODO(dcarney): this is a big function. Try to clean up some. 623 // TODO(dcarney): this is a big function. Try to clean up some.
622 void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) { 624 void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 DCHECK(NodeProperties::GetFrameStateInput(node)->opcode() == 2118 DCHECK(NodeProperties::GetFrameStateInput(node)->opcode() ==
2117 IrOpcode::kDead); 2119 IrOpcode::kDead);
2118 NodeProperties::ReplaceFrameStateInput( 2120 NodeProperties::ReplaceFrameStateInput(
2119 node, environment()->Checkpoint(ast_id, combine)); 2121 node, environment()->Checkpoint(ast_id, combine));
2120 } 2122 }
2121 } 2123 }
2122 2124
2123 } 2125 }
2124 } 2126 }
2125 } // namespace v8::internal::compiler 2127 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698