| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2252 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 2252 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 2253 switch (expr->op()) { | 2253 switch (expr->op()) { |
| 2254 case Token::DELETE: { | 2254 case Token::DELETE: { |
| 2255 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 2255 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
| 2256 Property* property = expr->expression()->AsProperty(); | 2256 Property* property = expr->expression()->AsProperty(); |
| 2257 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 2257 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 2258 | 2258 |
| 2259 if (property != NULL) { | 2259 if (property != NULL) { |
| 2260 VisitForStackValue(property->obj()); | 2260 VisitForStackValue(property->obj()); |
| 2261 VisitForStackValue(property->key()); | 2261 VisitForStackValue(property->key()); |
| 2262 CallRuntimeWithOperands(is_strict(language_mode()) | 2262 PushOperand(Smi::FromInt(language_mode())); |
| 2263 ? Runtime::kDeleteProperty_Strict | 2263 CallRuntimeWithOperands(Runtime::kDeleteProperty); |
| 2264 : Runtime::kDeleteProperty_Sloppy); | |
| 2265 context()->Plug(v0); | 2264 context()->Plug(v0); |
| 2266 } else if (proxy != NULL) { | 2265 } else if (proxy != NULL) { |
| 2267 Variable* var = proxy->var(); | 2266 Variable* var = proxy->var(); |
| 2268 // Delete of an unqualified identifier is disallowed in strict mode but | 2267 // Delete of an unqualified identifier is disallowed in strict mode but |
| 2269 // "delete this" is allowed. | 2268 // "delete this" is allowed. |
| 2270 bool is_this = var->is_this(); | 2269 bool is_this = var->is_this(); |
| 2271 DCHECK(is_sloppy(language_mode()) || is_this); | 2270 DCHECK(is_sloppy(language_mode()) || is_this); |
| 2272 if (var->IsUnallocated()) { | 2271 if (var->IsUnallocated()) { |
| 2273 __ LoadGlobalObject(a2); | 2272 __ LoadGlobalObject(a2); |
| 2274 __ li(a1, Operand(var->name())); | 2273 __ li(a1, Operand(var->name())); |
| 2275 __ Push(a2, a1); | 2274 __ Push(a2, a1); |
| 2276 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); | 2275 __ Push(Smi::FromInt(SLOPPY)); |
| 2276 __ CallRuntime(Runtime::kDeleteProperty); |
| 2277 context()->Plug(v0); | 2277 context()->Plug(v0); |
| 2278 } else { | 2278 } else { |
| 2279 DCHECK(!var->IsLookupSlot()); | 2279 DCHECK(!var->IsLookupSlot()); |
| 2280 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2280 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2281 // Result of deleting non-global, non-dynamic variables is false. | 2281 // Result of deleting non-global, non-dynamic variables is false. |
| 2282 // The subexpression does not have side effects. | 2282 // The subexpression does not have side effects. |
| 2283 context()->Plug(is_this); | 2283 context()->Plug(is_this); |
| 2284 } | 2284 } |
| 2285 } else { | 2285 } else { |
| 2286 // Result of deleting non-property, non-variable reference is true. | 2286 // Result of deleting non-property, non-variable reference is true. |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2846 reinterpret_cast<uint32_t>( | 2846 reinterpret_cast<uint32_t>( |
| 2847 isolate->builtins()->OnStackReplacement()->entry())); | 2847 isolate->builtins()->OnStackReplacement()->entry())); |
| 2848 return ON_STACK_REPLACEMENT; | 2848 return ON_STACK_REPLACEMENT; |
| 2849 } | 2849 } |
| 2850 | 2850 |
| 2851 | 2851 |
| 2852 } // namespace internal | 2852 } // namespace internal |
| 2853 } // namespace v8 | 2853 } // namespace v8 |
| 2854 | 2854 |
| 2855 #endif // V8_TARGET_ARCH_MIPS | 2855 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |