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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 VariableProxy* proxy = declaration->proxy(); | 702 VariableProxy* proxy = declaration->proxy(); |
703 Variable* variable = proxy->var(); | 703 Variable* variable = proxy->var(); |
704 DCHECK(!variable->binding_needs_init()); | 704 DCHECK(!variable->binding_needs_init()); |
705 switch (variable->location()) { | 705 switch (variable->location()) { |
706 case VariableLocation::UNALLOCATED: { | 706 case VariableLocation::UNALLOCATED: { |
707 globals_->Add(variable->name(), zone()); | 707 globals_->Add(variable->name(), zone()); |
708 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 708 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
709 DCHECK(!slot.IsInvalid()); | 709 DCHECK(!slot.IsInvalid()); |
710 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 710 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
711 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 711 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
712 globals_->Add(isolate()->factory()->undefined_value(), zone()); | |
713 break; | 712 break; |
714 } | 713 } |
715 case VariableLocation::PARAMETER: | 714 case VariableLocation::PARAMETER: |
716 case VariableLocation::LOCAL: | 715 case VariableLocation::LOCAL: |
717 case VariableLocation::CONTEXT: | 716 case VariableLocation::CONTEXT: |
718 break; | 717 break; |
719 | 718 |
720 case VariableLocation::LOOKUP: | 719 case VariableLocation::LOOKUP: |
721 case VariableLocation::MODULE: | 720 case VariableLocation::MODULE: |
722 UNREACHABLE(); | 721 UNREACHABLE(); |
723 } | 722 } |
724 } | 723 } |
725 | 724 |
726 | 725 |
727 void FullCodeGenerator::VisitFunctionDeclaration( | 726 void FullCodeGenerator::VisitFunctionDeclaration( |
728 FunctionDeclaration* declaration) { | 727 FunctionDeclaration* declaration) { |
729 VariableProxy* proxy = declaration->proxy(); | 728 VariableProxy* proxy = declaration->proxy(); |
730 Variable* variable = proxy->var(); | 729 Variable* variable = proxy->var(); |
731 switch (variable->location()) { | 730 switch (variable->location()) { |
732 case VariableLocation::UNALLOCATED: { | 731 case VariableLocation::UNALLOCATED: { |
733 globals_->Add(variable->name(), zone()); | 732 globals_->Add(variable->name(), zone()); |
734 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 733 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
735 DCHECK(!slot.IsInvalid()); | 734 DCHECK(!slot.IsInvalid()); |
736 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 735 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
737 | |
738 // We need the slot where the literals array lives, too. | |
739 slot = declaration->fun()->LiteralFeedbackSlot(); | |
740 DCHECK(!slot.IsInvalid()); | |
741 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | |
742 | |
743 Handle<SharedFunctionInfo> function = | 736 Handle<SharedFunctionInfo> function = |
744 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 737 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
745 // Check for stack-overflow exception. | 738 // Check for stack-overflow exception. |
746 if (function.is_null()) return SetStackOverflow(); | 739 if (function.is_null()) return SetStackOverflow(); |
747 globals_->Add(function, zone()); | 740 globals_->Add(function, zone()); |
748 break; | 741 break; |
749 } | 742 } |
750 | 743 |
751 case VariableLocation::PARAMETER: | 744 case VariableLocation::PARAMETER: |
752 case VariableLocation::LOCAL: { | 745 case VariableLocation::LOCAL: { |
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 isolate->builtins()->OnStackReplacement()->entry(), | 2706 isolate->builtins()->OnStackReplacement()->entry(), |
2714 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2707 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2715 return ON_STACK_REPLACEMENT; | 2708 return ON_STACK_REPLACEMENT; |
2716 } | 2709 } |
2717 | 2710 |
2718 | 2711 |
2719 } // namespace internal | 2712 } // namespace internal |
2720 } // namespace v8 | 2713 } // namespace v8 |
2721 | 2714 |
2722 #endif // V8_TARGET_ARCH_IA32 | 2715 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |