| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 Comment cmnt(masm_, "[ Declarations"); | 347 Comment cmnt(masm_, "[ Declarations"); |
| 348 scope()->VisitIllegalRedeclaration(this); | 348 scope()->VisitIllegalRedeclaration(this); |
| 349 | 349 |
| 350 } else { | 350 } else { |
| 351 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 351 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
| 352 { Comment cmnt(masm_, "[ Declarations"); | 352 { Comment cmnt(masm_, "[ Declarations"); |
| 353 if (scope()->is_function_scope() && scope()->function() != NULL) { | 353 if (scope()->is_function_scope() && scope()->function() != NULL) { |
| 354 VariableDeclaration* function = scope()->function(); | 354 VariableDeclaration* function = scope()->function(); |
| 355 DCHECK(function->proxy()->var()->mode() == CONST || | 355 DCHECK(function->proxy()->var()->mode() == CONST || |
| 356 function->proxy()->var()->mode() == CONST_LEGACY); | 356 function->proxy()->var()->mode() == CONST_LEGACY); |
| 357 DCHECK(function->proxy()->var()->location() != Variable::UNALLOCATED); | 357 DCHECK(!function->proxy()->var()->IsUnallocatedOrGlobalSlot()); |
| 358 VisitVariableDeclaration(function); | 358 VisitVariableDeclaration(function); |
| 359 } | 359 } |
| 360 VisitDeclarations(scope()->declarations()); | 360 VisitDeclarations(scope()->declarations()); |
| 361 } | 361 } |
| 362 | 362 |
| 363 { | 363 { |
| 364 Comment cmnt(masm_, "[ Stack check"); | 364 Comment cmnt(masm_, "[ Stack check"); |
| 365 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 365 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
| 366 Label ok; | 366 Label ok; |
| 367 DCHECK(jssp.Is(__ StackPointer())); | 367 DCHECK(jssp.Is(__ StackPointer())); |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 VariableDeclaration* declaration) { | 866 VariableDeclaration* declaration) { |
| 867 // If it was not possible to allocate the variable at compile time, we | 867 // If it was not possible to allocate the variable at compile time, we |
| 868 // need to "declare" it at runtime to make sure it actually exists in the | 868 // need to "declare" it at runtime to make sure it actually exists in the |
| 869 // local context. | 869 // local context. |
| 870 VariableProxy* proxy = declaration->proxy(); | 870 VariableProxy* proxy = declaration->proxy(); |
| 871 VariableMode mode = declaration->mode(); | 871 VariableMode mode = declaration->mode(); |
| 872 Variable* variable = proxy->var(); | 872 Variable* variable = proxy->var(); |
| 873 bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; | 873 bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; |
| 874 | 874 |
| 875 switch (variable->location()) { | 875 switch (variable->location()) { |
| 876 case Variable::UNALLOCATED: | 876 case VariableLocation::GLOBAL: |
| 877 case VariableLocation::UNALLOCATED: |
| 877 globals_->Add(variable->name(), zone()); | 878 globals_->Add(variable->name(), zone()); |
| 878 globals_->Add(variable->binding_needs_init() | 879 globals_->Add(variable->binding_needs_init() |
| 879 ? isolate()->factory()->the_hole_value() | 880 ? isolate()->factory()->the_hole_value() |
| 880 : isolate()->factory()->undefined_value(), | 881 : isolate()->factory()->undefined_value(), |
| 881 zone()); | 882 zone()); |
| 882 break; | 883 break; |
| 883 | 884 |
| 884 case Variable::PARAMETER: | 885 case VariableLocation::PARAMETER: |
| 885 case Variable::LOCAL: | 886 case VariableLocation::LOCAL: |
| 886 if (hole_init) { | 887 if (hole_init) { |
| 887 Comment cmnt(masm_, "[ VariableDeclaration"); | 888 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 888 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); | 889 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
| 889 __ Str(x10, StackOperand(variable)); | 890 __ Str(x10, StackOperand(variable)); |
| 890 } | 891 } |
| 891 break; | 892 break; |
| 892 | 893 |
| 893 case Variable::CONTEXT: | 894 case VariableLocation::CONTEXT: |
| 894 if (hole_init) { | 895 if (hole_init) { |
| 895 Comment cmnt(masm_, "[ VariableDeclaration"); | 896 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 896 EmitDebugCheckDeclarationContext(variable); | 897 EmitDebugCheckDeclarationContext(variable); |
| 897 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); | 898 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
| 898 __ Str(x10, ContextMemOperand(cp, variable->index())); | 899 __ Str(x10, ContextMemOperand(cp, variable->index())); |
| 899 // No write barrier since the_hole_value is in old space. | 900 // No write barrier since the_hole_value is in old space. |
| 900 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 901 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
| 901 } | 902 } |
| 902 break; | 903 break; |
| 903 | 904 |
| 904 case Variable::LOOKUP: { | 905 case VariableLocation::LOOKUP: { |
| 905 Comment cmnt(masm_, "[ VariableDeclaration"); | 906 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 906 __ Mov(x2, Operand(variable->name())); | 907 __ Mov(x2, Operand(variable->name())); |
| 907 // Declaration nodes are always introduced in one of four modes. | 908 // Declaration nodes are always introduced in one of four modes. |
| 908 DCHECK(IsDeclaredVariableMode(mode)); | 909 DCHECK(IsDeclaredVariableMode(mode)); |
| 909 PropertyAttributes attr = IsImmutableVariableMode(mode) ? READ_ONLY | 910 PropertyAttributes attr = IsImmutableVariableMode(mode) ? READ_ONLY |
| 910 : NONE; | 911 : NONE; |
| 911 __ Mov(x1, Smi::FromInt(attr)); | 912 __ Mov(x1, Smi::FromInt(attr)); |
| 912 // Push initial value, if any. | 913 // Push initial value, if any. |
| 913 // Note: For variables we must not push an initial value (such as | 914 // Note: For variables we must not push an initial value (such as |
| 914 // 'undefined') because we may have a (legal) redeclaration and we | 915 // 'undefined') because we may have a (legal) redeclaration and we |
| (...skipping 10 matching lines...) Expand all Loading... |
| 925 } | 926 } |
| 926 } | 927 } |
| 927 } | 928 } |
| 928 | 929 |
| 929 | 930 |
| 930 void FullCodeGenerator::VisitFunctionDeclaration( | 931 void FullCodeGenerator::VisitFunctionDeclaration( |
| 931 FunctionDeclaration* declaration) { | 932 FunctionDeclaration* declaration) { |
| 932 VariableProxy* proxy = declaration->proxy(); | 933 VariableProxy* proxy = declaration->proxy(); |
| 933 Variable* variable = proxy->var(); | 934 Variable* variable = proxy->var(); |
| 934 switch (variable->location()) { | 935 switch (variable->location()) { |
| 935 case Variable::UNALLOCATED: { | 936 case VariableLocation::GLOBAL: |
| 937 case VariableLocation::UNALLOCATED: { |
| 936 globals_->Add(variable->name(), zone()); | 938 globals_->Add(variable->name(), zone()); |
| 937 Handle<SharedFunctionInfo> function = | 939 Handle<SharedFunctionInfo> function = |
| 938 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 940 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 939 // Check for stack overflow exception. | 941 // Check for stack overflow exception. |
| 940 if (function.is_null()) return SetStackOverflow(); | 942 if (function.is_null()) return SetStackOverflow(); |
| 941 globals_->Add(function, zone()); | 943 globals_->Add(function, zone()); |
| 942 break; | 944 break; |
| 943 } | 945 } |
| 944 | 946 |
| 945 case Variable::PARAMETER: | 947 case VariableLocation::PARAMETER: |
| 946 case Variable::LOCAL: { | 948 case VariableLocation::LOCAL: { |
| 947 Comment cmnt(masm_, "[ Function Declaration"); | 949 Comment cmnt(masm_, "[ Function Declaration"); |
| 948 VisitForAccumulatorValue(declaration->fun()); | 950 VisitForAccumulatorValue(declaration->fun()); |
| 949 __ Str(result_register(), StackOperand(variable)); | 951 __ Str(result_register(), StackOperand(variable)); |
| 950 break; | 952 break; |
| 951 } | 953 } |
| 952 | 954 |
| 953 case Variable::CONTEXT: { | 955 case VariableLocation::CONTEXT: { |
| 954 Comment cmnt(masm_, "[ Function Declaration"); | 956 Comment cmnt(masm_, "[ Function Declaration"); |
| 955 EmitDebugCheckDeclarationContext(variable); | 957 EmitDebugCheckDeclarationContext(variable); |
| 956 VisitForAccumulatorValue(declaration->fun()); | 958 VisitForAccumulatorValue(declaration->fun()); |
| 957 __ Str(result_register(), ContextMemOperand(cp, variable->index())); | 959 __ Str(result_register(), ContextMemOperand(cp, variable->index())); |
| 958 int offset = Context::SlotOffset(variable->index()); | 960 int offset = Context::SlotOffset(variable->index()); |
| 959 // We know that we have written a function, which is not a smi. | 961 // We know that we have written a function, which is not a smi. |
| 960 __ RecordWriteContextSlot(cp, | 962 __ RecordWriteContextSlot(cp, |
| 961 offset, | 963 offset, |
| 962 result_register(), | 964 result_register(), |
| 963 x2, | 965 x2, |
| 964 kLRHasBeenSaved, | 966 kLRHasBeenSaved, |
| 965 kDontSaveFPRegs, | 967 kDontSaveFPRegs, |
| 966 EMIT_REMEMBERED_SET, | 968 EMIT_REMEMBERED_SET, |
| 967 OMIT_SMI_CHECK); | 969 OMIT_SMI_CHECK); |
| 968 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 970 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
| 969 break; | 971 break; |
| 970 } | 972 } |
| 971 | 973 |
| 972 case Variable::LOOKUP: { | 974 case VariableLocation::LOOKUP: { |
| 973 Comment cmnt(masm_, "[ Function Declaration"); | 975 Comment cmnt(masm_, "[ Function Declaration"); |
| 974 __ Mov(x2, Operand(variable->name())); | 976 __ Mov(x2, Operand(variable->name())); |
| 975 __ Mov(x1, Smi::FromInt(NONE)); | 977 __ Mov(x1, Smi::FromInt(NONE)); |
| 976 __ Push(cp, x2, x1); | 978 __ Push(cp, x2, x1); |
| 977 // Push initial value for function declaration. | 979 // Push initial value for function declaration. |
| 978 VisitForStackValue(declaration->fun()); | 980 VisitForStackValue(declaration->fun()); |
| 979 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 981 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
| 980 break; | 982 break; |
| 981 } | 983 } |
| 982 } | 984 } |
| 983 } | 985 } |
| 984 | 986 |
| 985 | 987 |
| 986 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { | 988 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { |
| 987 VariableProxy* proxy = declaration->proxy(); | 989 VariableProxy* proxy = declaration->proxy(); |
| 988 Variable* variable = proxy->var(); | 990 Variable* variable = proxy->var(); |
| 989 switch (variable->location()) { | 991 switch (variable->location()) { |
| 990 case Variable::UNALLOCATED: | 992 case VariableLocation::GLOBAL: |
| 993 case VariableLocation::UNALLOCATED: |
| 991 // TODO(rossberg) | 994 // TODO(rossberg) |
| 992 break; | 995 break; |
| 993 | 996 |
| 994 case Variable::CONTEXT: { | 997 case VariableLocation::CONTEXT: { |
| 995 Comment cmnt(masm_, "[ ImportDeclaration"); | 998 Comment cmnt(masm_, "[ ImportDeclaration"); |
| 996 EmitDebugCheckDeclarationContext(variable); | 999 EmitDebugCheckDeclarationContext(variable); |
| 997 // TODO(rossberg) | 1000 // TODO(rossberg) |
| 998 break; | 1001 break; |
| 999 } | 1002 } |
| 1000 | 1003 |
| 1001 case Variable::PARAMETER: | 1004 case VariableLocation::PARAMETER: |
| 1002 case Variable::LOCAL: | 1005 case VariableLocation::LOCAL: |
| 1003 case Variable::LOOKUP: | 1006 case VariableLocation::LOOKUP: |
| 1004 UNREACHABLE(); | 1007 UNREACHABLE(); |
| 1005 } | 1008 } |
| 1006 } | 1009 } |
| 1007 | 1010 |
| 1008 | 1011 |
| 1009 void FullCodeGenerator::VisitExportDeclaration(ExportDeclaration* declaration) { | 1012 void FullCodeGenerator::VisitExportDeclaration(ExportDeclaration* declaration) { |
| 1010 // TODO(rossberg) | 1013 // TODO(rossberg) |
| 1011 } | 1014 } |
| 1012 | 1015 |
| 1013 | 1016 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 | 1474 |
| 1472 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { | 1475 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
| 1473 // Record position before possible IC call. | 1476 // Record position before possible IC call. |
| 1474 SetExpressionPosition(proxy); | 1477 SetExpressionPosition(proxy); |
| 1475 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); | 1478 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); |
| 1476 Variable* var = proxy->var(); | 1479 Variable* var = proxy->var(); |
| 1477 | 1480 |
| 1478 // Three cases: global variables, lookup variables, and all other types of | 1481 // Three cases: global variables, lookup variables, and all other types of |
| 1479 // variables. | 1482 // variables. |
| 1480 switch (var->location()) { | 1483 switch (var->location()) { |
| 1481 case Variable::UNALLOCATED: { | 1484 case VariableLocation::GLOBAL: |
| 1485 case VariableLocation::UNALLOCATED: { |
| 1482 Comment cmnt(masm_, "Global variable"); | 1486 Comment cmnt(masm_, "Global variable"); |
| 1483 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 1487 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
| 1484 __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); | 1488 __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); |
| 1485 __ Mov(LoadDescriptor::SlotRegister(), | 1489 __ Mov(LoadDescriptor::SlotRegister(), |
| 1486 SmiFromSlot(proxy->VariableFeedbackSlot())); | 1490 SmiFromSlot(proxy->VariableFeedbackSlot())); |
| 1487 CallGlobalLoadIC(var->name()); | 1491 CallGlobalLoadIC(var->name()); |
| 1488 context()->Plug(x0); | 1492 context()->Plug(x0); |
| 1489 break; | 1493 break; |
| 1490 } | 1494 } |
| 1491 | 1495 |
| 1492 case Variable::PARAMETER: | 1496 case VariableLocation::PARAMETER: |
| 1493 case Variable::LOCAL: | 1497 case VariableLocation::LOCAL: |
| 1494 case Variable::CONTEXT: { | 1498 case VariableLocation::CONTEXT: { |
| 1495 Comment cmnt(masm_, var->IsContextSlot() | 1499 Comment cmnt(masm_, var->IsContextSlot() |
| 1496 ? "Context variable" | 1500 ? "Context variable" |
| 1497 : "Stack variable"); | 1501 : "Stack variable"); |
| 1498 if (var->binding_needs_init()) { | 1502 if (var->binding_needs_init()) { |
| 1499 // var->scope() may be NULL when the proxy is located in eval code and | 1503 // var->scope() may be NULL when the proxy is located in eval code and |
| 1500 // refers to a potential outside binding. Currently those bindings are | 1504 // refers to a potential outside binding. Currently those bindings are |
| 1501 // always looked up dynamically, i.e. in that case | 1505 // always looked up dynamically, i.e. in that case |
| 1502 // var->location() == LOOKUP. | 1506 // var->location() == LOOKUP. |
| 1503 // always holds. | 1507 // always holds. |
| 1504 DCHECK(var->scope() != NULL); | 1508 DCHECK(var->scope() != NULL); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 __ Bind(&done); | 1558 __ Bind(&done); |
| 1555 } | 1559 } |
| 1556 context()->Plug(x0); | 1560 context()->Plug(x0); |
| 1557 break; | 1561 break; |
| 1558 } | 1562 } |
| 1559 } | 1563 } |
| 1560 context()->Plug(var); | 1564 context()->Plug(var); |
| 1561 break; | 1565 break; |
| 1562 } | 1566 } |
| 1563 | 1567 |
| 1564 case Variable::LOOKUP: { | 1568 case VariableLocation::LOOKUP: { |
| 1565 Label done, slow; | 1569 Label done, slow; |
| 1566 // Generate code for loading from variables potentially shadowed by | 1570 // Generate code for loading from variables potentially shadowed by |
| 1567 // eval-introduced variables. | 1571 // eval-introduced variables. |
| 1568 EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done); | 1572 EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done); |
| 1569 __ Bind(&slow); | 1573 __ Bind(&slow); |
| 1570 Comment cmnt(masm_, "Lookup variable"); | 1574 Comment cmnt(masm_, "Lookup variable"); |
| 1571 __ Mov(x1, Operand(var->name())); | 1575 __ Mov(x1, Operand(var->name())); |
| 1572 __ Push(cp, x1); // Context and name. | 1576 __ Push(cp, x1); // Context and name. |
| 1573 __ CallRuntime(Runtime::kLoadLookupSlot, 2); | 1577 __ CallRuntime(Runtime::kLoadLookupSlot, 2); |
| 1574 __ Bind(&done); | 1578 __ Bind(&done); |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2416 int offset = Context::SlotOffset(var->index()); | 2420 int offset = Context::SlotOffset(var->index()); |
| 2417 __ RecordWriteContextSlot( | 2421 __ RecordWriteContextSlot( |
| 2418 x1, offset, x10, x11, kLRHasBeenSaved, kDontSaveFPRegs); | 2422 x1, offset, x10, x11, kLRHasBeenSaved, kDontSaveFPRegs); |
| 2419 } | 2423 } |
| 2420 } | 2424 } |
| 2421 | 2425 |
| 2422 | 2426 |
| 2423 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2427 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
| 2424 FeedbackVectorICSlot slot) { | 2428 FeedbackVectorICSlot slot) { |
| 2425 ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); | 2429 ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); |
| 2426 if (var->IsUnallocated()) { | 2430 if (var->IsUnallocatedOrGlobalSlot()) { |
| 2427 // Global var, const, or let. | 2431 // Global var, const, or let. |
| 2428 __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); | 2432 __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); |
| 2429 __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 2433 __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
| 2430 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2434 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 2431 CallStoreIC(); | 2435 CallStoreIC(); |
| 2432 | 2436 |
| 2433 } else if (var->mode() == LET && op != Token::INIT_LET) { | 2437 } else if (var->mode() == LET && op != Token::INIT_LET) { |
| 2434 // Non-initializing assignment to let variable needs a write barrier. | 2438 // Non-initializing assignment to let variable needs a write barrier. |
| 2435 DCHECK(!var->IsLookupSlot()); | 2439 DCHECK(!var->IsLookupSlot()); |
| 2436 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2440 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| (...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4479 __ Mov(x10, Smi::FromInt(language_mode())); | 4483 __ Mov(x10, Smi::FromInt(language_mode())); |
| 4480 __ Push(x10); | 4484 __ Push(x10); |
| 4481 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4485 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 4482 context()->Plug(x0); | 4486 context()->Plug(x0); |
| 4483 } else if (proxy != NULL) { | 4487 } else if (proxy != NULL) { |
| 4484 Variable* var = proxy->var(); | 4488 Variable* var = proxy->var(); |
| 4485 // Delete of an unqualified identifier is disallowed in strict mode but | 4489 // Delete of an unqualified identifier is disallowed in strict mode but |
| 4486 // "delete this" is allowed. | 4490 // "delete this" is allowed. |
| 4487 bool is_this = var->HasThisName(isolate()); | 4491 bool is_this = var->HasThisName(isolate()); |
| 4488 DCHECK(is_sloppy(language_mode()) || is_this); | 4492 DCHECK(is_sloppy(language_mode()) || is_this); |
| 4489 if (var->IsUnallocated()) { | 4493 if (var->IsUnallocatedOrGlobalSlot()) { |
| 4490 __ Ldr(x12, GlobalObjectMemOperand()); | 4494 __ Ldr(x12, GlobalObjectMemOperand()); |
| 4491 __ Mov(x11, Operand(var->name())); | 4495 __ Mov(x11, Operand(var->name())); |
| 4492 __ Mov(x10, Smi::FromInt(SLOPPY)); | 4496 __ Mov(x10, Smi::FromInt(SLOPPY)); |
| 4493 __ Push(x12, x11, x10); | 4497 __ Push(x12, x11, x10); |
| 4494 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 4498 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 4495 context()->Plug(x0); | 4499 context()->Plug(x0); |
| 4496 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4500 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
| 4497 // Result of deleting non-global, non-dynamic variables is false. | 4501 // Result of deleting non-global, non-dynamic variables is false. |
| 4498 // The subexpression does not have side effects. | 4502 // The subexpression does not have side effects. |
| 4499 context()->Plug(is_this); | 4503 context()->Plug(is_this); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4834 break; | 4838 break; |
| 4835 } | 4839 } |
| 4836 } | 4840 } |
| 4837 } | 4841 } |
| 4838 | 4842 |
| 4839 | 4843 |
| 4840 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 4844 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
| 4841 DCHECK(!context()->IsEffect()); | 4845 DCHECK(!context()->IsEffect()); |
| 4842 DCHECK(!context()->IsTest()); | 4846 DCHECK(!context()->IsTest()); |
| 4843 VariableProxy* proxy = expr->AsVariableProxy(); | 4847 VariableProxy* proxy = expr->AsVariableProxy(); |
| 4844 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 4848 if (proxy != NULL && proxy->var()->IsUnallocatedOrGlobalSlot()) { |
| 4845 Comment cmnt(masm_, "Global variable"); | 4849 Comment cmnt(masm_, "Global variable"); |
| 4846 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 4850 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
| 4847 __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); | 4851 __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); |
| 4848 __ Mov(LoadDescriptor::SlotRegister(), | 4852 __ Mov(LoadDescriptor::SlotRegister(), |
| 4849 SmiFromSlot(proxy->VariableFeedbackSlot())); | 4853 SmiFromSlot(proxy->VariableFeedbackSlot())); |
| 4850 // Use a regular load, not a contextual load, to avoid a reference | 4854 // Use a regular load, not a contextual load, to avoid a reference |
| 4851 // error. | 4855 // error. |
| 4852 CallLoadIC(NOT_CONTEXTUAL); | 4856 CallLoadIC(NOT_CONTEXTUAL); |
| 4853 PrepareForBailout(expr, TOS_REG); | 4857 PrepareForBailout(expr, TOS_REG); |
| 4854 context()->Plug(x0); | 4858 context()->Plug(x0); |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5590 } | 5594 } |
| 5591 | 5595 |
| 5592 return INTERRUPT; | 5596 return INTERRUPT; |
| 5593 } | 5597 } |
| 5594 | 5598 |
| 5595 | 5599 |
| 5596 } // namespace internal | 5600 } // namespace internal |
| 5597 } // namespace v8 | 5601 } // namespace v8 |
| 5598 | 5602 |
| 5599 #endif // V8_TARGET_ARCH_ARM64 | 5603 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |