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); |