| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 18c9319c62006a243d48613cd3149e12e47c5ae2..b7bf9f528f9ef98740044b1327f4418a5a2f1ef9 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -3711,19 +3711,8 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
|
| Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
|
| Property* prop = expr->expression()->AsProperty();
|
| Variable* var = expr->expression()->AsVariableProxy()->AsVariable();
|
| - if (prop == NULL && var == NULL) {
|
| - // Result of deleting non-property, non-variable reference is true.
|
| - // The subexpression may have side effects.
|
| - VisitForEffect(expr->expression());
|
| - context()->Plug(true);
|
| - } else if (var != NULL &&
|
| - !var->is_global() &&
|
| - var->AsSlot() != NULL &&
|
| - var->AsSlot()->type() != Slot::LOOKUP) {
|
| - // Result of deleting non-global, non-dynamic variables is false.
|
| - // The subexpression does not have side effects.
|
| - context()->Plug(false);
|
| - } else if (prop != NULL) {
|
| +
|
| + if (prop != NULL) {
|
| if (prop->is_synthetic()) {
|
| // Result of deleting parameters is false, even when they rewrite
|
| // to accesses on the arguments object.
|
| @@ -3734,18 +3723,30 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
|
| __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
|
| context()->Plug(eax);
|
| }
|
| - } else if (var->is_global()) {
|
| - __ push(GlobalObjectOperand());
|
| - __ push(Immediate(var->name()));
|
| - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
|
| - context()->Plug(eax);
|
| + } else if (var != NULL) {
|
| + if (var->is_global()) {
|
| + __ push(GlobalObjectOperand());
|
| + __ push(Immediate(var->name()));
|
| + __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
|
| + context()->Plug(eax);
|
| + } else if (var->AsSlot() != NULL &&
|
| + var->AsSlot()->type() != Slot::LOOKUP) {
|
| + // Result of deleting non-global, non-dynamic variables is false.
|
| + // The subexpression does not have side effects.
|
| + context()->Plug(false);
|
| + } else {
|
| + // Non-global variable. Call the runtime to try to delete from the
|
| + // context where the variable was introduced.
|
| + __ push(context_register());
|
| + __ push(Immediate(var->name()));
|
| + __ CallRuntime(Runtime::kDeleteContextSlot, 2);
|
| + context()->Plug(eax);
|
| + }
|
| } else {
|
| - // Non-global variable. Call the runtime to try to delete from the
|
| - // context where the variable was introduced.
|
| - __ push(context_register());
|
| - __ push(Immediate(var->name()));
|
| - __ CallRuntime(Runtime::kDeleteContextSlot, 2);
|
| - context()->Plug(eax);
|
| + // Result of deleting non-property, non-variable reference is true.
|
| + // The subexpression may have side effects.
|
| + VisitForEffect(expr->expression());
|
| + context()->Plug(true);
|
| }
|
| break;
|
| }
|
|
|