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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 // Note: For variables we must not push an initial value (such as | 848 // Note: For variables we must not push an initial value (such as |
849 // 'undefined') because we may have a (legal) redeclaration and we | 849 // 'undefined') because we may have a (legal) redeclaration and we |
850 // must not destroy the current value. | 850 // must not destroy the current value. |
851 if (hole_init) { | 851 if (hole_init) { |
852 __ LoadRoot(x0, Heap::kTheHoleValueRootIndex); | 852 __ LoadRoot(x0, Heap::kTheHoleValueRootIndex); |
853 __ Push(x2, x0); | 853 __ Push(x2, x0); |
854 } else { | 854 } else { |
855 // Pushing 0 (xzr) indicates no initial value. | 855 // Pushing 0 (xzr) indicates no initial value. |
856 __ Push(x2, xzr); | 856 __ Push(x2, xzr); |
857 } | 857 } |
858 __ CallRuntime(IsImmutableVariableMode(mode) | 858 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
859 ? Runtime::kDeclareReadOnlyLookupSlot | 859 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
860 : Runtime::kDeclareLookupSlot, | |
861 2); | |
862 break; | 860 break; |
863 } | 861 } |
864 } | 862 } |
865 } | 863 } |
866 | 864 |
867 | 865 |
868 void FullCodeGenerator::VisitFunctionDeclaration( | 866 void FullCodeGenerator::VisitFunctionDeclaration( |
869 FunctionDeclaration* declaration) { | 867 FunctionDeclaration* declaration) { |
870 VariableProxy* proxy = declaration->proxy(); | 868 VariableProxy* proxy = declaration->proxy(); |
871 Variable* variable = proxy->var(); | 869 Variable* variable = proxy->var(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 905 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
908 break; | 906 break; |
909 } | 907 } |
910 | 908 |
911 case VariableLocation::LOOKUP: { | 909 case VariableLocation::LOOKUP: { |
912 Comment cmnt(masm_, "[ Function Declaration"); | 910 Comment cmnt(masm_, "[ Function Declaration"); |
913 __ Mov(x2, Operand(variable->name())); | 911 __ Mov(x2, Operand(variable->name())); |
914 __ Push(x2); | 912 __ Push(x2); |
915 // Push initial value for function declaration. | 913 // Push initial value for function declaration. |
916 VisitForStackValue(declaration->fun()); | 914 VisitForStackValue(declaration->fun()); |
917 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); | 915 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 916 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
918 break; | 917 break; |
919 } | 918 } |
920 } | 919 } |
921 } | 920 } |
922 | 921 |
923 | 922 |
924 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 923 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
925 // Call the runtime to declare the globals. | 924 // Call the runtime to declare the globals. |
926 __ Mov(x11, Operand(pairs)); | 925 __ Mov(x11, Operand(pairs)); |
927 Register flags = xzr; | 926 Register flags = xzr; |
(...skipping 4329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5257 } | 5256 } |
5258 | 5257 |
5259 return INTERRUPT; | 5258 return INTERRUPT; |
5260 } | 5259 } |
5261 | 5260 |
5262 | 5261 |
5263 } // namespace internal | 5262 } // namespace internal |
5264 } // namespace v8 | 5263 } // namespace v8 |
5265 | 5264 |
5266 #endif // V8_TARGET_ARCH_ARM64 | 5265 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |