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 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3736 context()->Plug(false); | 3736 context()->Plug(false); |
3737 } else { | 3737 } else { |
3738 VisitForStackValue(prop->obj()); | 3738 VisitForStackValue(prop->obj()); |
3739 VisitForStackValue(prop->key()); | 3739 VisitForStackValue(prop->key()); |
3740 __ push(Immediate(Smi::FromInt(strict_mode_flag()))); | 3740 __ push(Immediate(Smi::FromInt(strict_mode_flag()))); |
3741 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 3741 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
3742 context()->Plug(eax); | 3742 context()->Plug(eax); |
3743 } | 3743 } |
3744 } else if (var != NULL) { | 3744 } else if (var != NULL) { |
3745 // Delete of an unqualified identifier is disallowed in strict mode | 3745 // Delete of an unqualified identifier is disallowed in strict mode |
3746 // so this code can only be reached in non-strict mode. | 3746 // (but "delete this" is). |
3747 ASSERT(strict_mode_flag() == kNonStrictMode); | 3747 ASSERT(strict_mode_flag() == kNonStrictMode || var->is_this()); |
3748 if (var->is_global()) { | 3748 if (var->is_global()) { |
3749 __ push(GlobalObjectOperand()); | 3749 __ push(GlobalObjectOperand()); |
3750 __ push(Immediate(var->name())); | 3750 __ push(Immediate(var->name())); |
3751 __ push(Immediate(Smi::FromInt(kNonStrictMode))); | 3751 __ push(Immediate(Smi::FromInt(kNonStrictMode))); |
3752 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 3752 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
3753 context()->Plug(eax); | 3753 context()->Plug(eax); |
3754 } else if (var->AsSlot() != NULL && | 3754 } else if (var->AsSlot() != NULL && |
3755 var->AsSlot()->type() != Slot::LOOKUP) { | 3755 var->AsSlot()->type() != Slot::LOOKUP) { |
3756 // Result of deleting non-global, non-dynamic variables is false. | 3756 // Result of deleting non-global, non-dynamic variables is false. |
3757 // The subexpression does not have side effects. | 3757 // The subexpression does not have side effects. |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4435 // And return. | 4435 // And return. |
4436 __ ret(0); | 4436 __ ret(0); |
4437 } | 4437 } |
4438 | 4438 |
4439 | 4439 |
4440 #undef __ | 4440 #undef __ |
4441 | 4441 |
4442 } } // namespace v8::internal | 4442 } } // namespace v8::internal |
4443 | 4443 |
4444 #endif // V8_TARGET_ARCH_IA32 | 4444 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |