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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2140 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 2140 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
2141 switch (expr->op()) { | 2141 switch (expr->op()) { |
2142 case Token::DELETE: { | 2142 case Token::DELETE: { |
2143 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 2143 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
2144 Property* property = expr->expression()->AsProperty(); | 2144 Property* property = expr->expression()->AsProperty(); |
2145 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 2145 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
2146 | 2146 |
2147 if (property != NULL) { | 2147 if (property != NULL) { |
2148 VisitForStackValue(property->obj()); | 2148 VisitForStackValue(property->obj()); |
2149 VisitForStackValue(property->key()); | 2149 VisitForStackValue(property->key()); |
2150 CallRuntimeWithOperands(is_strict(language_mode()) | 2150 PushOperand(Smi::FromInt(language_mode())); |
2151 ? Runtime::kDeleteProperty_Strict | 2151 CallRuntimeWithOperands(Runtime::kDeleteProperty); |
2152 : Runtime::kDeleteProperty_Sloppy); | |
2153 context()->Plug(eax); | 2152 context()->Plug(eax); |
2154 } else if (proxy != NULL) { | 2153 } else if (proxy != NULL) { |
2155 Variable* var = proxy->var(); | 2154 Variable* var = proxy->var(); |
2156 // Delete of an unqualified identifier is disallowed in strict mode but | 2155 // Delete of an unqualified identifier is disallowed in strict mode but |
2157 // "delete this" is allowed. | 2156 // "delete this" is allowed. |
2158 bool is_this = var->is_this(); | 2157 bool is_this = var->is_this(); |
2159 DCHECK(is_sloppy(language_mode()) || is_this); | 2158 DCHECK(is_sloppy(language_mode()) || is_this); |
2160 if (var->IsUnallocated()) { | 2159 if (var->IsUnallocated()) { |
2161 __ mov(eax, NativeContextOperand()); | 2160 __ mov(eax, NativeContextOperand()); |
2162 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); | 2161 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); |
2163 __ push(Immediate(var->name())); | 2162 __ push(Immediate(var->name())); |
2164 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); | 2163 __ Push(Smi::FromInt(SLOPPY)); |
| 2164 __ CallRuntime(Runtime::kDeleteProperty); |
2165 context()->Plug(eax); | 2165 context()->Plug(eax); |
2166 } else { | 2166 } else { |
2167 DCHECK(!var->IsLookupSlot()); | 2167 DCHECK(!var->IsLookupSlot()); |
2168 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2168 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
2169 // Result of deleting non-global variables is false. 'this' is | 2169 // Result of deleting non-global variables is false. 'this' is |
2170 // not really a variable, though we implement it as one. The | 2170 // not really a variable, though we implement it as one. The |
2171 // subexpression does not have side effects. | 2171 // subexpression does not have side effects. |
2172 context()->Plug(is_this); | 2172 context()->Plug(is_this); |
2173 } | 2173 } |
2174 } else { | 2174 } else { |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2747 isolate->builtins()->OnStackReplacement()->entry(), | 2747 isolate->builtins()->OnStackReplacement()->entry(), |
2748 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2748 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2749 return ON_STACK_REPLACEMENT; | 2749 return ON_STACK_REPLACEMENT; |
2750 } | 2750 } |
2751 | 2751 |
2752 | 2752 |
2753 } // namespace internal | 2753 } // namespace internal |
2754 } // namespace v8 | 2754 } // namespace v8 |
2755 | 2755 |
2756 #endif // V8_TARGET_ARCH_X87 | 2756 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |