| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 4296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4307 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 4307 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 4308 switch (expr->op()) { | 4308 switch (expr->op()) { |
| 4309 case Token::DELETE: { | 4309 case Token::DELETE: { |
| 4310 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 4310 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
| 4311 Property* property = expr->expression()->AsProperty(); | 4311 Property* property = expr->expression()->AsProperty(); |
| 4312 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 4312 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 4313 | 4313 |
| 4314 if (property != NULL) { | 4314 if (property != NULL) { |
| 4315 VisitForStackValue(property->obj()); | 4315 VisitForStackValue(property->obj()); |
| 4316 VisitForStackValue(property->key()); | 4316 VisitForStackValue(property->key()); |
| 4317 __ Mov(x10, Smi::FromInt(language_mode())); | 4317 __ CallRuntime(is_strict(language_mode()) |
| 4318 __ Push(x10); | 4318 ? Runtime::kDeleteProperty_Strict |
| 4319 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4319 : Runtime::kDeleteProperty_Sloppy, |
| 4320 2); |
| 4320 context()->Plug(x0); | 4321 context()->Plug(x0); |
| 4321 } else if (proxy != NULL) { | 4322 } else if (proxy != NULL) { |
| 4322 Variable* var = proxy->var(); | 4323 Variable* var = proxy->var(); |
| 4323 // Delete of an unqualified identifier is disallowed in strict mode but | 4324 // Delete of an unqualified identifier is disallowed in strict mode but |
| 4324 // "delete this" is allowed. | 4325 // "delete this" is allowed. |
| 4325 bool is_this = var->HasThisName(isolate()); | 4326 bool is_this = var->HasThisName(isolate()); |
| 4326 DCHECK(is_sloppy(language_mode()) || is_this); | 4327 DCHECK(is_sloppy(language_mode()) || is_this); |
| 4327 if (var->IsUnallocatedOrGlobalSlot()) { | 4328 if (var->IsUnallocatedOrGlobalSlot()) { |
| 4328 __ Ldr(x12, GlobalObjectMemOperand()); | 4329 __ Ldr(x12, GlobalObjectMemOperand()); |
| 4329 __ Mov(x11, Operand(var->name())); | 4330 __ Mov(x11, Operand(var->name())); |
| 4330 __ Mov(x10, Smi::FromInt(SLOPPY)); | 4331 __ Push(x12, x11); |
| 4331 __ Push(x12, x11, x10); | 4332 __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2); |
| 4332 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
| 4333 context()->Plug(x0); | 4333 context()->Plug(x0); |
| 4334 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4334 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
| 4335 // Result of deleting non-global, non-dynamic variables is false. | 4335 // Result of deleting non-global, non-dynamic variables is false. |
| 4336 // The subexpression does not have side effects. | 4336 // The subexpression does not have side effects. |
| 4337 context()->Plug(is_this); | 4337 context()->Plug(is_this); |
| 4338 } else { | 4338 } else { |
| 4339 // Non-global variable. Call the runtime to try to delete from the | 4339 // Non-global variable. Call the runtime to try to delete from the |
| 4340 // context where the variable was introduced. | 4340 // context where the variable was introduced. |
| 4341 __ Mov(x2, Operand(var->name())); | 4341 __ Mov(x2, Operand(var->name())); |
| 4342 __ Push(context_register(), x2); | 4342 __ Push(context_register(), x2); |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5400 } | 5400 } |
| 5401 | 5401 |
| 5402 return INTERRUPT; | 5402 return INTERRUPT; |
| 5403 } | 5403 } |
| 5404 | 5404 |
| 5405 | 5405 |
| 5406 } // namespace internal | 5406 } // namespace internal |
| 5407 } // namespace v8 | 5407 } // namespace v8 |
| 5408 | 5408 |
| 5409 #endif // V8_TARGET_ARCH_ARM64 | 5409 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |