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

Side by Side Diff: src/code-stubs.cc

Issue 1248303002: Unify runtime-style IC functions with Runtime intrinsics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make mips work Created 5 years, 5 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/assembler.cc ('k') | src/compiler/ast-graph-builder.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 #include "src/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 void JSEntryStub::FinishCode(Handle<Code> code) { 618 void JSEntryStub::FinishCode(Handle<Code> code) {
619 Handle<FixedArray> handler_table = 619 Handle<FixedArray> handler_table =
620 code->GetIsolate()->factory()->NewFixedArray(1, TENURED); 620 code->GetIsolate()->factory()->NewFixedArray(1, TENURED);
621 handler_table->set(0, Smi::FromInt(handler_offset_)); 621 handler_table->set(0, Smi::FromInt(handler_offset_));
622 code->set_handler_table(*handler_table); 622 code->set_handler_table(*handler_table);
623 } 623 }
624 624
625 625
626 void LoadDictionaryElementStub::InitializeDescriptor( 626 void LoadDictionaryElementStub::InitializeDescriptor(
627 CodeStubDescriptor* descriptor) { 627 CodeStubDescriptor* descriptor) {
628 descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); 628 descriptor->Initialize(
629 FUNCTION_ADDR(Runtime_KeyedLoadIC_MissFromStubFailure));
629 } 630 }
630 631
631 632
632 void KeyedLoadGenericStub::InitializeDescriptor( 633 void KeyedLoadGenericStub::InitializeDescriptor(
633 CodeStubDescriptor* descriptor) { 634 CodeStubDescriptor* descriptor) {
634 descriptor->Initialize( 635 descriptor->Initialize(
635 Runtime::FunctionForId(is_strong(language_mode()) 636 Runtime::FunctionForId(is_strong(language_mode())
636 ? Runtime::kKeyedGetPropertyStrong 637 ? Runtime::kKeyedGetPropertyStrong
637 : Runtime::kKeyedGetProperty)->entry); 638 : Runtime::kKeyedGetProperty)->entry);
638 } 639 }
639 640
640 641
641 void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 642 void HandlerStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
642 if (kind() == Code::STORE_IC) { 643 if (kind() == Code::STORE_IC) {
643 descriptor->Initialize(FUNCTION_ADDR(StoreIC_MissFromStubFailure)); 644 descriptor->Initialize(FUNCTION_ADDR(Runtime_StoreIC_MissFromStubFailure));
644 } else if (kind() == Code::KEYED_LOAD_IC) { 645 } else if (kind() == Code::KEYED_LOAD_IC) {
645 descriptor->Initialize(FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); 646 descriptor->Initialize(
647 FUNCTION_ADDR(Runtime_KeyedLoadIC_MissFromStubFailure));
646 } else if (kind() == Code::KEYED_STORE_IC) { 648 } else if (kind() == Code::KEYED_STORE_IC) {
647 descriptor->Initialize(FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); 649 descriptor->Initialize(
650 FUNCTION_ADDR(Runtime_KeyedStoreIC_MissFromStubFailure));
648 } 651 }
649 } 652 }
650 653
651 654
652 CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const { 655 CallInterfaceDescriptor HandlerStub::GetCallInterfaceDescriptor() const {
653 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { 656 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) {
654 return LoadWithVectorDescriptor(isolate()); 657 return LoadWithVectorDescriptor(isolate());
655 } else { 658 } else {
656 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); 659 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC);
657 return StoreDescriptor(isolate()); 660 return StoreDescriptor(isolate());
658 } 661 }
659 } 662 }
660 663
661 664
662 void StoreFastElementStub::InitializeDescriptor( 665 void StoreFastElementStub::InitializeDescriptor(
663 CodeStubDescriptor* descriptor) { 666 CodeStubDescriptor* descriptor) {
664 descriptor->Initialize(FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); 667 descriptor->Initialize(
668 FUNCTION_ADDR(Runtime_KeyedStoreIC_MissFromStubFailure));
665 } 669 }
666 670
667 671
668 void ElementsTransitionAndStoreStub::InitializeDescriptor( 672 void ElementsTransitionAndStoreStub::InitializeDescriptor(
669 CodeStubDescriptor* descriptor) { 673 CodeStubDescriptor* descriptor) {
670 descriptor->Initialize(FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); 674 descriptor->Initialize(
675 FUNCTION_ADDR(Runtime_ElementsTransitionAndStoreIC_Miss));
671 } 676 }
672 677
673 678
674 CallInterfaceDescriptor StoreTransitionStub::GetCallInterfaceDescriptor() 679 CallInterfaceDescriptor StoreTransitionStub::GetCallInterfaceDescriptor()
675 const { 680 const {
676 return StoreTransitionDescriptor(isolate()); 681 return StoreTransitionDescriptor(isolate());
677 } 682 }
678 683
679 684
680 void FastNewClosureStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 685 void FastNewClosureStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 752
748 753
749 void AllocateHeapNumberStub::InitializeDescriptor( 754 void AllocateHeapNumberStub::InitializeDescriptor(
750 CodeStubDescriptor* descriptor) { 755 CodeStubDescriptor* descriptor) {
751 descriptor->Initialize( 756 descriptor->Initialize(
752 Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry); 757 Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry);
753 } 758 }
754 759
755 760
756 void CompareNilICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 761 void CompareNilICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
757 descriptor->Initialize(FUNCTION_ADDR(CompareNilIC_Miss)); 762 descriptor->Initialize(FUNCTION_ADDR(Runtime_CompareNilIC_Miss));
758 descriptor->SetMissHandler( 763 descriptor->SetMissHandler(ExternalReference(
759 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); 764 Runtime::FunctionForId(Runtime::kCompareNilIC_Miss), isolate()));
760 } 765 }
761 766
762 767
763 void ToBooleanStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 768 void ToBooleanStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
764 descriptor->Initialize(FUNCTION_ADDR(ToBooleanIC_Miss)); 769 descriptor->Initialize(FUNCTION_ADDR(Runtime_ToBooleanIC_Miss));
765 descriptor->SetMissHandler( 770 descriptor->SetMissHandler(ExternalReference(
766 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); 771 Runtime::FunctionForId(Runtime::kToBooleanIC_Miss), isolate()));
767 } 772 }
768 773
769 774
770 void BinaryOpICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 775 void BinaryOpICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
771 descriptor->Initialize(FUNCTION_ADDR(BinaryOpIC_Miss)); 776 descriptor->Initialize(FUNCTION_ADDR(Runtime_BinaryOpIC_Miss));
772 descriptor->SetMissHandler( 777 descriptor->SetMissHandler(ExternalReference(
773 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); 778 Runtime::FunctionForId(Runtime::kBinaryOpIC_Miss), isolate()));
774 } 779 }
775 780
776 781
777 void BinaryOpWithAllocationSiteStub::InitializeDescriptor( 782 void BinaryOpWithAllocationSiteStub::InitializeDescriptor(
778 CodeStubDescriptor* descriptor) { 783 CodeStubDescriptor* descriptor) {
779 descriptor->Initialize(FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); 784 descriptor->Initialize(
785 FUNCTION_ADDR(Runtime_BinaryOpIC_MissWithAllocationSite));
780 } 786 }
781 787
782 788
783 void StringAddStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 789 void StringAddStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
784 descriptor->Initialize(Runtime::FunctionForId(Runtime::kStringAddRT)->entry); 790 descriptor->Initialize(Runtime::FunctionForId(Runtime::kStringAddRT)->entry);
785 } 791 }
786 792
787 793
788 void GrowArrayElementsStub::InitializeDescriptor( 794 void GrowArrayElementsStub::InitializeDescriptor(
789 CodeStubDescriptor* descriptor) { 795 CodeStubDescriptor* descriptor) {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 1090
1085 if (type->Is(Type::UntaggedPointer())) { 1091 if (type->Is(Type::UntaggedPointer())) {
1086 return Representation::External(); 1092 return Representation::External();
1087 } 1093 }
1088 1094
1089 DCHECK(!type->Is(Type::Untagged())); 1095 DCHECK(!type->Is(Type::Untagged()));
1090 return Representation::Tagged(); 1096 return Representation::Tagged();
1091 } 1097 }
1092 } // namespace internal 1098 } // namespace internal
1093 } // namespace v8 1099 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698