| 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/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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 VariableProxy* proxy = declaration->proxy(); | 754 VariableProxy* proxy = declaration->proxy(); |
| 755 Variable* variable = proxy->var(); | 755 Variable* variable = proxy->var(); |
| 756 DCHECK(!variable->binding_needs_init()); | 756 DCHECK(!variable->binding_needs_init()); |
| 757 switch (variable->location()) { | 757 switch (variable->location()) { |
| 758 case VariableLocation::UNALLOCATED: { | 758 case VariableLocation::UNALLOCATED: { |
| 759 globals_->Add(variable->name(), zone()); | 759 globals_->Add(variable->name(), zone()); |
| 760 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 760 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 761 DCHECK(!slot.IsInvalid()); | 761 DCHECK(!slot.IsInvalid()); |
| 762 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 762 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 763 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 763 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 764 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 764 break; | 765 break; |
| 765 } | 766 } |
| 766 case VariableLocation::PARAMETER: | 767 case VariableLocation::PARAMETER: |
| 767 case VariableLocation::LOCAL: | 768 case VariableLocation::LOCAL: |
| 768 case VariableLocation::CONTEXT: | 769 case VariableLocation::CONTEXT: |
| 769 break; | 770 break; |
| 770 | 771 |
| 771 case VariableLocation::LOOKUP: | 772 case VariableLocation::LOOKUP: |
| 772 case VariableLocation::MODULE: | 773 case VariableLocation::MODULE: |
| 773 UNREACHABLE(); | 774 UNREACHABLE(); |
| 774 } | 775 } |
| 775 } | 776 } |
| 776 | 777 |
| 777 | 778 |
| 778 void FullCodeGenerator::VisitFunctionDeclaration( | 779 void FullCodeGenerator::VisitFunctionDeclaration( |
| 779 FunctionDeclaration* declaration) { | 780 FunctionDeclaration* declaration) { |
| 780 VariableProxy* proxy = declaration->proxy(); | 781 VariableProxy* proxy = declaration->proxy(); |
| 781 Variable* variable = proxy->var(); | 782 Variable* variable = proxy->var(); |
| 782 switch (variable->location()) { | 783 switch (variable->location()) { |
| 783 case VariableLocation::UNALLOCATED: { | 784 case VariableLocation::UNALLOCATED: { |
| 784 globals_->Add(variable->name(), zone()); | 785 globals_->Add(variable->name(), zone()); |
| 785 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 786 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 786 DCHECK(!slot.IsInvalid()); | 787 DCHECK(!slot.IsInvalid()); |
| 787 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 788 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 789 |
| 790 // We need the slot where the literals array lives, too. |
| 791 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 792 DCHECK(!slot.IsInvalid()); |
| 793 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 794 |
| 788 Handle<SharedFunctionInfo> function = | 795 Handle<SharedFunctionInfo> function = |
| 789 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 796 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 790 // Check for stack-overflow exception. | 797 // Check for stack-overflow exception. |
| 791 if (function.is_null()) return SetStackOverflow(); | 798 if (function.is_null()) return SetStackOverflow(); |
| 792 globals_->Add(function, zone()); | 799 globals_->Add(function, zone()); |
| 793 break; | 800 break; |
| 794 } | 801 } |
| 795 | 802 |
| 796 case VariableLocation::PARAMETER: | 803 case VariableLocation::PARAMETER: |
| 797 case VariableLocation::LOCAL: { | 804 case VariableLocation::LOCAL: { |
| (...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2831 DCHECK(interrupt_address == | 2838 DCHECK(interrupt_address == |
| 2832 isolate->builtins()->OnStackReplacement()->entry()); | 2839 isolate->builtins()->OnStackReplacement()->entry()); |
| 2833 return ON_STACK_REPLACEMENT; | 2840 return ON_STACK_REPLACEMENT; |
| 2834 } | 2841 } |
| 2835 | 2842 |
| 2836 | 2843 |
| 2837 } // namespace internal | 2844 } // namespace internal |
| 2838 } // namespace v8 | 2845 } // namespace v8 |
| 2839 | 2846 |
| 2840 #endif // V8_TARGET_ARCH_ARM | 2847 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |