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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 case VariableLocation::LOOKUP: { | 792 case VariableLocation::LOOKUP: { |
793 Comment cmnt(masm_, "[ VariableDeclaration"); | 793 Comment cmnt(masm_, "[ VariableDeclaration"); |
794 DCHECK_EQ(VAR, variable->mode()); | 794 DCHECK_EQ(VAR, variable->mode()); |
795 DCHECK(!variable->binding_needs_init()); | 795 DCHECK(!variable->binding_needs_init()); |
796 __ Mov(x2, Operand(variable->name())); | 796 __ Mov(x2, Operand(variable->name())); |
797 __ Push(x2); | 797 __ Push(x2); |
798 __ CallRuntime(Runtime::kDeclareEvalVar); | 798 __ CallRuntime(Runtime::kDeclareEvalVar); |
799 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 799 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
800 break; | 800 break; |
801 } | 801 } |
| 802 |
| 803 case VariableLocation::MODULE: |
| 804 UNREACHABLE(); |
802 } | 805 } |
803 } | 806 } |
804 | 807 |
805 | 808 |
806 void FullCodeGenerator::VisitFunctionDeclaration( | 809 void FullCodeGenerator::VisitFunctionDeclaration( |
807 FunctionDeclaration* declaration) { | 810 FunctionDeclaration* declaration) { |
808 VariableProxy* proxy = declaration->proxy(); | 811 VariableProxy* proxy = declaration->proxy(); |
809 Variable* variable = proxy->var(); | 812 Variable* variable = proxy->var(); |
810 switch (variable->location()) { | 813 switch (variable->location()) { |
811 case VariableLocation::GLOBAL: | 814 case VariableLocation::GLOBAL: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 case VariableLocation::LOOKUP: { | 854 case VariableLocation::LOOKUP: { |
852 Comment cmnt(masm_, "[ Function Declaration"); | 855 Comment cmnt(masm_, "[ Function Declaration"); |
853 __ Mov(x2, Operand(variable->name())); | 856 __ Mov(x2, Operand(variable->name())); |
854 PushOperand(x2); | 857 PushOperand(x2); |
855 // Push initial value for function declaration. | 858 // Push initial value for function declaration. |
856 VisitForStackValue(declaration->fun()); | 859 VisitForStackValue(declaration->fun()); |
857 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); | 860 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
858 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 861 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
859 break; | 862 break; |
860 } | 863 } |
| 864 |
| 865 case VariableLocation::MODULE: |
| 866 UNREACHABLE(); |
861 } | 867 } |
862 } | 868 } |
863 | 869 |
864 | 870 |
865 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 871 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
866 // Call the runtime to declare the globals. | 872 // Call the runtime to declare the globals. |
867 __ Mov(x11, Operand(pairs)); | 873 __ Mov(x11, Operand(pairs)); |
868 Register flags = xzr; | 874 Register flags = xzr; |
869 if (Smi::FromInt(DeclareGlobalsFlags())) { | 875 if (Smi::FromInt(DeclareGlobalsFlags())) { |
870 flags = x10; | 876 flags = x10; |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 __ Push(var->name()); | 1335 __ Push(var->name()); |
1330 Runtime::FunctionId function_id = | 1336 Runtime::FunctionId function_id = |
1331 typeof_mode == NOT_INSIDE_TYPEOF | 1337 typeof_mode == NOT_INSIDE_TYPEOF |
1332 ? Runtime::kLoadLookupSlot | 1338 ? Runtime::kLoadLookupSlot |
1333 : Runtime::kLoadLookupSlotInsideTypeof; | 1339 : Runtime::kLoadLookupSlotInsideTypeof; |
1334 __ CallRuntime(function_id); | 1340 __ CallRuntime(function_id); |
1335 __ Bind(&done); | 1341 __ Bind(&done); |
1336 context()->Plug(x0); | 1342 context()->Plug(x0); |
1337 break; | 1343 break; |
1338 } | 1344 } |
| 1345 |
| 1346 case VariableLocation::MODULE: |
| 1347 UNREACHABLE(); |
1339 } | 1348 } |
1340 } | 1349 } |
1341 | 1350 |
1342 | 1351 |
1343 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { | 1352 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
1344 Expression* expression = (property == NULL) ? NULL : property->value(); | 1353 Expression* expression = (property == NULL) ? NULL : property->value(); |
1345 if (expression == NULL) { | 1354 if (expression == NULL) { |
1346 __ LoadRoot(x10, Heap::kNullValueRootIndex); | 1355 __ LoadRoot(x10, Heap::kNullValueRootIndex); |
1347 PushOperand(x10); | 1356 PushOperand(x10); |
1348 } else { | 1357 } else { |
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3836 } | 3845 } |
3837 | 3846 |
3838 return INTERRUPT; | 3847 return INTERRUPT; |
3839 } | 3848 } |
3840 | 3849 |
3841 | 3850 |
3842 } // namespace internal | 3851 } // namespace internal |
3843 } // namespace v8 | 3852 } // namespace v8 |
3844 | 3853 |
3845 #endif // V8_TARGET_ARCH_ARM64 | 3854 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |