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 switch (variable->location()) { | 756 switch (variable->location()) { |
757 case VariableLocation::UNALLOCATED: { | 757 case VariableLocation::UNALLOCATED: { |
758 DCHECK(!variable->binding_needs_init()); | 758 DCHECK(!variable->binding_needs_init()); |
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 if (variable->binding_needs_init()) { | 769 if (variable->binding_needs_init()) { |
769 Comment cmnt(masm_, "[ VariableDeclaration"); | 770 Comment cmnt(masm_, "[ VariableDeclaration"); |
770 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); | 771 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); |
771 __ str(r0, StackOperand(variable)); | 772 __ str(r0, StackOperand(variable)); |
772 } | 773 } |
773 break; | 774 break; |
(...skipping 19 matching lines...) Expand all Loading... |
793 void FullCodeGenerator::VisitFunctionDeclaration( | 794 void FullCodeGenerator::VisitFunctionDeclaration( |
794 FunctionDeclaration* declaration) { | 795 FunctionDeclaration* declaration) { |
795 VariableProxy* proxy = declaration->proxy(); | 796 VariableProxy* proxy = declaration->proxy(); |
796 Variable* variable = proxy->var(); | 797 Variable* variable = proxy->var(); |
797 switch (variable->location()) { | 798 switch (variable->location()) { |
798 case VariableLocation::UNALLOCATED: { | 799 case VariableLocation::UNALLOCATED: { |
799 globals_->Add(variable->name(), zone()); | 800 globals_->Add(variable->name(), zone()); |
800 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 801 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
801 DCHECK(!slot.IsInvalid()); | 802 DCHECK(!slot.IsInvalid()); |
802 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 803 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 804 |
| 805 // We need the slot where the literals array lives, too. |
| 806 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 807 DCHECK(!slot.IsInvalid()); |
| 808 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 809 |
803 Handle<SharedFunctionInfo> function = | 810 Handle<SharedFunctionInfo> function = |
804 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 811 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
805 // Check for stack-overflow exception. | 812 // Check for stack-overflow exception. |
806 if (function.is_null()) return SetStackOverflow(); | 813 if (function.is_null()) return SetStackOverflow(); |
807 globals_->Add(function, zone()); | 814 globals_->Add(function, zone()); |
808 break; | 815 break; |
809 } | 816 } |
810 | 817 |
811 case VariableLocation::PARAMETER: | 818 case VariableLocation::PARAMETER: |
812 case VariableLocation::LOCAL: { | 819 case VariableLocation::LOCAL: { |
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2902 DCHECK(interrupt_address == | 2909 DCHECK(interrupt_address == |
2903 isolate->builtins()->OnStackReplacement()->entry()); | 2910 isolate->builtins()->OnStackReplacement()->entry()); |
2904 return ON_STACK_REPLACEMENT; | 2911 return ON_STACK_REPLACEMENT; |
2905 } | 2912 } |
2906 | 2913 |
2907 | 2914 |
2908 } // namespace internal | 2915 } // namespace internal |
2909 } // namespace v8 | 2916 } // namespace v8 |
2910 | 2917 |
2911 #endif // V8_TARGET_ARCH_ARM | 2918 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |