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/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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 EmitDebugCheckDeclarationContext(variable); | 790 EmitDebugCheckDeclarationContext(variable); |
791 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); | 791 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
792 __ Str(x10, ContextMemOperand(cp, variable->index())); | 792 __ Str(x10, ContextMemOperand(cp, variable->index())); |
793 // No write barrier since the_hole_value is in old space. | 793 // No write barrier since the_hole_value is in old space. |
794 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 794 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
795 } | 795 } |
796 break; | 796 break; |
797 | 797 |
798 case VariableLocation::LOOKUP: { | 798 case VariableLocation::LOOKUP: { |
799 Comment cmnt(masm_, "[ VariableDeclaration"); | 799 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 800 DCHECK_EQ(VAR, mode); |
| 801 DCHECK(!hole_init); |
800 __ Mov(x2, Operand(variable->name())); | 802 __ Mov(x2, Operand(variable->name())); |
801 // Declaration nodes are always introduced in one of four modes. | 803 __ Push(x2); |
802 DCHECK(IsDeclaredVariableMode(mode)); | 804 __ CallRuntime(Runtime::kDeclareEvalVar); |
803 DCHECK(!hole_init); | |
804 // Pushing 0 (xzr) indicates no initial value. | |
805 __ Push(x2, xzr); | |
806 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | |
807 __ CallRuntime(Runtime::kDeclareLookupSlot); | |
808 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 805 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
809 break; | 806 break; |
810 } | 807 } |
811 } | 808 } |
812 } | 809 } |
813 | 810 |
814 | 811 |
815 void FullCodeGenerator::VisitFunctionDeclaration( | 812 void FullCodeGenerator::VisitFunctionDeclaration( |
816 FunctionDeclaration* declaration) { | 813 FunctionDeclaration* declaration) { |
817 VariableProxy* proxy = declaration->proxy(); | 814 VariableProxy* proxy = declaration->proxy(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 851 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
855 break; | 852 break; |
856 } | 853 } |
857 | 854 |
858 case VariableLocation::LOOKUP: { | 855 case VariableLocation::LOOKUP: { |
859 Comment cmnt(masm_, "[ Function Declaration"); | 856 Comment cmnt(masm_, "[ Function Declaration"); |
860 __ Mov(x2, Operand(variable->name())); | 857 __ Mov(x2, Operand(variable->name())); |
861 PushOperand(x2); | 858 PushOperand(x2); |
862 // Push initial value for function declaration. | 859 // Push initial value for function declaration. |
863 VisitForStackValue(declaration->fun()); | 860 VisitForStackValue(declaration->fun()); |
864 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 861 CallRuntimeWithOperands(Runtime::kDeclareEvalFunction); |
865 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); | |
866 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); | 862 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
867 break; | 863 break; |
868 } | 864 } |
869 } | 865 } |
870 } | 866 } |
871 | 867 |
872 | 868 |
873 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 869 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
874 // Call the runtime to declare the globals. | 870 // Call the runtime to declare the globals. |
875 __ Mov(x11, Operand(pairs)); | 871 __ Mov(x11, Operand(pairs)); |
(...skipping 3007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3883 } | 3879 } |
3884 | 3880 |
3885 return INTERRUPT; | 3881 return INTERRUPT; |
3886 } | 3882 } |
3887 | 3883 |
3888 | 3884 |
3889 } // namespace internal | 3885 } // namespace internal |
3890 } // namespace v8 | 3886 } // namespace v8 |
3891 | 3887 |
3892 #endif // V8_TARGET_ARCH_ARM64 | 3888 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |