OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 2150 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
2151 switch (expr->op()) { | 2151 switch (expr->op()) { |
2152 case Token::DELETE: { | 2152 case Token::DELETE: { |
2153 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 2153 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
2154 Property* property = expr->expression()->AsProperty(); | 2154 Property* property = expr->expression()->AsProperty(); |
2155 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 2155 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
2156 | 2156 |
2157 if (property != NULL) { | 2157 if (property != NULL) { |
2158 VisitForStackValue(property->obj()); | 2158 VisitForStackValue(property->obj()); |
2159 VisitForStackValue(property->key()); | 2159 VisitForStackValue(property->key()); |
2160 CallRuntimeWithOperands(is_strict(language_mode()) | 2160 PushOperand(Smi::FromInt(language_mode())); |
2161 ? Runtime::kDeleteProperty_Strict | 2161 CallRuntimeWithOperands(Runtime::kDeleteProperty); |
2162 : Runtime::kDeleteProperty_Sloppy); | |
2163 context()->Plug(eax); | 2162 context()->Plug(eax); |
2164 } else if (proxy != NULL) { | 2163 } else if (proxy != NULL) { |
2165 Variable* var = proxy->var(); | 2164 Variable* var = proxy->var(); |
2166 // Delete of an unqualified identifier is disallowed in strict mode but | 2165 // Delete of an unqualified identifier is disallowed in strict mode but |
2167 // "delete this" is allowed. | 2166 // "delete this" is allowed. |
2168 bool is_this = var->is_this(); | 2167 bool is_this = var->is_this(); |
2169 DCHECK(is_sloppy(language_mode()) || is_this); | 2168 DCHECK(is_sloppy(language_mode()) || is_this); |
2170 if (var->IsUnallocated()) { | 2169 if (var->IsUnallocated()) { |
2171 __ mov(eax, NativeContextOperand()); | 2170 __ mov(eax, NativeContextOperand()); |
2172 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); | 2171 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); |
2173 __ push(Immediate(var->name())); | 2172 __ push(Immediate(var->name())); |
2174 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); | 2173 __ Push(Smi::FromInt(SLOPPY)); |
| 2174 __ CallRuntime(Runtime::kDeleteProperty); |
2175 context()->Plug(eax); | 2175 context()->Plug(eax); |
2176 } else { | 2176 } else { |
2177 DCHECK(!var->IsLookupSlot()); | 2177 DCHECK(!var->IsLookupSlot()); |
2178 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2178 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
2179 // Result of deleting non-global variables is false. 'this' is | 2179 // Result of deleting non-global variables is false. 'this' is |
2180 // not really a variable, though we implement it as one. The | 2180 // not really a variable, though we implement it as one. The |
2181 // subexpression does not have side effects. | 2181 // subexpression does not have side effects. |
2182 context()->Plug(is_this); | 2182 context()->Plug(is_this); |
2183 } | 2183 } |
2184 } else { | 2184 } else { |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2757 isolate->builtins()->OnStackReplacement()->entry(), | 2757 isolate->builtins()->OnStackReplacement()->entry(), |
2758 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2758 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2759 return ON_STACK_REPLACEMENT; | 2759 return ON_STACK_REPLACEMENT; |
2760 } | 2760 } |
2761 | 2761 |
2762 | 2762 |
2763 } // namespace internal | 2763 } // namespace internal |
2764 } // namespace v8 | 2764 } // namespace v8 |
2765 | 2765 |
2766 #endif // V8_TARGET_ARCH_IA32 | 2766 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |