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/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 // Note: For variables we must not push an initial value (such as | 844 // Note: For variables we must not push an initial value (such as |
845 // 'undefined') because we may have a (legal) redeclaration and we | 845 // 'undefined') because we may have a (legal) redeclaration and we |
846 // must not destroy the current value. | 846 // must not destroy the current value. |
847 if (hole_init) { | 847 if (hole_init) { |
848 __ LoadRoot(x0, Heap::kTheHoleValueRootIndex); | 848 __ LoadRoot(x0, Heap::kTheHoleValueRootIndex); |
849 __ Push(x2, x0); | 849 __ Push(x2, x0); |
850 } else { | 850 } else { |
851 // Pushing 0 (xzr) indicates no initial value. | 851 // Pushing 0 (xzr) indicates no initial value. |
852 __ Push(x2, xzr); | 852 __ Push(x2, xzr); |
853 } | 853 } |
854 __ CallRuntime(IsImmutableVariableMode(mode) | 854 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
855 ? Runtime::kDeclareReadOnlyLookupSlot | 855 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
856 : Runtime::kDeclareLookupSlot, | |
857 2); | |
858 break; | 856 break; |
859 } | 857 } |
860 } | 858 } |
861 } | 859 } |
862 | 860 |
863 | 861 |
864 void FullCodeGenerator::VisitFunctionDeclaration( | 862 void FullCodeGenerator::VisitFunctionDeclaration( |
865 FunctionDeclaration* declaration) { | 863 FunctionDeclaration* declaration) { |
866 VariableProxy* proxy = declaration->proxy(); | 864 VariableProxy* proxy = declaration->proxy(); |
867 Variable* variable = proxy->var(); | 865 Variable* variable = proxy->var(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 901 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
904 break; | 902 break; |
905 } | 903 } |
906 | 904 |
907 case VariableLocation::LOOKUP: { | 905 case VariableLocation::LOOKUP: { |
908 Comment cmnt(masm_, "[ Function Declaration"); | 906 Comment cmnt(masm_, "[ Function Declaration"); |
909 __ Mov(x2, Operand(variable->name())); | 907 __ Mov(x2, Operand(variable->name())); |
910 __ Push(x2); | 908 __ Push(x2); |
911 // Push initial value for function declaration. | 909 // Push initial value for function declaration. |
912 VisitForStackValue(declaration->fun()); | 910 VisitForStackValue(declaration->fun()); |
913 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); | 911 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 912 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
914 break; | 913 break; |
915 } | 914 } |
916 } | 915 } |
917 } | 916 } |
918 | 917 |
919 | 918 |
920 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 919 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
921 // Call the runtime to declare the globals. | 920 // Call the runtime to declare the globals. |
922 __ Mov(x11, Operand(pairs)); | 921 __ Mov(x11, Operand(pairs)); |
923 Register flags = xzr; | 922 Register flags = xzr; |
(...skipping 4343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5267 } | 5266 } |
5268 | 5267 |
5269 return INTERRUPT; | 5268 return INTERRUPT; |
5270 } | 5269 } |
5271 | 5270 |
5272 | 5271 |
5273 } // namespace internal | 5272 } // namespace internal |
5274 } // namespace v8 | 5273 } // namespace v8 |
5275 | 5274 |
5276 #endif // V8_TARGET_ARCH_ARM64 | 5275 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |