| 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 switch (variable->location()) { | 724 switch (variable->location()) { |
| 725 case VariableLocation::UNALLOCATED: { | 725 case VariableLocation::UNALLOCATED: { |
| 726 DCHECK(!variable->binding_needs_init()); | 726 DCHECK(!variable->binding_needs_init()); |
| 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 if (variable->binding_needs_init()) { | 737 if (variable->binding_needs_init()) { |
| 737 Comment cmnt(masm_, "[ VariableDeclaration"); | 738 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 738 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 739 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 739 __ StoreP(ip, StackOperand(variable)); | 740 __ StoreP(ip, StackOperand(variable)); |
| 740 } | 741 } |
| 741 break; | 742 break; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 761 void FullCodeGenerator::VisitFunctionDeclaration( | 762 void FullCodeGenerator::VisitFunctionDeclaration( |
| 762 FunctionDeclaration* declaration) { | 763 FunctionDeclaration* declaration) { |
| 763 VariableProxy* proxy = declaration->proxy(); | 764 VariableProxy* proxy = declaration->proxy(); |
| 764 Variable* variable = proxy->var(); | 765 Variable* variable = proxy->var(); |
| 765 switch (variable->location()) { | 766 switch (variable->location()) { |
| 766 case VariableLocation::UNALLOCATED: { | 767 case VariableLocation::UNALLOCATED: { |
| 767 globals_->Add(variable->name(), zone()); | 768 globals_->Add(variable->name(), zone()); |
| 768 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 769 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 769 DCHECK(!slot.IsInvalid()); | 770 DCHECK(!slot.IsInvalid()); |
| 770 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 771 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 772 |
| 773 // We need the slot where the literals array lives, too. |
| 774 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 775 DCHECK(!slot.IsInvalid()); |
| 776 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 777 |
| 771 Handle<SharedFunctionInfo> function = | 778 Handle<SharedFunctionInfo> function = |
| 772 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 779 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 773 // Check for stack-overflow exception. | 780 // Check for stack-overflow exception. |
| 774 if (function.is_null()) return SetStackOverflow(); | 781 if (function.is_null()) return SetStackOverflow(); |
| 775 globals_->Add(function, zone()); | 782 globals_->Add(function, zone()); |
| 776 break; | 783 break; |
| 777 } | 784 } |
| 778 | 785 |
| 779 case VariableLocation::PARAMETER: | 786 case VariableLocation::PARAMETER: |
| 780 case VariableLocation::LOCAL: { | 787 case VariableLocation::LOCAL: { |
| (...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2841 | 2848 |
| 2842 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 2849 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 2843 | 2850 |
| 2844 DCHECK(interrupt_address == | 2851 DCHECK(interrupt_address == |
| 2845 isolate->builtins()->OnStackReplacement()->entry()); | 2852 isolate->builtins()->OnStackReplacement()->entry()); |
| 2846 return ON_STACK_REPLACEMENT; | 2853 return ON_STACK_REPLACEMENT; |
| 2847 } | 2854 } |
| 2848 } // namespace internal | 2855 } // namespace internal |
| 2849 } // namespace v8 | 2856 } // namespace v8 |
| 2850 #endif // V8_TARGET_ARCH_PPC | 2857 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |