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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 4601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4612 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4612 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
4613 switch (expr->op()) { | 4613 switch (expr->op()) { |
4614 case Token::DELETE: { | 4614 case Token::DELETE: { |
4615 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 4615 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
4616 Property* property = expr->expression()->AsProperty(); | 4616 Property* property = expr->expression()->AsProperty(); |
4617 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 4617 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
4618 | 4618 |
4619 if (property != NULL) { | 4619 if (property != NULL) { |
4620 VisitForStackValue(property->obj()); | 4620 VisitForStackValue(property->obj()); |
4621 VisitForStackValue(property->key()); | 4621 VisitForStackValue(property->key()); |
4622 __ mov(r1, Operand(Smi::FromInt(language_mode()))); | 4622 __ CallRuntime(is_strict(language_mode()) |
4623 __ push(r1); | 4623 ? Runtime::kDeleteProperty_Strict |
4624 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4624 : Runtime::kDeleteProperty_Sloppy, |
| 4625 2); |
4625 context()->Plug(r0); | 4626 context()->Plug(r0); |
4626 } else if (proxy != NULL) { | 4627 } else if (proxy != NULL) { |
4627 Variable* var = proxy->var(); | 4628 Variable* var = proxy->var(); |
4628 // Delete of an unqualified identifier is disallowed in strict mode but | 4629 // Delete of an unqualified identifier is disallowed in strict mode but |
4629 // "delete this" is allowed. | 4630 // "delete this" is allowed. |
4630 bool is_this = var->HasThisName(isolate()); | 4631 bool is_this = var->HasThisName(isolate()); |
4631 DCHECK(is_sloppy(language_mode()) || is_this); | 4632 DCHECK(is_sloppy(language_mode()) || is_this); |
4632 if (var->IsUnallocatedOrGlobalSlot()) { | 4633 if (var->IsUnallocatedOrGlobalSlot()) { |
4633 __ ldr(r2, GlobalObjectOperand()); | 4634 __ ldr(r2, GlobalObjectOperand()); |
4634 __ mov(r1, Operand(var->name())); | 4635 __ mov(r1, Operand(var->name())); |
4635 __ mov(r0, Operand(Smi::FromInt(SLOPPY))); | 4636 __ Push(r2, r1); |
4636 __ Push(r2, r1, r0); | 4637 __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2); |
4637 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
4638 context()->Plug(r0); | 4638 context()->Plug(r0); |
4639 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4639 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
4640 // Result of deleting non-global, non-dynamic variables is false. | 4640 // Result of deleting non-global, non-dynamic variables is false. |
4641 // The subexpression does not have side effects. | 4641 // The subexpression does not have side effects. |
4642 context()->Plug(is_this); | 4642 context()->Plug(is_this); |
4643 } else { | 4643 } else { |
4644 // Non-global variable. Call the runtime to try to delete from the | 4644 // Non-global variable. Call the runtime to try to delete from the |
4645 // context where the variable was introduced. | 4645 // context where the variable was introduced. |
4646 DCHECK(!context_register().is(r2)); | 4646 DCHECK(!context_register().is(r2)); |
4647 __ mov(r2, Operand(var->name())); | 4647 __ mov(r2, Operand(var->name())); |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5414 DCHECK(interrupt_address == | 5414 DCHECK(interrupt_address == |
5415 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5415 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5416 return OSR_AFTER_STACK_CHECK; | 5416 return OSR_AFTER_STACK_CHECK; |
5417 } | 5417 } |
5418 | 5418 |
5419 | 5419 |
5420 } // namespace internal | 5420 } // namespace internal |
5421 } // namespace v8 | 5421 } // namespace v8 |
5422 | 5422 |
5423 #endif // V8_TARGET_ARCH_ARM | 5423 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |