OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 VariableProxy* proxy = declaration->proxy(); | 695 VariableProxy* proxy = declaration->proxy(); |
696 Variable* variable = proxy->var(); | 696 Variable* variable = proxy->var(); |
697 DCHECK(!variable->binding_needs_init()); | 697 DCHECK(!variable->binding_needs_init()); |
698 switch (variable->location()) { | 698 switch (variable->location()) { |
699 case VariableLocation::UNALLOCATED: { | 699 case VariableLocation::UNALLOCATED: { |
700 globals_->Add(variable->name(), zone()); | 700 globals_->Add(variable->name(), zone()); |
701 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 701 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
702 DCHECK(!slot.IsInvalid()); | 702 DCHECK(!slot.IsInvalid()); |
703 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 703 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
704 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 704 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 705 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
705 break; | 706 break; |
706 } | 707 } |
707 case VariableLocation::PARAMETER: | 708 case VariableLocation::PARAMETER: |
708 case VariableLocation::LOCAL: | 709 case VariableLocation::LOCAL: |
709 case VariableLocation::CONTEXT: | 710 case VariableLocation::CONTEXT: |
710 break; | 711 break; |
711 | 712 |
712 case VariableLocation::LOOKUP: | 713 case VariableLocation::LOOKUP: |
713 case VariableLocation::MODULE: | 714 case VariableLocation::MODULE: |
714 UNREACHABLE(); | 715 UNREACHABLE(); |
715 } | 716 } |
716 } | 717 } |
717 | 718 |
718 void FullCodeGenerator::VisitFunctionDeclaration( | 719 void FullCodeGenerator::VisitFunctionDeclaration( |
719 FunctionDeclaration* declaration) { | 720 FunctionDeclaration* declaration) { |
720 VariableProxy* proxy = declaration->proxy(); | 721 VariableProxy* proxy = declaration->proxy(); |
721 Variable* variable = proxy->var(); | 722 Variable* variable = proxy->var(); |
722 switch (variable->location()) { | 723 switch (variable->location()) { |
723 case VariableLocation::UNALLOCATED: { | 724 case VariableLocation::UNALLOCATED: { |
724 globals_->Add(variable->name(), zone()); | 725 globals_->Add(variable->name(), zone()); |
725 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 726 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
726 DCHECK(!slot.IsInvalid()); | 727 DCHECK(!slot.IsInvalid()); |
727 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 728 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 729 |
| 730 // We need the slot where the literals array lives, too. |
| 731 slot = declaration->fun()->LiteralFeedbackSlot(); |
| 732 DCHECK(!slot.IsInvalid()); |
| 733 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 734 |
728 Handle<SharedFunctionInfo> function = | 735 Handle<SharedFunctionInfo> function = |
729 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 736 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
730 // Check for stack-overflow exception. | 737 // Check for stack-overflow exception. |
731 if (function.is_null()) return SetStackOverflow(); | 738 if (function.is_null()) return SetStackOverflow(); |
732 globals_->Add(function, zone()); | 739 globals_->Add(function, zone()); |
733 break; | 740 break; |
734 } | 741 } |
735 | 742 |
736 case VariableLocation::PARAMETER: | 743 case VariableLocation::PARAMETER: |
737 case VariableLocation::LOCAL: { | 744 case VariableLocation::LOCAL: { |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2708 USE(kOSRBranchInstruction); | 2715 USE(kOSRBranchInstruction); |
2709 DCHECK(kOSRBranchInstruction == br_instr); | 2716 DCHECK(kOSRBranchInstruction == br_instr); |
2710 | 2717 |
2711 DCHECK(interrupt_address == | 2718 DCHECK(interrupt_address == |
2712 isolate->builtins()->OnStackReplacement()->entry()); | 2719 isolate->builtins()->OnStackReplacement()->entry()); |
2713 return ON_STACK_REPLACEMENT; | 2720 return ON_STACK_REPLACEMENT; |
2714 } | 2721 } |
2715 } // namespace internal | 2722 } // namespace internal |
2716 } // namespace v8 | 2723 } // namespace v8 |
2717 #endif // V8_TARGET_ARCH_S390 | 2724 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |