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 3671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3682 var->AsSlot()->type() != Slot::LOOKUP) { | 3682 var->AsSlot()->type() != Slot::LOOKUP) { |
3683 // Result of deleting non-global, non-dynamic variables is false. | 3683 // Result of deleting non-global, non-dynamic variables is false. |
3684 // The subexpression does not have side effects. | 3684 // The subexpression does not have side effects. |
3685 context()->Plug(false); | 3685 context()->Plug(false); |
3686 } else { | 3686 } else { |
3687 // Property or variable reference. Call the delete builtin with | 3687 // Property or variable reference. Call the delete builtin with |
3688 // object and property name as arguments. | 3688 // object and property name as arguments. |
3689 if (prop != NULL) { | 3689 if (prop != NULL) { |
3690 VisitForStackValue(prop->obj()); | 3690 VisitForStackValue(prop->obj()); |
3691 VisitForStackValue(prop->key()); | 3691 VisitForStackValue(prop->key()); |
| 3692 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
3692 } else if (var->is_global()) { | 3693 } else if (var->is_global()) { |
3693 __ push(GlobalObjectOperand()); | 3694 __ push(GlobalObjectOperand()); |
3694 __ push(Immediate(var->name())); | 3695 __ push(Immediate(var->name())); |
| 3696 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
3695 } else { | 3697 } else { |
3696 // Non-global variable. Call the runtime to look up the context | 3698 // Non-global variable. Call the runtime to delete from the |
3697 // where the variable was introduced. | 3699 // context where the variable was introduced. |
3698 __ push(context_register()); | 3700 __ push(context_register()); |
3699 __ push(Immediate(var->name())); | 3701 __ push(Immediate(var->name())); |
3700 __ CallRuntime(Runtime::kLookupContext, 2); | 3702 __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
3701 __ push(eax); | |
3702 __ push(Immediate(var->name())); | |
3703 } | 3703 } |
3704 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
3705 context()->Plug(eax); | 3704 context()->Plug(eax); |
3706 } | 3705 } |
3707 break; | 3706 break; |
3708 } | 3707 } |
3709 | 3708 |
3710 case Token::VOID: { | 3709 case Token::VOID: { |
3711 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3710 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
3712 VisitForEffect(expr->expression()); | 3711 VisitForEffect(expr->expression()); |
3713 context()->Plug(Factory::undefined_value()); | 3712 context()->Plug(Factory::undefined_value()); |
3714 break; | 3713 break; |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4365 // And return. | 4364 // And return. |
4366 __ ret(0); | 4365 __ ret(0); |
4367 } | 4366 } |
4368 | 4367 |
4369 | 4368 |
4370 #undef __ | 4369 #undef __ |
4371 | 4370 |
4372 } } // namespace v8::internal | 4371 } } // namespace v8::internal |
4373 | 4372 |
4374 #endif // V8_TARGET_ARCH_IA32 | 4373 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |