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

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

Issue 2634283003: [TypeFeedbackVector] DeclareGlobals needs a literals array (Closed)
Patch Set: Don't exploit the literals array yet. 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 VariableProxy* proxy = declaration->proxy(); 753 VariableProxy* proxy = declaration->proxy();
754 Variable* variable = proxy->var(); 754 Variable* variable = proxy->var();
755 switch (variable->location()) { 755 switch (variable->location()) {
756 case VariableLocation::UNALLOCATED: { 756 case VariableLocation::UNALLOCATED: {
757 DCHECK(!variable->binding_needs_init()); 757 DCHECK(!variable->binding_needs_init());
758 globals_->Add(variable->name(), zone()); 758 globals_->Add(variable->name(), zone());
759 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 759 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
760 DCHECK(!slot.IsInvalid()); 760 DCHECK(!slot.IsInvalid());
761 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 761 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
762 globals_->Add(isolate()->factory()->undefined_value(), zone()); 762 globals_->Add(isolate()->factory()->undefined_value(), zone());
763 globals_->Add(isolate()->factory()->undefined_value(), zone());
763 break; 764 break;
764 } 765 }
765 case VariableLocation::PARAMETER: 766 case VariableLocation::PARAMETER:
766 case VariableLocation::LOCAL: 767 case VariableLocation::LOCAL:
767 if (variable->binding_needs_init()) { 768 if (variable->binding_needs_init()) {
768 Comment cmnt(masm_, "[ VariableDeclaration"); 769 Comment cmnt(masm_, "[ VariableDeclaration");
769 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); 770 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
770 __ sw(t0, StackOperand(variable)); 771 __ sw(t0, StackOperand(variable));
771 } 772 }
772 break; 773 break;
(...skipping 19 matching lines...) Expand all
792 void FullCodeGenerator::VisitFunctionDeclaration( 793 void FullCodeGenerator::VisitFunctionDeclaration(
793 FunctionDeclaration* declaration) { 794 FunctionDeclaration* declaration) {
794 VariableProxy* proxy = declaration->proxy(); 795 VariableProxy* proxy = declaration->proxy();
795 Variable* variable = proxy->var(); 796 Variable* variable = proxy->var();
796 switch (variable->location()) { 797 switch (variable->location()) {
797 case VariableLocation::UNALLOCATED: { 798 case VariableLocation::UNALLOCATED: {
798 globals_->Add(variable->name(), zone()); 799 globals_->Add(variable->name(), zone());
799 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); 800 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
800 DCHECK(!slot.IsInvalid()); 801 DCHECK(!slot.IsInvalid());
801 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); 802 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
803
804 // We need the slot where the literals array lives, too.
805 slot = declaration->fun()->LiteralFeedbackSlot();
806 DCHECK(!slot.IsInvalid());
807 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
808
802 Handle<SharedFunctionInfo> function = 809 Handle<SharedFunctionInfo> function =
803 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); 810 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_);
804 // Check for stack-overflow exception. 811 // Check for stack-overflow exception.
805 if (function.is_null()) return SetStackOverflow(); 812 if (function.is_null()) return SetStackOverflow();
806 globals_->Add(function, zone()); 813 globals_->Add(function, zone());
807 break; 814 break;
808 } 815 }
809 816
810 case VariableLocation::PARAMETER: 817 case VariableLocation::PARAMETER:
811 case VariableLocation::LOCAL: { 818 case VariableLocation::LOCAL: {
(...skipping 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2862 reinterpret_cast<uint32_t>( 2869 reinterpret_cast<uint32_t>(
2863 isolate->builtins()->OnStackReplacement()->entry())); 2870 isolate->builtins()->OnStackReplacement()->entry()));
2864 return ON_STACK_REPLACEMENT; 2871 return ON_STACK_REPLACEMENT;
2865 } 2872 }
2866 2873
2867 2874
2868 } // namespace internal 2875 } // namespace internal
2869 } // namespace v8 2876 } // namespace v8
2870 2877
2871 #endif // V8_TARGET_ARCH_MIPS 2878 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698