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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 __ Push(cp, x2, x1); | 951 __ Push(cp, x2, x1); |
952 // Push initial value for function declaration. | 952 // Push initial value for function declaration. |
953 VisitForStackValue(declaration->fun()); | 953 VisitForStackValue(declaration->fun()); |
954 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 954 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
955 break; | 955 break; |
956 } | 956 } |
957 } | 957 } |
958 } | 958 } |
959 | 959 |
960 | 960 |
961 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { | |
962 Variable* variable = declaration->proxy()->var(); | |
963 ModuleDescriptor* descriptor = declaration->module()->descriptor(); | |
964 DCHECK(variable->location() == Variable::CONTEXT); | |
965 DCHECK(descriptor->IsFrozen()); | |
966 | |
967 Comment cmnt(masm_, "[ ModuleDeclaration"); | |
968 EmitDebugCheckDeclarationContext(variable); | |
969 | |
970 // Load instance object. | |
971 __ LoadContext(x1, scope_->ContextChainLength(scope_->ScriptScope())); | |
972 __ Ldr(x1, ContextMemOperand(x1, descriptor->Index())); | |
973 __ Ldr(x1, ContextMemOperand(x1, Context::EXTENSION_INDEX)); | |
974 | |
975 // Assign it. | |
976 __ Str(x1, ContextMemOperand(cp, variable->index())); | |
977 // We know that we have written a module, which is not a smi. | |
978 __ RecordWriteContextSlot(cp, | |
979 Context::SlotOffset(variable->index()), | |
980 x1, | |
981 x3, | |
982 kLRHasBeenSaved, | |
983 kDontSaveFPRegs, | |
984 EMIT_REMEMBERED_SET, | |
985 OMIT_SMI_CHECK); | |
986 PrepareForBailoutForId(declaration->proxy()->id(), NO_REGISTERS); | |
987 | |
988 // Traverse info body. | |
989 Visit(declaration->module()); | |
990 } | |
991 | |
992 | |
993 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { | 961 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { |
994 VariableProxy* proxy = declaration->proxy(); | 962 VariableProxy* proxy = declaration->proxy(); |
995 Variable* variable = proxy->var(); | 963 Variable* variable = proxy->var(); |
996 switch (variable->location()) { | 964 switch (variable->location()) { |
997 case Variable::UNALLOCATED: | 965 case Variable::UNALLOCATED: |
998 // TODO(rossberg) | 966 // TODO(rossberg) |
999 break; | 967 break; |
1000 | 968 |
1001 case Variable::CONTEXT: { | 969 case Variable::CONTEXT: { |
1002 Comment cmnt(masm_, "[ ImportDeclaration"); | 970 Comment cmnt(masm_, "[ ImportDeclaration"); |
(...skipping 4506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5509 } | 5477 } |
5510 } | 5478 } |
5511 | 5479 |
5512 return INTERRUPT; | 5480 return INTERRUPT; |
5513 } | 5481 } |
5514 | 5482 |
5515 | 5483 |
5516 } } // namespace v8::internal | 5484 } } // namespace v8::internal |
5517 | 5485 |
5518 #endif // V8_TARGET_ARCH_ARM64 | 5486 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |