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

Unified Diff: src/hydrogen.cc

Issue 1160983004: [turbofan] First step towards sanitizing for-in and making it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add some comments. 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 | « src/compiler/verifier.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 8af0c337a4bdec2800e607bb2c4d57ed28a0aba0..30406d656c3ee4d293877ab96ec36eaee7168e09 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5201,12 +5201,17 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt,
Add<HCheckMapValue>(enumerable, environment()->ExpressionStackAt(3));
Bind(each_var, key);
} else {
- HValue* function = AddLoadJSBuiltin(Builtins::FILTER_KEY);
Add<HPushArguments>(enumerable, key);
- key = Add<HInvokeFunction>(function, 2);
+ Runtime::FunctionId function_id = Runtime::kForInFilter;
+ key = Add<HCallRuntime>(isolate()->factory()->empty_string(),
+ Runtime::FunctionForId(function_id), 2);
Bind(each_var, key);
Add<HSimulate>(stmt->AssignmentId());
- Add<HCheckHeapObject>(key);
+ IfBuilder if_undefined(this);
+ if_undefined.If<HCompareObjectEqAndBranch>(key,
+ graph()->GetConstantUndefined());
+ if_undefined.ThenDeopt(Deoptimizer::kUndefined);
+ if_undefined.End();
}
BreakAndContinueInfo break_info(stmt, scope(), 5);
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698