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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 VariableProxy* proxy = declaration->proxy(); | 749 VariableProxy* proxy = declaration->proxy(); |
750 Variable* variable = proxy->var(); | 750 Variable* variable = proxy->var(); |
751 DCHECK(!variable->binding_needs_init()); | 751 DCHECK(!variable->binding_needs_init()); |
752 switch (variable->location()) { | 752 switch (variable->location()) { |
753 case VariableLocation::UNALLOCATED: { | 753 case VariableLocation::UNALLOCATED: { |
754 globals_->Add(variable->name(), zone()); | 754 globals_->Add(variable->name(), zone()); |
755 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 755 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
756 DCHECK(!slot.IsInvalid()); | 756 DCHECK(!slot.IsInvalid()); |
757 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 757 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
758 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 758 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
759 globals_->Add(isolate()->factory()->undefined_value(), zone()); | |
760 break; | 759 break; |
761 } | 760 } |
762 case VariableLocation::PARAMETER: | 761 case VariableLocation::PARAMETER: |
763 case VariableLocation::LOCAL: | 762 case VariableLocation::LOCAL: |
764 case VariableLocation::CONTEXT: | 763 case VariableLocation::CONTEXT: |
765 break; | 764 break; |
766 | 765 |
767 case VariableLocation::LOOKUP: | 766 case VariableLocation::LOOKUP: |
768 case VariableLocation::MODULE: | 767 case VariableLocation::MODULE: |
769 UNREACHABLE(); | 768 UNREACHABLE(); |
770 } | 769 } |
771 } | 770 } |
772 | 771 |
773 | 772 |
774 void FullCodeGenerator::VisitFunctionDeclaration( | 773 void FullCodeGenerator::VisitFunctionDeclaration( |
775 FunctionDeclaration* declaration) { | 774 FunctionDeclaration* declaration) { |
776 VariableProxy* proxy = declaration->proxy(); | 775 VariableProxy* proxy = declaration->proxy(); |
777 Variable* variable = proxy->var(); | 776 Variable* variable = proxy->var(); |
778 switch (variable->location()) { | 777 switch (variable->location()) { |
779 case VariableLocation::UNALLOCATED: { | 778 case VariableLocation::UNALLOCATED: { |
780 globals_->Add(variable->name(), zone()); | 779 globals_->Add(variable->name(), zone()); |
781 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 780 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
782 DCHECK(!slot.IsInvalid()); | 781 DCHECK(!slot.IsInvalid()); |
783 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 782 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
784 | |
785 // We need the slot where the literals array lives, too. | |
786 slot = declaration->fun()->LiteralFeedbackSlot(); | |
787 DCHECK(!slot.IsInvalid()); | |
788 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | |
789 | |
790 Handle<SharedFunctionInfo> function = | 783 Handle<SharedFunctionInfo> function = |
791 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 784 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
792 // Check for stack overflow exception. | 785 // Check for stack overflow exception. |
793 if (function.is_null()) return SetStackOverflow(); | 786 if (function.is_null()) return SetStackOverflow(); |
794 globals_->Add(function, zone()); | 787 globals_->Add(function, zone()); |
795 break; | 788 break; |
796 } | 789 } |
797 | 790 |
798 case VariableLocation::PARAMETER: | 791 case VariableLocation::PARAMETER: |
799 case VariableLocation::LOCAL: { | 792 case VariableLocation::LOCAL: { |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2845 } | 2838 } |
2846 | 2839 |
2847 return INTERRUPT; | 2840 return INTERRUPT; |
2848 } | 2841 } |
2849 | 2842 |
2850 | 2843 |
2851 } // namespace internal | 2844 } // namespace internal |
2852 } // namespace v8 | 2845 } // namespace v8 |
2853 | 2846 |
2854 #endif // V8_TARGET_ARCH_ARM64 | 2847 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |