OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 VariableProxy* proxy = declaration->proxy(); | 722 VariableProxy* proxy = declaration->proxy(); |
723 Variable* variable = proxy->var(); | 723 Variable* variable = proxy->var(); |
724 DCHECK(!variable->binding_needs_init()); | 724 DCHECK(!variable->binding_needs_init()); |
725 switch (variable->location()) { | 725 switch (variable->location()) { |
726 case VariableLocation::UNALLOCATED: { | 726 case VariableLocation::UNALLOCATED: { |
727 globals_->Add(variable->name(), zone()); | 727 globals_->Add(variable->name(), zone()); |
728 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 728 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
729 DCHECK(!slot.IsInvalid()); | 729 DCHECK(!slot.IsInvalid()); |
730 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 730 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
731 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 731 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 732 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
732 break; | 733 break; |
733 } | 734 } |
734 case VariableLocation::PARAMETER: | 735 case VariableLocation::PARAMETER: |
735 case VariableLocation::LOCAL: | 736 case VariableLocation::LOCAL: |
736 case VariableLocation::CONTEXT: | 737 case VariableLocation::CONTEXT: |
737 break; | 738 break; |
738 | 739 |
739 case VariableLocation::LOOKUP: | 740 case VariableLocation::LOOKUP: |
740 case VariableLocation::MODULE: | 741 case VariableLocation::MODULE: |
741 UNREACHABLE(); | 742 UNREACHABLE(); |
742 } | 743 } |
743 } | 744 } |
744 | 745 |
745 | 746 |
746 void FullCodeGenerator::VisitFunctionDeclaration( | 747 void FullCodeGenerator::VisitFunctionDeclaration( |
747 FunctionDeclaration* declaration) { | 748 FunctionDeclaration* declaration) { |
748 VariableProxy* proxy = declaration->proxy(); | 749 VariableProxy* proxy = declaration->proxy(); |
749 Variable* variable = proxy->var(); | 750 Variable* variable = proxy->var(); |
750 switch (variable->location()) { | 751 switch (variable->location()) { |
751 case VariableLocation::UNALLOCATED: { | 752 case VariableLocation::UNALLOCATED: { |
752 globals_->Add(variable->name(), zone()); | 753 globals_->Add(variable->name(), zone()); |
753 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 754 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
754 DCHECK(!slot.IsInvalid()); | 755 DCHECK(!slot.IsInvalid()); |
755 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 756 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 757 |
| 758 // We need the slot where the literals array lives, too. |
| 759 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 760 DCHECK(!slot.IsInvalid()); |
| 761 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 762 |
756 Handle<SharedFunctionInfo> function = | 763 Handle<SharedFunctionInfo> function = |
757 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 764 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
758 // Check for stack-overflow exception. | 765 // Check for stack-overflow exception. |
759 if (function.is_null()) return SetStackOverflow(); | 766 if (function.is_null()) return SetStackOverflow(); |
760 globals_->Add(function, zone()); | 767 globals_->Add(function, zone()); |
761 break; | 768 break; |
762 } | 769 } |
763 | 770 |
764 case VariableLocation::PARAMETER: | 771 case VariableLocation::PARAMETER: |
765 case VariableLocation::LOCAL: { | 772 case VariableLocation::LOCAL: { |
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 | 2779 |
2773 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 2780 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
2774 | 2781 |
2775 DCHECK(interrupt_address == | 2782 DCHECK(interrupt_address == |
2776 isolate->builtins()->OnStackReplacement()->entry()); | 2783 isolate->builtins()->OnStackReplacement()->entry()); |
2777 return ON_STACK_REPLACEMENT; | 2784 return ON_STACK_REPLACEMENT; |
2778 } | 2785 } |
2779 } // namespace internal | 2786 } // namespace internal |
2780 } // namespace v8 | 2787 } // namespace v8 |
2781 #endif // V8_TARGET_ARCH_PPC | 2788 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |