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 4623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4634 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4634 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
4635 switch (expr->op()) { | 4635 switch (expr->op()) { |
4636 case Token::DELETE: { | 4636 case Token::DELETE: { |
4637 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 4637 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
4638 Property* property = expr->expression()->AsProperty(); | 4638 Property* property = expr->expression()->AsProperty(); |
4639 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 4639 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
4640 | 4640 |
4641 if (property != NULL) { | 4641 if (property != NULL) { |
4642 VisitForStackValue(property->obj()); | 4642 VisitForStackValue(property->obj()); |
4643 VisitForStackValue(property->key()); | 4643 VisitForStackValue(property->key()); |
4644 __ li(a1, Operand(Smi::FromInt(language_mode()))); | 4644 __ CallRuntime(is_strict(language_mode()) |
4645 __ push(a1); | 4645 ? Runtime::kDeleteProperty_Strict |
4646 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4646 : Runtime::kDeleteProperty_Sloppy, |
| 4647 2); |
4647 context()->Plug(v0); | 4648 context()->Plug(v0); |
4648 } else if (proxy != NULL) { | 4649 } else if (proxy != NULL) { |
4649 Variable* var = proxy->var(); | 4650 Variable* var = proxy->var(); |
4650 // Delete of an unqualified identifier is disallowed in strict mode but | 4651 // Delete of an unqualified identifier is disallowed in strict mode but |
4651 // "delete this" is allowed. | 4652 // "delete this" is allowed. |
4652 bool is_this = var->HasThisName(isolate()); | 4653 bool is_this = var->HasThisName(isolate()); |
4653 DCHECK(is_sloppy(language_mode()) || is_this); | 4654 DCHECK(is_sloppy(language_mode()) || is_this); |
4654 if (var->IsUnallocatedOrGlobalSlot()) { | 4655 if (var->IsUnallocatedOrGlobalSlot()) { |
4655 __ lw(a2, GlobalObjectOperand()); | 4656 __ lw(a2, GlobalObjectOperand()); |
4656 __ li(a1, Operand(var->name())); | 4657 __ li(a1, Operand(var->name())); |
4657 __ li(a0, Operand(Smi::FromInt(SLOPPY))); | 4658 __ Push(a2, a1); |
4658 __ Push(a2, a1, a0); | 4659 __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2); |
4659 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
4660 context()->Plug(v0); | 4660 context()->Plug(v0); |
4661 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4661 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
4662 // Result of deleting non-global, non-dynamic variables is false. | 4662 // Result of deleting non-global, non-dynamic variables is false. |
4663 // The subexpression does not have side effects. | 4663 // The subexpression does not have side effects. |
4664 context()->Plug(is_this); | 4664 context()->Plug(is_this); |
4665 } else { | 4665 } else { |
4666 // Non-global variable. Call the runtime to try to delete from the | 4666 // Non-global variable. Call the runtime to try to delete from the |
4667 // context where the variable was introduced. | 4667 // context where the variable was introduced. |
4668 DCHECK(!context_register().is(a2)); | 4668 DCHECK(!context_register().is(a2)); |
4669 __ li(a2, Operand(var->name())); | 4669 __ li(a2, Operand(var->name())); |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5376 reinterpret_cast<uint32_t>( | 5376 reinterpret_cast<uint32_t>( |
5377 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5377 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5378 return OSR_AFTER_STACK_CHECK; | 5378 return OSR_AFTER_STACK_CHECK; |
5379 } | 5379 } |
5380 | 5380 |
5381 | 5381 |
5382 } // namespace internal | 5382 } // namespace internal |
5383 } // namespace v8 | 5383 } // namespace v8 |
5384 | 5384 |
5385 #endif // V8_TARGET_ARCH_MIPS | 5385 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |