Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 9b2a2f6a078341f7cacbc40eaec9557450444801..d5868f399f0cc02d72d497fa3309175b250d4c6c 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10410,11 +10410,13 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) { |
CHECK_ALIVE(VisitForValue(prop->key())); |
HValue* key = Pop(); |
HValue* obj = Pop(); |
- HValue* function = AddLoadJSBuiltin(Builtins::DELETE); |
- Add<HPushArguments>(obj, key, Add<HConstant>(function_language_mode())); |
- // TODO(olivf) InvokeFunction produces a check for the parameter count, |
- // even though we are certain to pass the correct number of arguments here. |
- HInstruction* instr = New<HInvokeFunction>(function, 3); |
+ Add<HPushArguments>(obj, key); |
+ HInstruction* instr = New<HCallRuntime>( |
+ isolate()->factory()->empty_string(), |
+ Runtime::FunctionForId(is_strict(function_language_mode()) |
+ ? Runtime::kDeleteProperty_Strict |
+ : Runtime::kDeleteProperty_Sloppy), |
+ 2); |
return ast_context()->ReturnInstruction(instr, expr->id()); |
} else if (proxy != NULL) { |
Variable* var = proxy->var(); |