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 switch (variable->location()) { | 751 switch (variable->location()) { |
752 case VariableLocation::UNALLOCATED: { | 752 case VariableLocation::UNALLOCATED: { |
753 DCHECK(!variable->binding_needs_init()); | 753 DCHECK(!variable->binding_needs_init()); |
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()); |
759 break; | 760 break; |
760 } | 761 } |
761 case VariableLocation::PARAMETER: | 762 case VariableLocation::PARAMETER: |
762 case VariableLocation::LOCAL: | 763 case VariableLocation::LOCAL: |
763 if (variable->binding_needs_init()) { | 764 if (variable->binding_needs_init()) { |
764 Comment cmnt(masm_, "[ VariableDeclaration"); | 765 Comment cmnt(masm_, "[ VariableDeclaration"); |
765 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); | 766 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
766 __ Str(x10, StackOperand(variable)); | 767 __ Str(x10, StackOperand(variable)); |
767 } | 768 } |
768 break; | 769 break; |
(...skipping 19 matching lines...) Expand all Loading... |
788 void FullCodeGenerator::VisitFunctionDeclaration( | 789 void FullCodeGenerator::VisitFunctionDeclaration( |
789 FunctionDeclaration* declaration) { | 790 FunctionDeclaration* declaration) { |
790 VariableProxy* proxy = declaration->proxy(); | 791 VariableProxy* proxy = declaration->proxy(); |
791 Variable* variable = proxy->var(); | 792 Variable* variable = proxy->var(); |
792 switch (variable->location()) { | 793 switch (variable->location()) { |
793 case VariableLocation::UNALLOCATED: { | 794 case VariableLocation::UNALLOCATED: { |
794 globals_->Add(variable->name(), zone()); | 795 globals_->Add(variable->name(), zone()); |
795 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 796 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
796 DCHECK(!slot.IsInvalid()); | 797 DCHECK(!slot.IsInvalid()); |
797 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 798 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 799 |
| 800 // We need the slot where the literals array lives, too. |
| 801 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 802 DCHECK(!slot.IsInvalid()); |
| 803 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 804 |
798 Handle<SharedFunctionInfo> function = | 805 Handle<SharedFunctionInfo> function = |
799 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 806 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
800 // Check for stack overflow exception. | 807 // Check for stack overflow exception. |
801 if (function.is_null()) return SetStackOverflow(); | 808 if (function.is_null()) return SetStackOverflow(); |
802 globals_->Add(function, zone()); | 809 globals_->Add(function, zone()); |
803 break; | 810 break; |
804 } | 811 } |
805 | 812 |
806 case VariableLocation::PARAMETER: | 813 case VariableLocation::PARAMETER: |
807 case VariableLocation::LOCAL: { | 814 case VariableLocation::LOCAL: { |
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2903 } | 2910 } |
2904 | 2911 |
2905 return INTERRUPT; | 2912 return INTERRUPT; |
2906 } | 2913 } |
2907 | 2914 |
2908 | 2915 |
2909 } // namespace internal | 2916 } // namespace internal |
2910 } // namespace v8 | 2917 } // namespace v8 |
2911 | 2918 |
2912 #endif // V8_TARGET_ARCH_ARM64 | 2919 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |