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

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

Issue 2634283003: [TypeFeedbackVector] DeclareGlobals needs a literals array (Closed)
Patch Set: Don't exploit the literals array yet. Created 3 years, 10 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
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_X64 5 #if V8_TARGET_ARCH_X64
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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 VariableProxy* proxy = declaration->proxy(); 716 VariableProxy* proxy = declaration->proxy();
717 Variable* variable = proxy->var(); 717 Variable* variable = proxy->var();
718 switch (variable->location()) { 718 switch (variable->location()) {
719 case VariableLocation::UNALLOCATED: { 719 case VariableLocation::UNALLOCATED: {
720 DCHECK(!variable->binding_needs_init()); 720 DCHECK(!variable->binding_needs_init());
721 globals_->Add(variable->name(), zone()); 721 globals_->Add(variable->name(), zone());
722 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 722 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
723 DCHECK(!slot.IsInvalid()); 723 DCHECK(!slot.IsInvalid());
724 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 724 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
725 globals_->Add(isolate()->factory()->undefined_value(), zone()); 725 globals_->Add(isolate()->factory()->undefined_value(), zone());
726 globals_->Add(isolate()->factory()->undefined_value(), zone());
726 break; 727 break;
727 } 728 }
728 case VariableLocation::PARAMETER: 729 case VariableLocation::PARAMETER:
729 case VariableLocation::LOCAL: 730 case VariableLocation::LOCAL:
730 if (variable->binding_needs_init()) { 731 if (variable->binding_needs_init()) {
731 Comment cmnt(masm_, "[ VariableDeclaration"); 732 Comment cmnt(masm_, "[ VariableDeclaration");
732 __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex); 733 __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
733 __ movp(StackOperand(variable), kScratchRegister); 734 __ movp(StackOperand(variable), kScratchRegister);
734 } 735 }
735 break; 736 break;
(...skipping 19 matching lines...) Expand all
755 void FullCodeGenerator::VisitFunctionDeclaration( 756 void FullCodeGenerator::VisitFunctionDeclaration(
756 FunctionDeclaration* declaration) { 757 FunctionDeclaration* declaration) {
757 VariableProxy* proxy = declaration->proxy(); 758 VariableProxy* proxy = declaration->proxy();
758 Variable* variable = proxy->var(); 759 Variable* variable = proxy->var();
759 switch (variable->location()) { 760 switch (variable->location()) {
760 case VariableLocation::UNALLOCATED: { 761 case VariableLocation::UNALLOCATED: {
761 globals_->Add(variable->name(), zone()); 762 globals_->Add(variable->name(), zone());
762 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 763 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
763 DCHECK(!slot.IsInvalid()); 764 DCHECK(!slot.IsInvalid());
764 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 765 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
766
767 // We need the slot where the literals array lives, too.
768 slot = declaration->fun()->LiteralFeedbackSlot();
769 DCHECK(!slot.IsInvalid());
770 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
771
765 Handle<SharedFunctionInfo> function = 772 Handle<SharedFunctionInfo> function =
766 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); 773 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_);
767 // Check for stack-overflow exception. 774 // Check for stack-overflow exception.
768 if (function.is_null()) return SetStackOverflow(); 775 if (function.is_null()) return SetStackOverflow();
769 globals_->Add(function, zone()); 776 globals_->Add(function, zone());
770 break; 777 break;
771 } 778 }
772 779
773 case VariableLocation::PARAMETER: 780 case VariableLocation::PARAMETER:
774 case VariableLocation::LOCAL: { 781 case VariableLocation::LOCAL: {
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 DCHECK_EQ( 2762 DCHECK_EQ(
2756 isolate->builtins()->OnStackReplacement()->entry(), 2763 isolate->builtins()->OnStackReplacement()->entry(),
2757 Assembler::target_address_at(call_target_address, unoptimized_code)); 2764 Assembler::target_address_at(call_target_address, unoptimized_code));
2758 return ON_STACK_REPLACEMENT; 2765 return ON_STACK_REPLACEMENT;
2759 } 2766 }
2760 2767
2761 } // namespace internal 2768 } // namespace internal
2762 } // namespace v8 2769 } // namespace v8
2763 2770
2764 #endif // V8_TARGET_ARCH_X64 2771 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698