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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 // No write barrier since the_hole_value is in old space. | 857 // No write barrier since the_hole_value is in old space. |
858 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 858 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
859 } | 859 } |
860 break; | 860 break; |
861 | 861 |
862 case VariableLocation::LOOKUP: { | 862 case VariableLocation::LOOKUP: { |
863 Comment cmnt(masm_, "[ VariableDeclaration"); | 863 Comment cmnt(masm_, "[ VariableDeclaration"); |
864 __ mov(r2, Operand(variable->name())); | 864 __ mov(r2, Operand(variable->name())); |
865 // Declaration nodes are always introduced in one of four modes. | 865 // Declaration nodes are always introduced in one of four modes. |
866 DCHECK(IsDeclaredVariableMode(mode)); | 866 DCHECK(IsDeclaredVariableMode(mode)); |
867 PropertyAttributes attr = | |
868 IsImmutableVariableMode(mode) ? READ_ONLY : NONE; | |
869 __ mov(r1, Operand(Smi::FromInt(attr))); | |
870 // Push initial value, if any. | 867 // Push initial value, if any. |
871 // Note: For variables we must not push an initial value (such as | 868 // Note: For variables we must not push an initial value (such as |
872 // 'undefined') because we may have a (legal) redeclaration and we | 869 // 'undefined') because we may have a (legal) redeclaration and we |
873 // must not destroy the current value. | 870 // must not destroy the current value. |
874 if (hole_init) { | 871 if (hole_init) { |
875 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); | 872 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); |
876 __ Push(cp, r2, r1, r0); | |
877 } else { | 873 } else { |
878 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. | 874 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. |
879 __ Push(cp, r2, r1, r0); | |
880 } | 875 } |
881 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 876 __ Push(r2, r0); |
| 877 __ CallRuntime(IsImmutableVariableMode(mode) |
| 878 ? Runtime::kDeclareReadOnlyLookupSlot |
| 879 : Runtime::kDeclareLookupSlot, |
| 880 2); |
882 break; | 881 break; |
883 } | 882 } |
884 } | 883 } |
885 } | 884 } |
886 | 885 |
887 | 886 |
888 void FullCodeGenerator::VisitFunctionDeclaration( | 887 void FullCodeGenerator::VisitFunctionDeclaration( |
889 FunctionDeclaration* declaration) { | 888 FunctionDeclaration* declaration) { |
890 VariableProxy* proxy = declaration->proxy(); | 889 VariableProxy* proxy = declaration->proxy(); |
891 Variable* variable = proxy->var(); | 890 Variable* variable = proxy->var(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 kDontSaveFPRegs, | 923 kDontSaveFPRegs, |
925 EMIT_REMEMBERED_SET, | 924 EMIT_REMEMBERED_SET, |
926 OMIT_SMI_CHECK); | 925 OMIT_SMI_CHECK); |
927 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 926 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
928 break; | 927 break; |
929 } | 928 } |
930 | 929 |
931 case VariableLocation::LOOKUP: { | 930 case VariableLocation::LOOKUP: { |
932 Comment cmnt(masm_, "[ FunctionDeclaration"); | 931 Comment cmnt(masm_, "[ FunctionDeclaration"); |
933 __ mov(r2, Operand(variable->name())); | 932 __ mov(r2, Operand(variable->name())); |
934 __ mov(r1, Operand(Smi::FromInt(NONE))); | 933 __ Push(r2); |
935 __ Push(cp, r2, r1); | |
936 // Push initial value for function declaration. | 934 // Push initial value for function declaration. |
937 VisitForStackValue(declaration->fun()); | 935 VisitForStackValue(declaration->fun()); |
938 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 936 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); |
939 break; | 937 break; |
940 } | 938 } |
941 } | 939 } |
942 } | 940 } |
943 | 941 |
944 | 942 |
945 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 943 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
946 // Call the runtime to declare the globals. | 944 // Call the runtime to declare the globals. |
947 // The context is the first argument. | |
948 __ mov(r1, Operand(pairs)); | 945 __ mov(r1, Operand(pairs)); |
949 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); | 946 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); |
950 __ Push(cp, r1, r0); | 947 __ Push(r1, r0); |
951 __ CallRuntime(Runtime::kDeclareGlobals, 3); | 948 __ CallRuntime(Runtime::kDeclareGlobals, 2); |
952 // Return value is ignored. | 949 // Return value is ignored. |
953 } | 950 } |
954 | 951 |
955 | 952 |
956 void FullCodeGenerator::DeclareModules(Handle<FixedArray> descriptions) { | 953 void FullCodeGenerator::DeclareModules(Handle<FixedArray> descriptions) { |
957 // Call the runtime to declare the modules. | 954 // Call the runtime to declare the modules. |
958 __ Push(descriptions); | 955 __ Push(descriptions); |
959 __ CallRuntime(Runtime::kDeclareModules, 1); | 956 __ CallRuntime(Runtime::kDeclareModules, 1); |
960 // Return value is ignored. | 957 // Return value is ignored. |
961 } | 958 } |
(...skipping 4507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5469 DCHECK(interrupt_address == | 5466 DCHECK(interrupt_address == |
5470 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5467 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5471 return OSR_AFTER_STACK_CHECK; | 5468 return OSR_AFTER_STACK_CHECK; |
5472 } | 5469 } |
5473 | 5470 |
5474 | 5471 |
5475 } // namespace internal | 5472 } // namespace internal |
5476 } // namespace v8 | 5473 } // namespace v8 |
5477 | 5474 |
5478 #endif // V8_TARGET_ARCH_ARM | 5475 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |