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

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

Issue 1153403002: [turbofan] Simplify graph construction for for-in. (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 | src/runtime/runtime-array.cc » ('j') | 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 aaef0569e7b7e172d1a16e0fbcc45c3e322cd5bc..c2e0dd4b3c22741c65ef913ab4d9be516e22c192 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1328,27 +1328,14 @@ void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
NewNode(javascript()->CallRuntime(Runtime::kForInCacheArrayLength, 2),
cache_type, cache_array);
{
- // TODO(dcarney): this check is actually supposed to be for the
- // empty enum case only.
- IfBuilder have_no_properties(this);
- Node* empty_array_cond = NewNode(javascript()->StrictEqual(),
- cache_length, jsgraph()->ZeroConstant());
- have_no_properties.If(empty_array_cond);
- have_no_properties.Then();
- // Pop obj and skip loop.
- environment()->Pop();
- have_no_properties.Else();
- {
- // Construct the rest of the environment.
- environment()->Push(cache_type);
- environment()->Push(cache_array);
- environment()->Push(cache_length);
- environment()->Push(jsgraph()->ZeroConstant());
-
- // Build the actual loop body.
- VisitForInBody(stmt);
- }
- have_no_properties.End();
+ // Construct the rest of the environment.
+ environment()->Push(cache_type);
+ environment()->Push(cache_array);
+ environment()->Push(cache_length);
+ environment()->Push(jsgraph()->ZeroConstant());
+
+ // Build the actual loop body.
+ VisitForInBody(stmt);
}
is_null.End();
}
« no previous file with comments | « no previous file | src/runtime/runtime-array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698