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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 EmitDebugCheckDeclarationContext(variable); | 793 EmitDebugCheckDeclarationContext(variable); |
794 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); | 794 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); |
795 __ str(r0, ContextMemOperand(cp, variable->index())); | 795 __ str(r0, ContextMemOperand(cp, variable->index())); |
796 // No write barrier since the_hole_value is in old space. | 796 // No write barrier since the_hole_value is in old space. |
797 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 797 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
798 } | 798 } |
799 break; | 799 break; |
800 | 800 |
801 case VariableLocation::LOOKUP: { | 801 case VariableLocation::LOOKUP: { |
802 Comment cmnt(masm_, "[ VariableDeclaration"); | 802 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 803 DCHECK_EQ(VAR, mode); |
| 804 DCHECK(!hole_init); |
803 __ mov(r2, Operand(variable->name())); | 805 __ mov(r2, Operand(variable->name())); |
804 // Declaration nodes are always introduced in one of four modes. | 806 __ Push(r2); |
805 DCHECK(IsDeclaredVariableMode(mode)); | 807 __ CallRuntime(Runtime::kDeclareEvalVar); |
806 DCHECK(!hole_init); | |
807 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. | |
808 __ Push(r2, r0); | |
809 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | |
810 __ CallRuntime(Runtime::kDeclareLookupSlot); | |
811 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 808 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
812 break; | 809 break; |
813 } | 810 } |
814 } | 811 } |
815 } | 812 } |
816 | 813 |
817 | 814 |
818 void FullCodeGenerator::VisitFunctionDeclaration( | 815 void FullCodeGenerator::VisitFunctionDeclaration( |
819 FunctionDeclaration* declaration) { | 816 FunctionDeclaration* declaration) { |
820 VariableProxy* proxy = declaration->proxy(); | 817 VariableProxy* proxy = declaration->proxy(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 854 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
858 break; | 855 break; |
859 } | 856 } |
860 | 857 |
861 case VariableLocation::LOOKUP: { | 858 case VariableLocation::LOOKUP: { |
862 Comment cmnt(masm_, "[ FunctionDeclaration"); | 859 Comment cmnt(masm_, "[ FunctionDeclaration"); |
863 __ mov(r2, Operand(variable->name())); | 860 __ mov(r2, Operand(variable->name())); |
864 PushOperand(r2); | 861 PushOperand(r2); |
865 // Push initial value for function declaration. | 862 // Push initial value for function declaration. |
866 VisitForStackValue(declaration->fun()); | 863 VisitForStackValue(declaration->fun()); |
867 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 864 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
868 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); | |
869 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 865 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
870 break; | 866 break; |
871 } | 867 } |
872 } | 868 } |
873 } | 869 } |
874 | 870 |
875 | 871 |
876 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 872 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
877 // Call the runtime to declare the globals. | 873 // Call the runtime to declare the globals. |
878 __ mov(r1, Operand(pairs)); | 874 __ mov(r1, Operand(pairs)); |
(...skipping 2996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3875 DCHECK(interrupt_address == | 3871 DCHECK(interrupt_address == |
3876 isolate->builtins()->OnStackReplacement()->entry()); | 3872 isolate->builtins()->OnStackReplacement()->entry()); |
3877 return ON_STACK_REPLACEMENT; | 3873 return ON_STACK_REPLACEMENT; |
3878 } | 3874 } |
3879 | 3875 |
3880 | 3876 |
3881 } // namespace internal | 3877 } // namespace internal |
3882 } // namespace v8 | 3878 } // namespace v8 |
3883 | 3879 |
3884 #endif // V8_TARGET_ARCH_ARM | 3880 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |