| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 2241 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 2242 switch (expr->op()) { | 2242 switch (expr->op()) { |
| 2243 case Token::DELETE: { | 2243 case Token::DELETE: { |
| 2244 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 2244 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
| 2245 Property* property = expr->expression()->AsProperty(); | 2245 Property* property = expr->expression()->AsProperty(); |
| 2246 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 2246 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 2247 | 2247 |
| 2248 if (property != NULL) { | 2248 if (property != NULL) { |
| 2249 VisitForStackValue(property->obj()); | 2249 VisitForStackValue(property->obj()); |
| 2250 VisitForStackValue(property->key()); | 2250 VisitForStackValue(property->key()); |
| 2251 CallRuntimeWithOperands(is_strict(language_mode()) | 2251 PushOperand(Smi::FromInt(language_mode())); |
| 2252 ? Runtime::kDeleteProperty_Strict | 2252 CallRuntimeWithOperands(Runtime::kDeleteProperty); |
| 2253 : Runtime::kDeleteProperty_Sloppy); | |
| 2254 context()->Plug(r3); | 2253 context()->Plug(r3); |
| 2255 } else if (proxy != NULL) { | 2254 } else if (proxy != NULL) { |
| 2256 Variable* var = proxy->var(); | 2255 Variable* var = proxy->var(); |
| 2257 // Delete of an unqualified identifier is disallowed in strict mode but | 2256 // Delete of an unqualified identifier is disallowed in strict mode but |
| 2258 // "delete this" is allowed. | 2257 // "delete this" is allowed. |
| 2259 bool is_this = var->is_this(); | 2258 bool is_this = var->is_this(); |
| 2260 DCHECK(is_sloppy(language_mode()) || is_this); | 2259 DCHECK(is_sloppy(language_mode()) || is_this); |
| 2261 if (var->IsUnallocated()) { | 2260 if (var->IsUnallocated()) { |
| 2262 __ LoadGlobalObject(r5); | 2261 __ LoadGlobalObject(r5); |
| 2263 __ mov(r4, Operand(var->name())); | 2262 __ mov(r4, Operand(var->name())); |
| 2264 __ Push(r5, r4); | 2263 __ Push(r5, r4); |
| 2265 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); | 2264 __ Push(Smi::FromInt(SLOPPY)); |
| 2265 __ CallRuntime(Runtime::kDeleteProperty); |
| 2266 context()->Plug(r3); | 2266 context()->Plug(r3); |
| 2267 } else { | 2267 } else { |
| 2268 DCHECK(!var->IsLookupSlot()); | 2268 DCHECK(!var->IsLookupSlot()); |
| 2269 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2269 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2270 // Result of deleting non-global, non-dynamic variables is false. | 2270 // Result of deleting non-global, non-dynamic variables is false. |
| 2271 // The subexpression does not have side effects. | 2271 // The subexpression does not have side effects. |
| 2272 context()->Plug(is_this); | 2272 context()->Plug(is_this); |
| 2273 } | 2273 } |
| 2274 } else { | 2274 } else { |
| 2275 // Result of deleting non-property, non-variable reference is true. | 2275 // Result of deleting non-property, non-variable reference is true. |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2824 | 2824 |
| 2825 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 2825 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 2826 | 2826 |
| 2827 DCHECK(interrupt_address == | 2827 DCHECK(interrupt_address == |
| 2828 isolate->builtins()->OnStackReplacement()->entry()); | 2828 isolate->builtins()->OnStackReplacement()->entry()); |
| 2829 return ON_STACK_REPLACEMENT; | 2829 return ON_STACK_REPLACEMENT; |
| 2830 } | 2830 } |
| 2831 } // namespace internal | 2831 } // namespace internal |
| 2832 } // namespace v8 | 2832 } // namespace v8 |
| 2833 #endif // V8_TARGET_ARCH_PPC | 2833 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |