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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1148323003: [turbofan] Remove frame state TODOs from VisitForInBody. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index bc96c4c91ad602499dd33ccd49a92c27d1ecdef8..038d2beb1e6472e9b01cf843993ca1b592e7dfd1 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1368,14 +1368,15 @@ void AstGraphBuilder::VisitForInBody(ForInStatement* stmt) {
Node* cache_type = environment()->Peek(3);
Node* obj = environment()->Peek(4);
- // Check loop termination condition.
- FrameStateBeforeAndAfter states(this, BailoutId::None());
- Node* exit_cond = NewNode(javascript()->LessThan(LanguageMode::SLOPPY),
- index, cache_length);
- // TODO(jarin): provide real bailout id.
- states.AddToNode(exit_cond, BailoutId::None(),
- OutputFrameStateCombine::Ignore());
- for_loop.BreakUnless(exit_cond);
+ // Check loop termination condition (cannot deoptimize).
+ {
+ FrameStateBeforeAndAfter states(this, BailoutId::None());
+ Node* exit_cond = NewNode(javascript()->LessThan(LanguageMode::SLOPPY),
+ index, cache_length);
+ states.AddToNode(exit_cond, BailoutId::None(),
+ OutputFrameStateCombine::Ignore());
+ for_loop.BreakUnless(exit_cond);
+ }
Node* pair = NewNode(javascript()->CallRuntime(Runtime::kForInNext, 4), obj,
cache_array, cache_type, index);
Node* value = NewNode(common()->Projection(0), pair);
@@ -1405,9 +1406,8 @@ void AstGraphBuilder::VisitForInBody(ForInStatement* stmt) {
IfBuilder is_property_missing(this);
is_property_missing.If(property_missing);
is_property_missing.Then();
- // Inc counter and continue.
+ // Inc counter and continue (cannot deoptimize).
{
- // TODO(jarin): provide real bailout id.
FrameStateBeforeAndAfter states(this, BailoutId::None());
Node* index_inc = NewNode(javascript()->Add(LanguageMode::SLOPPY),
index, jsgraph()->OneConstant());
@@ -1431,17 +1431,15 @@ void AstGraphBuilder::VisitForInBody(ForInStatement* stmt) {
index = environment()->Peek(0);
for_loop.EndBody();
- // Inc counter and continue.
- Node* index_inc =
- NewNode(javascript()->Add(LanguageMode::SLOPPY), index,
- jsgraph()->OneConstant());
+ // Inc counter and continue (cannot deoptimize).
{
- // TODO(jarin): provide real bailout ids.
FrameStateBeforeAndAfter states(this, BailoutId::None());
+ Node* index_inc = NewNode(javascript()->Add(LanguageMode::SLOPPY), index,
+ jsgraph()->OneConstant());
states.AddToNode(index_inc, BailoutId::None(),
OutputFrameStateCombine::Ignore());
+ environment()->Poke(0, index_inc);
}
- environment()->Poke(0, index_inc);
for_loop.EndLoop();
environment()->Drop(5);
// PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
« 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