OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 // Push initial value, if any. | 840 // Push initial value, if any. |
841 // Note: For variables we must not push an initial value (such as | 841 // Note: For variables we must not push an initial value (such as |
842 // 'undefined') because we may have a (legal) redeclaration and we | 842 // 'undefined') because we may have a (legal) redeclaration and we |
843 // must not destroy the current value. | 843 // must not destroy the current value. |
844 if (hole_init) { | 844 if (hole_init) { |
845 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); | 845 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); |
846 } else { | 846 } else { |
847 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. | 847 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. |
848 } | 848 } |
849 __ Push(r2, r0); | 849 __ Push(r2, r0); |
850 __ CallRuntime(IsImmutableVariableMode(mode) | 850 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
851 ? Runtime::kDeclareReadOnlyLookupSlot | 851 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
852 : Runtime::kDeclareLookupSlot, | |
853 2); | |
854 break; | 852 break; |
855 } | 853 } |
856 } | 854 } |
857 } | 855 } |
858 | 856 |
859 | 857 |
860 void FullCodeGenerator::VisitFunctionDeclaration( | 858 void FullCodeGenerator::VisitFunctionDeclaration( |
861 FunctionDeclaration* declaration) { | 859 FunctionDeclaration* declaration) { |
862 VariableProxy* proxy = declaration->proxy(); | 860 VariableProxy* proxy = declaration->proxy(); |
863 Variable* variable = proxy->var(); | 861 Variable* variable = proxy->var(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 897 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
900 break; | 898 break; |
901 } | 899 } |
902 | 900 |
903 case VariableLocation::LOOKUP: { | 901 case VariableLocation::LOOKUP: { |
904 Comment cmnt(masm_, "[ FunctionDeclaration"); | 902 Comment cmnt(masm_, "[ FunctionDeclaration"); |
905 __ mov(r2, Operand(variable->name())); | 903 __ mov(r2, Operand(variable->name())); |
906 __ Push(r2); | 904 __ Push(r2); |
907 // Push initial value for function declaration. | 905 // Push initial value for function declaration. |
908 VisitForStackValue(declaration->fun()); | 906 VisitForStackValue(declaration->fun()); |
909 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); | 907 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 908 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
910 break; | 909 break; |
911 } | 910 } |
912 } | 911 } |
913 } | 912 } |
914 | 913 |
915 | 914 |
916 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 915 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
917 // Call the runtime to declare the globals. | 916 // Call the runtime to declare the globals. |
918 __ mov(r1, Operand(pairs)); | 917 __ mov(r1, Operand(pairs)); |
919 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); | 918 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); |
(...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5280 DCHECK(interrupt_address == | 5279 DCHECK(interrupt_address == |
5281 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5280 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5282 return OSR_AFTER_STACK_CHECK; | 5281 return OSR_AFTER_STACK_CHECK; |
5283 } | 5282 } |
5284 | 5283 |
5285 | 5284 |
5286 } // namespace internal | 5285 } // namespace internal |
5287 } // namespace v8 | 5286 } // namespace v8 |
5288 | 5287 |
5289 #endif // V8_TARGET_ARCH_ARM | 5288 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |