Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 1933af0bcf51601a7ab38480c5dab6600a367e2d..3574f720e3e50d0d62594e84188aeaa140cbc4d7 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -3060,24 +3060,28 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
// Result of deleting non-global, non-dynamic variables is false. |
// The subexpression does not have side effects. |
context()->Plug(false); |
- } else { |
- // Property or variable reference. Call the delete builtin with |
- // object and property name as arguments. |
- if (prop != NULL) { |
+ } else if (prop != NULL) { |
+ if (prop->is_synthetic()) { |
+ // Result of deleting parameters is false, even when they rewrite |
+ // to accesses on the arguments object. |
+ context()->Plug(false); |
+ } else { |
VisitForStackValue(prop->obj()); |
VisitForStackValue(prop->key()); |
__ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
- } else if (var->is_global()) { |
- __ push(GlobalObjectOperand()); |
- __ Push(var->name()); |
- __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
- } else { |
- // Non-global variable. Call the runtime to delete from the |
- // context where the variable was introduced. |
- __ push(context_register()); |
- __ Push(var->name()); |
- __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
+ context()->Plug(rax); |
} |
+ } else if (var->is_global()) { |
+ __ push(GlobalObjectOperand()); |
+ __ Push(var->name()); |
+ __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
+ context()->Plug(rax); |
+ } else { |
+ // Non-global variable. Call the runtime to try to delete from the |
+ // context where the variable was introduced. |
+ __ push(context_register()); |
+ __ Push(var->name()); |
+ __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
context()->Plug(rax); |
} |
break; |