Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.cc

Issue 2634283003: [TypeFeedbackVector] DeclareGlobals needs a literals array (Closed)
Patch Set: Cleanup. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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());
712 break; 713 break;
713 } 714 }
714 case VariableLocation::PARAMETER: 715 case VariableLocation::PARAMETER:
715 case VariableLocation::LOCAL: 716 case VariableLocation::LOCAL:
716 case VariableLocation::CONTEXT: 717 case VariableLocation::CONTEXT:
717 break; 718 break;
718 719
719 case VariableLocation::LOOKUP: 720 case VariableLocation::LOOKUP:
720 case VariableLocation::MODULE: 721 case VariableLocation::MODULE:
721 UNREACHABLE(); 722 UNREACHABLE();
722 } 723 }
723 } 724 }
724 725
725 726
726 void FullCodeGenerator::VisitFunctionDeclaration( 727 void FullCodeGenerator::VisitFunctionDeclaration(
727 FunctionDeclaration* declaration) { 728 FunctionDeclaration* declaration) {
728 VariableProxy* proxy = declaration->proxy(); 729 VariableProxy* proxy = declaration->proxy();
729 Variable* variable = proxy->var(); 730 Variable* variable = proxy->var();
730 switch (variable->location()) { 731 switch (variable->location()) {
731 case VariableLocation::UNALLOCATED: { 732 case VariableLocation::UNALLOCATED: {
732 globals_->Add(variable->name(), zone()); 733 globals_->Add(variable->name(), zone());
733 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 734 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
734 DCHECK(!slot.IsInvalid()); 735 DCHECK(!slot.IsInvalid());
735 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 736 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
736 Handle<SharedFunctionInfo> function = 743 Handle<SharedFunctionInfo> function =
737 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); 744 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_);
738 // Check for stack-overflow exception. 745 // Check for stack-overflow exception.
739 if (function.is_null()) return SetStackOverflow(); 746 if (function.is_null()) return SetStackOverflow();
740 globals_->Add(function, zone()); 747 globals_->Add(function, zone());
741 break; 748 break;
742 } 749 }
743 750
744 case VariableLocation::PARAMETER: 751 case VariableLocation::PARAMETER:
745 case VariableLocation::LOCAL: { 752 case VariableLocation::LOCAL: {
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 isolate->builtins()->OnStackReplacement()->entry(), 2711 isolate->builtins()->OnStackReplacement()->entry(),
2705 Assembler::target_address_at(call_target_address, unoptimized_code)); 2712 Assembler::target_address_at(call_target_address, unoptimized_code));
2706 return ON_STACK_REPLACEMENT; 2713 return ON_STACK_REPLACEMENT;
2707 } 2714 }
2708 2715
2709 2716
2710 } // namespace internal 2717 } // namespace internal
2711 } // namespace v8 2718 } // namespace v8
2712 2719
2713 #endif // V8_TARGET_ARCH_IA32 2720 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698