OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5837 // LoadCondition may (and usually does) leave a test and branch to | 5837 // LoadCondition may (and usually does) leave a test and branch to |
5838 // be emitted by the caller. In that case, negate the condition. | 5838 // be emitted by the caller. In that case, negate the condition. |
5839 if (has_cc()) cc_reg_ = NegateCondition(cc_reg_); | 5839 if (has_cc()) cc_reg_ = NegateCondition(cc_reg_); |
5840 | 5840 |
5841 } else if (op == Token::DELETE) { | 5841 } else if (op == Token::DELETE) { |
5842 Property* property = node->expression()->AsProperty(); | 5842 Property* property = node->expression()->AsProperty(); |
5843 Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); | 5843 Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); |
5844 if (property != NULL) { | 5844 if (property != NULL) { |
5845 Load(property->obj()); | 5845 Load(property->obj()); |
5846 Load(property->key()); | 5846 Load(property->key()); |
5847 frame_->InvokeBuiltin(Builtins::DELETE, CALL_JS, 2); | 5847 frame_->EmitPush(Operand(Smi::FromInt(strict_mode_flag()))); |
5848 frame_->InvokeBuiltin(Builtins::DELETE, CALL_JS, 3); | |
5848 frame_->EmitPush(r0); | 5849 frame_->EmitPush(r0); |
5849 | 5850 |
5850 } else if (variable != NULL) { | 5851 } else if (variable != NULL) { |
5852 ASSERT(strict_mode_flag() == kNonStrictMode); | |
Martin Maly
2011/02/14 05:15:22
"delete foo" is disallowed in strict mode so we ca
Mads Ager (chromium)
2011/02/14 10:27:24
And 'this' rewrites to a slot, right?
Also, could
Kevin Millikin (Chromium)
2011/02/14 11:56:55
It just doesn't rewrite to a property reference (g
Martin Maly
2011/02/14 21:46:51
Yes, this rewrites to a slot.
Added comment.
| |
5851 Slot* slot = variable->AsSlot(); | 5853 Slot* slot = variable->AsSlot(); |
5852 if (variable->is_global()) { | 5854 if (variable->is_global()) { |
5853 LoadGlobal(); | 5855 LoadGlobal(); |
5854 frame_->EmitPush(Operand(variable->name())); | 5856 frame_->EmitPush(Operand(variable->name())); |
5855 frame_->InvokeBuiltin(Builtins::DELETE, CALL_JS, 2); | 5857 frame_->EmitPush(Operand(Smi::FromInt(kNonStrictMode))); |
5858 frame_->InvokeBuiltin(Builtins::DELETE, CALL_JS, 3); | |
5856 frame_->EmitPush(r0); | 5859 frame_->EmitPush(r0); |
5857 | 5860 |
5858 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { | 5861 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { |
5859 // Delete from the context holding the named variable. | 5862 // Delete from the context holding the named variable. |
5860 frame_->EmitPush(cp); | 5863 frame_->EmitPush(cp); |
5861 frame_->EmitPush(Operand(variable->name())); | 5864 frame_->EmitPush(Operand(variable->name())); |
5862 frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); | 5865 frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); |
5863 frame_->EmitPush(r0); | 5866 frame_->EmitPush(r0); |
5864 | 5867 |
5865 } else { | 5868 } else { |
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7370 BinaryOpIC::GetName(runtime_operands_type_)); | 7373 BinaryOpIC::GetName(runtime_operands_type_)); |
7371 return name_; | 7374 return name_; |
7372 } | 7375 } |
7373 | 7376 |
7374 | 7377 |
7375 #undef __ | 7378 #undef __ |
7376 | 7379 |
7377 } } // namespace v8::internal | 7380 } } // namespace v8::internal |
7378 | 7381 |
7379 #endif // V8_TARGET_ARCH_ARM | 7382 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |