| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 case VariableLocation::LOOKUP: { | 797 case VariableLocation::LOOKUP: { |
| 798 Comment cmnt(masm_, "[ VariableDeclaration"); | 798 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 799 DCHECK_EQ(VAR, mode); | 799 DCHECK_EQ(VAR, mode); |
| 800 DCHECK(!hole_init); | 800 DCHECK(!hole_init); |
| 801 __ Mov(x2, Operand(variable->name())); | 801 __ Mov(x2, Operand(variable->name())); |
| 802 __ Push(x2); | 802 __ Push(x2); |
| 803 __ CallRuntime(Runtime::kDeclareEvalVar); | 803 __ CallRuntime(Runtime::kDeclareEvalVar); |
| 804 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 804 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 805 break; | 805 break; |
| 806 } | 806 } |
| 807 |
| 808 case VariableLocation::MODULE: |
| 809 UNREACHABLE(); |
| 807 } | 810 } |
| 808 } | 811 } |
| 809 | 812 |
| 810 | 813 |
| 811 void FullCodeGenerator::VisitFunctionDeclaration( | 814 void FullCodeGenerator::VisitFunctionDeclaration( |
| 812 FunctionDeclaration* declaration) { | 815 FunctionDeclaration* declaration) { |
| 813 VariableProxy* proxy = declaration->proxy(); | 816 VariableProxy* proxy = declaration->proxy(); |
| 814 Variable* variable = proxy->var(); | 817 Variable* variable = proxy->var(); |
| 815 switch (variable->location()) { | 818 switch (variable->location()) { |
| 816 case VariableLocation::GLOBAL: | 819 case VariableLocation::GLOBAL: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 case VariableLocation::LOOKUP: { | 859 case VariableLocation::LOOKUP: { |
| 857 Comment cmnt(masm_, "[ Function Declaration"); | 860 Comment cmnt(masm_, "[ Function Declaration"); |
| 858 __ Mov(x2, Operand(variable->name())); | 861 __ Mov(x2, Operand(variable->name())); |
| 859 PushOperand(x2); | 862 PushOperand(x2); |
| 860 // Push initial value for function declaration. | 863 // Push initial value for function declaration. |
| 861 VisitForStackValue(declaration->fun()); | 864 VisitForStackValue(declaration->fun()); |
| 862 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 865 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
| 863 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 866 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 864 break; | 867 break; |
| 865 } | 868 } |
| 869 |
| 870 case VariableLocation::MODULE: |
| 871 UNREACHABLE(); |
| 866 } | 872 } |
| 867 } | 873 } |
| 868 | 874 |
| 869 | 875 |
| 870 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 876 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
| 871 // Call the runtime to declare the globals. | 877 // Call the runtime to declare the globals. |
| 872 __ Mov(x11, Operand(pairs)); | 878 __ Mov(x11, Operand(pairs)); |
| 873 Register flags = xzr; | 879 Register flags = xzr; |
| 874 if (Smi::FromInt(DeclareGlobalsFlags())) { | 880 if (Smi::FromInt(DeclareGlobalsFlags())) { |
| 875 flags = x10; | 881 flags = x10; |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 __ Push(var->name()); | 1342 __ Push(var->name()); |
| 1337 Runtime::FunctionId function_id = | 1343 Runtime::FunctionId function_id = |
| 1338 typeof_mode == NOT_INSIDE_TYPEOF | 1344 typeof_mode == NOT_INSIDE_TYPEOF |
| 1339 ? Runtime::kLoadLookupSlot | 1345 ? Runtime::kLoadLookupSlot |
| 1340 : Runtime::kLoadLookupSlotInsideTypeof; | 1346 : Runtime::kLoadLookupSlotInsideTypeof; |
| 1341 __ CallRuntime(function_id); | 1347 __ CallRuntime(function_id); |
| 1342 __ Bind(&done); | 1348 __ Bind(&done); |
| 1343 context()->Plug(x0); | 1349 context()->Plug(x0); |
| 1344 break; | 1350 break; |
| 1345 } | 1351 } |
| 1352 |
| 1353 case VariableLocation::MODULE: |
| 1354 UNREACHABLE(); |
| 1346 } | 1355 } |
| 1347 } | 1356 } |
| 1348 | 1357 |
| 1349 | 1358 |
| 1350 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1359 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
| 1351 Expression* expression = (property == NULL) ? NULL : property->value(); | 1360 Expression* expression = (property == NULL) ? NULL : property->value(); |
| 1352 if (expression == NULL) { | 1361 if (expression == NULL) { |
| 1353 __ LoadRoot(x10, Heap::kNullValueRootIndex); | 1362 __ LoadRoot(x10, Heap::kNullValueRootIndex); |
| 1354 PushOperand(x10); | 1363 PushOperand(x10); |
| 1355 } else { | 1364 } else { |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3848 } | 3857 } |
| 3849 | 3858 |
| 3850 return INTERRUPT; | 3859 return INTERRUPT; |
| 3851 } | 3860 } |
| 3852 | 3861 |
| 3853 | 3862 |
| 3854 } // namespace internal | 3863 } // namespace internal |
| 3855 } // namespace v8 | 3864 } // namespace v8 |
| 3856 | 3865 |
| 3857 #endif // V8_TARGET_ARCH_ARM64 | 3866 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |