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

Unified Diff: src/hydrogen.cc

Issue 1291973002: [runtime] Remove useless DELETE builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/full-codegen/x87/full-codegen-x87.cc ('k') | src/runtime.js » ('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 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();
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698