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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4637 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4637 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
4638 switch (expr->op()) { | 4638 switch (expr->op()) { |
4639 case Token::DELETE: { | 4639 case Token::DELETE: { |
4640 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 4640 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
4641 Property* property = expr->expression()->AsProperty(); | 4641 Property* property = expr->expression()->AsProperty(); |
4642 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 4642 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
4643 | 4643 |
4644 if (property != NULL) { | 4644 if (property != NULL) { |
4645 VisitForStackValue(property->obj()); | 4645 VisitForStackValue(property->obj()); |
4646 VisitForStackValue(property->key()); | 4646 VisitForStackValue(property->key()); |
4647 __ LoadSmiLiteral(r4, Smi::FromInt(language_mode())); | 4647 __ CallRuntime(is_strict(language_mode()) |
4648 __ push(r4); | 4648 ? Runtime::kDeleteProperty_Strict |
4649 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4649 : Runtime::kDeleteProperty_Sloppy, |
| 4650 2); |
4650 context()->Plug(r3); | 4651 context()->Plug(r3); |
4651 } else if (proxy != NULL) { | 4652 } else if (proxy != NULL) { |
4652 Variable* var = proxy->var(); | 4653 Variable* var = proxy->var(); |
4653 // Delete of an unqualified identifier is disallowed in strict mode but | 4654 // Delete of an unqualified identifier is disallowed in strict mode but |
4654 // "delete this" is allowed. | 4655 // "delete this" is allowed. |
4655 bool is_this = var->HasThisName(isolate()); | 4656 bool is_this = var->HasThisName(isolate()); |
4656 DCHECK(is_sloppy(language_mode()) || is_this); | 4657 DCHECK(is_sloppy(language_mode()) || is_this); |
4657 if (var->IsUnallocatedOrGlobalSlot()) { | 4658 if (var->IsUnallocatedOrGlobalSlot()) { |
4658 __ LoadP(r5, GlobalObjectOperand()); | 4659 __ LoadP(r5, GlobalObjectOperand()); |
4659 __ mov(r4, Operand(var->name())); | 4660 __ mov(r4, Operand(var->name())); |
4660 __ LoadSmiLiteral(r3, Smi::FromInt(SLOPPY)); | 4661 __ Push(r5, r4); |
4661 __ Push(r5, r4, r3); | 4662 __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2); |
4662 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
4663 context()->Plug(r3); | 4663 context()->Plug(r3); |
4664 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4664 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
4665 // Result of deleting non-global, non-dynamic variables is false. | 4665 // Result of deleting non-global, non-dynamic variables is false. |
4666 // The subexpression does not have side effects. | 4666 // The subexpression does not have side effects. |
4667 context()->Plug(is_this); | 4667 context()->Plug(is_this); |
4668 } else { | 4668 } else { |
4669 // Non-global variable. Call the runtime to try to delete from the | 4669 // Non-global variable. Call the runtime to try to delete from the |
4670 // context where the variable was introduced. | 4670 // context where the variable was introduced. |
4671 DCHECK(!context_register().is(r5)); | 4671 DCHECK(!context_register().is(r5)); |
4672 __ mov(r5, Operand(var->name())); | 4672 __ mov(r5, Operand(var->name())); |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5389 return ON_STACK_REPLACEMENT; | 5389 return ON_STACK_REPLACEMENT; |
5390 } | 5390 } |
5391 | 5391 |
5392 DCHECK(interrupt_address == | 5392 DCHECK(interrupt_address == |
5393 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5394 return OSR_AFTER_STACK_CHECK; | 5394 return OSR_AFTER_STACK_CHECK; |
5395 } | 5395 } |
5396 } // namespace internal | 5396 } // namespace internal |
5397 } // namespace v8 | 5397 } // namespace v8 |
5398 #endif // V8_TARGET_ARCH_PPC | 5398 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |