| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3687 // The subexpression may have side effects. | 3687 // The subexpression may have side effects. |
| 3688 VisitForEffect(expr->expression()); | 3688 VisitForEffect(expr->expression()); |
| 3689 context()->Plug(true); | 3689 context()->Plug(true); |
| 3690 } else if (var != NULL && | 3690 } else if (var != NULL && |
| 3691 !var->is_global() && | 3691 !var->is_global() && |
| 3692 var->AsSlot() != NULL && | 3692 var->AsSlot() != NULL && |
| 3693 var->AsSlot()->type() != Slot::LOOKUP) { | 3693 var->AsSlot()->type() != Slot::LOOKUP) { |
| 3694 // Result of deleting non-global, non-dynamic variables is false. | 3694 // Result of deleting non-global, non-dynamic variables is false. |
| 3695 // The subexpression does not have side effects. | 3695 // The subexpression does not have side effects. |
| 3696 context()->Plug(false); | 3696 context()->Plug(false); |
| 3697 } else { | 3697 } else if (prop != NULL) { |
| 3698 // Property or variable reference. Call the delete builtin with | 3698 if (prop->is_synthetic()) { |
| 3699 // object and property name as arguments. | 3699 // Result of deleting parameters is false, even when they rewrite |
| 3700 if (prop != NULL) { | 3700 // to accesses on the arguments object. |
| 3701 context()->Plug(false); |
| 3702 } else { |
| 3701 VisitForStackValue(prop->obj()); | 3703 VisitForStackValue(prop->obj()); |
| 3702 VisitForStackValue(prop->key()); | 3704 VisitForStackValue(prop->key()); |
| 3703 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 3705 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 3704 } else if (var->is_global()) { | 3706 context()->Plug(eax); |
| 3705 __ push(GlobalObjectOperand()); | |
| 3706 __ push(Immediate(var->name())); | |
| 3707 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
| 3708 } else { | |
| 3709 // Non-global variable. Call the runtime to delete from the | |
| 3710 // context where the variable was introduced. | |
| 3711 __ push(context_register()); | |
| 3712 __ push(Immediate(var->name())); | |
| 3713 __ CallRuntime(Runtime::kDeleteContextSlot, 2); | |
| 3714 } | 3707 } |
| 3708 } else if (var->is_global()) { |
| 3709 __ push(GlobalObjectOperand()); |
| 3710 __ push(Immediate(var->name())); |
| 3711 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 3712 context()->Plug(eax); |
| 3713 } else { |
| 3714 // Non-global variable. Call the runtime to try to delete from the |
| 3715 // context where the variable was introduced. |
| 3716 __ push(context_register()); |
| 3717 __ push(Immediate(var->name())); |
| 3718 __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
| 3715 context()->Plug(eax); | 3719 context()->Plug(eax); |
| 3716 } | 3720 } |
| 3717 break; | 3721 break; |
| 3718 } | 3722 } |
| 3719 | 3723 |
| 3720 case Token::VOID: { | 3724 case Token::VOID: { |
| 3721 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3725 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
| 3722 VisitForEffect(expr->expression()); | 3726 VisitForEffect(expr->expression()); |
| 3723 context()->Plug(Factory::undefined_value()); | 3727 context()->Plug(Factory::undefined_value()); |
| 3724 break; | 3728 break; |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4375 // And return. | 4379 // And return. |
| 4376 __ ret(0); | 4380 __ ret(0); |
| 4377 } | 4381 } |
| 4378 | 4382 |
| 4379 | 4383 |
| 4380 #undef __ | 4384 #undef __ |
| 4381 | 4385 |
| 4382 } } // namespace v8::internal | 4386 } } // namespace v8::internal |
| 4383 | 4387 |
| 4384 #endif // V8_TARGET_ARCH_IA32 | 4388 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |