| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/type-feedback-vector.h" | 5 #include "src/type-feedback-vector.h" |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 #include "src/ic/ic-state.h" | 9 #include "src/ic/ic-state.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 Handle<Object> feedback_extra = handle(GetFeedbackExtra(), isolate); | 420 Handle<Object> feedback_extra = handle(GetFeedbackExtra(), isolate); |
| 421 if (!feedback_extra->IsFixedArray() || | 421 if (!feedback_extra->IsFixedArray() || |
| 422 FixedArray::cast(*feedback_extra)->length() != length) { | 422 FixedArray::cast(*feedback_extra)->length() != length) { |
| 423 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length); | 423 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length); |
| 424 SetFeedbackExtra(*array); | 424 SetFeedbackExtra(*array); |
| 425 return array; | 425 return array; |
| 426 } | 426 } |
| 427 return Handle<FixedArray>::cast(feedback_extra); | 427 return Handle<FixedArray>::cast(feedback_extra); |
| 428 } | 428 } |
| 429 | 429 |
| 430 | |
| 431 void FeedbackNexus::InstallHandlers(Handle<FixedArray> array, | 430 void FeedbackNexus::InstallHandlers(Handle<FixedArray> array, |
| 432 MapHandleList* maps, | 431 MapHandleList* maps, |
| 433 CodeHandleList* handlers) { | 432 List<Handle<Object>>* handlers) { |
| 434 int receiver_count = maps->length(); | 433 int receiver_count = maps->length(); |
| 435 for (int current = 0; current < receiver_count; ++current) { | 434 for (int current = 0; current < receiver_count; ++current) { |
| 436 Handle<Map> map = maps->at(current); | 435 Handle<Map> map = maps->at(current); |
| 437 Handle<WeakCell> cell = Map::WeakCellForMap(map); | 436 Handle<WeakCell> cell = Map::WeakCellForMap(map); |
| 438 array->set(current * 2, *cell); | 437 array->set(current * 2, *cell); |
| 439 array->set(current * 2 + 1, *handlers->at(current)); | 438 array->set(current * 2 + 1, *handlers->at(current)); |
| 440 } | 439 } |
| 441 } | 440 } |
| 442 | 441 |
| 443 | 442 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 FeedbackNexus::ConfigureMegamorphic(); | 648 FeedbackNexus::ConfigureMegamorphic(); |
| 650 } | 649 } |
| 651 | 650 |
| 652 | 651 |
| 653 void CallICNexus::ConfigureMegamorphic(int call_count) { | 652 void CallICNexus::ConfigureMegamorphic(int call_count) { |
| 654 SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()), | 653 SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()), |
| 655 SKIP_WRITE_BARRIER); | 654 SKIP_WRITE_BARRIER); |
| 656 SetFeedbackExtra(Smi::FromInt(call_count), SKIP_WRITE_BARRIER); | 655 SetFeedbackExtra(Smi::FromInt(call_count), SKIP_WRITE_BARRIER); |
| 657 } | 656 } |
| 658 | 657 |
| 659 | |
| 660 void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map, | 658 void LoadICNexus::ConfigureMonomorphic(Handle<Map> receiver_map, |
| 661 Handle<Code> handler) { | 659 Handle<Object> handler) { |
| 662 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); | 660 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); |
| 663 SetFeedback(*cell); | 661 SetFeedback(*cell); |
| 664 SetFeedbackExtra(*handler); | 662 SetFeedbackExtra(*handler); |
| 665 } | 663 } |
| 666 | 664 |
| 667 void LoadGlobalICNexus::ConfigureUninitialized() { | 665 void LoadGlobalICNexus::ConfigureUninitialized() { |
| 668 Isolate* isolate = GetIsolate(); | 666 Isolate* isolate = GetIsolate(); |
| 669 SetFeedback(isolate->heap()->empty_weak_cell(), SKIP_WRITE_BARRIER); | 667 SetFeedback(isolate->heap()->empty_weak_cell(), SKIP_WRITE_BARRIER); |
| 670 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate), | 668 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate), |
| 671 SKIP_WRITE_BARRIER); | 669 SKIP_WRITE_BARRIER); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 SetFeedback(*cell); | 713 SetFeedback(*cell); |
| 716 SetFeedbackExtra(*handler); | 714 SetFeedbackExtra(*handler); |
| 717 } else { | 715 } else { |
| 718 Handle<FixedArray> array = EnsureExtraArrayOfSize(2); | 716 Handle<FixedArray> array = EnsureExtraArrayOfSize(2); |
| 719 SetFeedback(*name); | 717 SetFeedback(*name); |
| 720 array->set(0, *cell); | 718 array->set(0, *cell); |
| 721 array->set(1, *handler); | 719 array->set(1, *handler); |
| 722 } | 720 } |
| 723 } | 721 } |
| 724 | 722 |
| 725 | |
| 726 void LoadICNexus::ConfigurePolymorphic(MapHandleList* maps, | 723 void LoadICNexus::ConfigurePolymorphic(MapHandleList* maps, |
| 727 CodeHandleList* handlers) { | 724 List<Handle<Object>>* handlers) { |
| 728 Isolate* isolate = GetIsolate(); | 725 Isolate* isolate = GetIsolate(); |
| 729 int receiver_count = maps->length(); | 726 int receiver_count = maps->length(); |
| 730 Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2); | 727 Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2); |
| 731 InstallHandlers(array, maps, handlers); | 728 InstallHandlers(array, maps, handlers); |
| 732 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate), | 729 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate), |
| 733 SKIP_WRITE_BARRIER); | 730 SKIP_WRITE_BARRIER); |
| 734 } | 731 } |
| 735 | 732 |
| 736 void KeyedLoadICNexus::ConfigurePolymorphic(Handle<Name> name, | 733 void KeyedLoadICNexus::ConfigurePolymorphic(Handle<Name> name, |
| 737 MapHandleList* maps, | 734 MapHandleList* maps, |
| 738 CodeHandleList* handlers) { | 735 List<Handle<Object>>* handlers) { |
| 739 int receiver_count = maps->length(); | 736 int receiver_count = maps->length(); |
| 740 DCHECK(receiver_count > 1); | 737 DCHECK(receiver_count > 1); |
| 741 Handle<FixedArray> array; | 738 Handle<FixedArray> array; |
| 742 if (name.is_null()) { | 739 if (name.is_null()) { |
| 743 array = EnsureArrayOfSize(receiver_count * 2); | 740 array = EnsureArrayOfSize(receiver_count * 2); |
| 744 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()), | 741 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()), |
| 745 SKIP_WRITE_BARRIER); | 742 SKIP_WRITE_BARRIER); |
| 746 } else { | 743 } else { |
| 747 array = EnsureExtraArrayOfSize(receiver_count * 2); | 744 array = EnsureExtraArrayOfSize(receiver_count * 2); |
| 748 SetFeedback(*name); | 745 SetFeedback(*name); |
| 749 } | 746 } |
| 750 | 747 |
| 751 InstallHandlers(array, maps, handlers); | 748 InstallHandlers(array, maps, handlers); |
| 752 } | 749 } |
| 753 | 750 |
| 754 | |
| 755 void StoreICNexus::ConfigurePolymorphic(MapHandleList* maps, | 751 void StoreICNexus::ConfigurePolymorphic(MapHandleList* maps, |
| 756 CodeHandleList* handlers) { | 752 List<Handle<Object>>* handlers) { |
| 757 Isolate* isolate = GetIsolate(); | 753 Isolate* isolate = GetIsolate(); |
| 758 int receiver_count = maps->length(); | 754 int receiver_count = maps->length(); |
| 759 Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2); | 755 Handle<FixedArray> array = EnsureArrayOfSize(receiver_count * 2); |
| 760 InstallHandlers(array, maps, handlers); | 756 InstallHandlers(array, maps, handlers); |
| 761 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate), | 757 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(isolate), |
| 762 SKIP_WRITE_BARRIER); | 758 SKIP_WRITE_BARRIER); |
| 763 } | 759 } |
| 764 | 760 |
| 765 | |
| 766 void KeyedStoreICNexus::ConfigurePolymorphic(Handle<Name> name, | 761 void KeyedStoreICNexus::ConfigurePolymorphic(Handle<Name> name, |
| 767 MapHandleList* maps, | 762 MapHandleList* maps, |
| 768 CodeHandleList* handlers) { | 763 List<Handle<Object>>* handlers) { |
| 769 int receiver_count = maps->length(); | 764 int receiver_count = maps->length(); |
| 770 DCHECK(receiver_count > 1); | 765 DCHECK(receiver_count > 1); |
| 771 Handle<FixedArray> array; | 766 Handle<FixedArray> array; |
| 772 if (name.is_null()) { | 767 if (name.is_null()) { |
| 773 array = EnsureArrayOfSize(receiver_count * 2); | 768 array = EnsureArrayOfSize(receiver_count * 2); |
| 774 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()), | 769 SetFeedbackExtra(*TypeFeedbackVector::UninitializedSentinel(GetIsolate()), |
| 775 SKIP_WRITE_BARRIER); | 770 SKIP_WRITE_BARRIER); |
| 776 } else { | 771 } else { |
| 777 array = EnsureExtraArrayOfSize(receiver_count * 2); | 772 array = EnsureExtraArrayOfSize(receiver_count * 2); |
| 778 SetFeedback(*name); | 773 SetFeedback(*name); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 800 Handle<Map> transitioned_map = transitioned_maps->at(i); | 795 Handle<Map> transitioned_map = transitioned_maps->at(i); |
| 801 cell = Map::WeakCellForMap(transitioned_map); | 796 cell = Map::WeakCellForMap(transitioned_map); |
| 802 array->set((i * 3) + 1, *cell); | 797 array->set((i * 3) + 1, *cell); |
| 803 } else { | 798 } else { |
| 804 array->set((i * 3) + 1, *undefined_value); | 799 array->set((i * 3) + 1, *undefined_value); |
| 805 } | 800 } |
| 806 array->set((i * 3) + 2, *handlers->at(i)); | 801 array->set((i * 3) + 2, *handlers->at(i)); |
| 807 } | 802 } |
| 808 } | 803 } |
| 809 | 804 |
| 805 namespace { |
| 806 |
| 807 int GetStepSize(FixedArray* array, Isolate* isolate) { |
| 808 // The array should be of the form |
| 809 // [map, handler, map, handler, ...] |
| 810 // or |
| 811 // [map, map, handler, map, map, handler, ...] |
| 812 // where "map" is either a WeakCell or |undefined|, |
| 813 // and "handler" is either a Code object or a Smi. |
| 814 DCHECK(array->length() >= 2); |
| 815 Object* second = array->get(1); |
| 816 if (second->IsWeakCell() || second->IsUndefined(isolate)) return 3; |
| 817 DCHECK(second->IsCode() || second->IsSmi()); |
| 818 return 2; |
| 819 } |
| 820 |
| 821 #ifdef DEBUG // Only used by DCHECKs below. |
| 822 bool IsHandler(Object* object) { |
| 823 return object->IsSmi() || |
| 824 (object->IsCode() && Code::cast(object)->is_handler()); |
| 825 } |
| 826 #endif |
| 827 |
| 828 } // namespace |
| 810 | 829 |
| 811 int FeedbackNexus::ExtractMaps(MapHandleList* maps) const { | 830 int FeedbackNexus::ExtractMaps(MapHandleList* maps) const { |
| 812 Isolate* isolate = GetIsolate(); | 831 Isolate* isolate = GetIsolate(); |
| 813 Object* feedback = GetFeedback(); | 832 Object* feedback = GetFeedback(); |
| 814 bool is_named_feedback = IsPropertyNameFeedback(feedback); | 833 bool is_named_feedback = IsPropertyNameFeedback(feedback); |
| 815 if (feedback->IsFixedArray() || is_named_feedback) { | 834 if (feedback->IsFixedArray() || is_named_feedback) { |
| 816 int found = 0; | 835 int found = 0; |
| 817 if (is_named_feedback) { | 836 if (is_named_feedback) { |
| 818 feedback = GetFeedbackExtra(); | 837 feedback = GetFeedbackExtra(); |
| 819 } | 838 } |
| 820 FixedArray* array = FixedArray::cast(feedback); | 839 FixedArray* array = FixedArray::cast(feedback); |
| 821 // The array should be of the form | 840 int increment = GetStepSize(array, isolate); |
| 822 // [map, handler, map, handler, ...] | |
| 823 // or | |
| 824 // [map, map, handler, map, map, handler, ...] | |
| 825 DCHECK(array->length() >= 2); | |
| 826 int increment = array->get(1)->IsCode() ? 2 : 3; | |
| 827 for (int i = 0; i < array->length(); i += increment) { | 841 for (int i = 0; i < array->length(); i += increment) { |
| 828 DCHECK(array->get(i)->IsWeakCell()); | 842 DCHECK(array->get(i)->IsWeakCell()); |
| 829 WeakCell* cell = WeakCell::cast(array->get(i)); | 843 WeakCell* cell = WeakCell::cast(array->get(i)); |
| 830 if (!cell->cleared()) { | 844 if (!cell->cleared()) { |
| 831 Map* map = Map::cast(cell->value()); | 845 Map* map = Map::cast(cell->value()); |
| 832 maps->Add(handle(map, isolate)); | 846 maps->Add(handle(map, isolate)); |
| 833 found++; | 847 found++; |
| 834 } | 848 } |
| 835 } | 849 } |
| 836 return found; | 850 return found; |
| 837 } else if (feedback->IsWeakCell()) { | 851 } else if (feedback->IsWeakCell()) { |
| 838 WeakCell* cell = WeakCell::cast(feedback); | 852 WeakCell* cell = WeakCell::cast(feedback); |
| 839 if (!cell->cleared()) { | 853 if (!cell->cleared()) { |
| 840 Map* map = Map::cast(cell->value()); | 854 Map* map = Map::cast(cell->value()); |
| 841 maps->Add(handle(map, isolate)); | 855 maps->Add(handle(map, isolate)); |
| 842 return 1; | 856 return 1; |
| 843 } | 857 } |
| 844 } | 858 } |
| 845 | 859 |
| 846 return 0; | 860 return 0; |
| 847 } | 861 } |
| 848 | 862 |
| 849 | 863 MaybeHandle<Object> FeedbackNexus::FindHandlerForMap(Handle<Map> map) const { |
| 850 MaybeHandle<Code> FeedbackNexus::FindHandlerForMap(Handle<Map> map) const { | |
| 851 Object* feedback = GetFeedback(); | 864 Object* feedback = GetFeedback(); |
| 865 Isolate* isolate = GetIsolate(); |
| 852 bool is_named_feedback = IsPropertyNameFeedback(feedback); | 866 bool is_named_feedback = IsPropertyNameFeedback(feedback); |
| 853 if (feedback->IsFixedArray() || is_named_feedback) { | 867 if (feedback->IsFixedArray() || is_named_feedback) { |
| 854 if (is_named_feedback) { | 868 if (is_named_feedback) { |
| 855 feedback = GetFeedbackExtra(); | 869 feedback = GetFeedbackExtra(); |
| 856 } | 870 } |
| 857 FixedArray* array = FixedArray::cast(feedback); | 871 FixedArray* array = FixedArray::cast(feedback); |
| 858 DCHECK(array->length() >= 2); | 872 int increment = GetStepSize(array, isolate); |
| 859 int increment = array->get(1)->IsCode() ? 2 : 3; | |
| 860 for (int i = 0; i < array->length(); i += increment) { | 873 for (int i = 0; i < array->length(); i += increment) { |
| 861 DCHECK(array->get(i)->IsWeakCell()); | 874 DCHECK(array->get(i)->IsWeakCell()); |
| 862 WeakCell* cell = WeakCell::cast(array->get(i)); | 875 WeakCell* cell = WeakCell::cast(array->get(i)); |
| 863 if (!cell->cleared()) { | 876 if (!cell->cleared()) { |
| 864 Map* array_map = Map::cast(cell->value()); | 877 Map* array_map = Map::cast(cell->value()); |
| 865 if (array_map == *map) { | 878 if (array_map == *map) { |
| 866 Code* code = Code::cast(array->get(i + increment - 1)); | 879 Object* code = array->get(i + increment - 1); |
| 867 DCHECK(code->kind() == Code::HANDLER); | 880 DCHECK(IsHandler(code)); |
| 868 return handle(code); | 881 return handle(code, isolate); |
| 869 } | 882 } |
| 870 } | 883 } |
| 871 } | 884 } |
| 872 } else if (feedback->IsWeakCell()) { | 885 } else if (feedback->IsWeakCell()) { |
| 873 WeakCell* cell = WeakCell::cast(feedback); | 886 WeakCell* cell = WeakCell::cast(feedback); |
| 874 if (!cell->cleared()) { | 887 if (!cell->cleared()) { |
| 875 Map* cell_map = Map::cast(cell->value()); | 888 Map* cell_map = Map::cast(cell->value()); |
| 876 if (cell_map == *map) { | 889 if (cell_map == *map) { |
| 877 Code* code = Code::cast(GetFeedbackExtra()); | 890 Object* code = GetFeedbackExtra(); |
| 878 DCHECK(code->kind() == Code::HANDLER); | 891 DCHECK(IsHandler(code)); |
| 879 return handle(code); | 892 return handle(code, isolate); |
| 880 } | 893 } |
| 881 } | 894 } |
| 882 } | 895 } |
| 883 | 896 |
| 884 return MaybeHandle<Code>(); | 897 return MaybeHandle<Code>(); |
| 885 } | 898 } |
| 886 | 899 |
| 887 | 900 bool FeedbackNexus::FindHandlers(List<Handle<Object>>* code_list, |
| 888 bool FeedbackNexus::FindHandlers(CodeHandleList* code_list, int length) const { | 901 int length) const { |
| 889 Object* feedback = GetFeedback(); | 902 Object* feedback = GetFeedback(); |
| 903 Isolate* isolate = GetIsolate(); |
| 890 int count = 0; | 904 int count = 0; |
| 891 bool is_named_feedback = IsPropertyNameFeedback(feedback); | 905 bool is_named_feedback = IsPropertyNameFeedback(feedback); |
| 892 if (feedback->IsFixedArray() || is_named_feedback) { | 906 if (feedback->IsFixedArray() || is_named_feedback) { |
| 893 if (is_named_feedback) { | 907 if (is_named_feedback) { |
| 894 feedback = GetFeedbackExtra(); | 908 feedback = GetFeedbackExtra(); |
| 895 } | 909 } |
| 896 FixedArray* array = FixedArray::cast(feedback); | 910 FixedArray* array = FixedArray::cast(feedback); |
| 897 // The array should be of the form | 911 int increment = GetStepSize(array, isolate); |
| 898 // [map, handler, map, handler, ...] | |
| 899 // or | |
| 900 // [map, map, handler, map, map, handler, ...] | |
| 901 // Be sure to skip handlers whose maps have been cleared. | |
| 902 DCHECK(array->length() >= 2); | |
| 903 int increment = array->get(1)->IsCode() ? 2 : 3; | |
| 904 for (int i = 0; i < array->length(); i += increment) { | 912 for (int i = 0; i < array->length(); i += increment) { |
| 905 DCHECK(array->get(i)->IsWeakCell()); | 913 DCHECK(array->get(i)->IsWeakCell()); |
| 906 WeakCell* cell = WeakCell::cast(array->get(i)); | 914 WeakCell* cell = WeakCell::cast(array->get(i)); |
| 915 // Be sure to skip handlers whose maps have been cleared. |
| 907 if (!cell->cleared()) { | 916 if (!cell->cleared()) { |
| 908 Code* code = Code::cast(array->get(i + increment - 1)); | 917 Object* code = array->get(i + increment - 1); |
| 909 DCHECK(code->kind() == Code::HANDLER); | 918 DCHECK(IsHandler(code)); |
| 910 code_list->Add(handle(code)); | 919 code_list->Add(handle(code, isolate)); |
| 911 count++; | 920 count++; |
| 912 } | 921 } |
| 913 } | 922 } |
| 914 } else if (feedback->IsWeakCell()) { | 923 } else if (feedback->IsWeakCell()) { |
| 915 WeakCell* cell = WeakCell::cast(feedback); | 924 WeakCell* cell = WeakCell::cast(feedback); |
| 916 if (!cell->cleared()) { | 925 if (!cell->cleared()) { |
| 917 Code* code = Code::cast(GetFeedbackExtra()); | 926 Object* code = GetFeedbackExtra(); |
| 918 DCHECK(code->kind() == Code::HANDLER); | 927 DCHECK(IsHandler(code)); |
| 919 code_list->Add(handle(code)); | 928 code_list->Add(handle(code, isolate)); |
| 920 count++; | 929 count++; |
| 921 } | 930 } |
| 922 } | 931 } |
| 923 return count == length; | 932 return count == length; |
| 924 } | 933 } |
| 925 | 934 |
| 926 | 935 |
| 927 void LoadICNexus::Clear(Code* host) { LoadIC::Clear(GetIsolate(), host, this); } | 936 void LoadICNexus::Clear(Code* host) { LoadIC::Clear(GetIsolate(), host, this); } |
| 928 | 937 |
| 929 void LoadGlobalICNexus::Clear(Code* host) { | 938 void LoadGlobalICNexus::Clear(Code* host) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 959 | 968 |
| 960 | 969 |
| 961 void KeyedStoreICNexus::Clear(Code* host) { | 970 void KeyedStoreICNexus::Clear(Code* host) { |
| 962 KeyedStoreIC::Clear(GetIsolate(), host, this); | 971 KeyedStoreIC::Clear(GetIsolate(), host, this); |
| 963 } | 972 } |
| 964 | 973 |
| 965 | 974 |
| 966 KeyedAccessStoreMode KeyedStoreICNexus::GetKeyedAccessStoreMode() const { | 975 KeyedAccessStoreMode KeyedStoreICNexus::GetKeyedAccessStoreMode() const { |
| 967 KeyedAccessStoreMode mode = STANDARD_STORE; | 976 KeyedAccessStoreMode mode = STANDARD_STORE; |
| 968 MapHandleList maps; | 977 MapHandleList maps; |
| 969 CodeHandleList handlers; | 978 List<Handle<Object>> handlers; |
| 970 | 979 |
| 971 if (GetKeyType() == PROPERTY) return mode; | 980 if (GetKeyType() == PROPERTY) return mode; |
| 972 | 981 |
| 973 ExtractMaps(&maps); | 982 ExtractMaps(&maps); |
| 974 FindHandlers(&handlers, maps.length()); | 983 FindHandlers(&handlers, maps.length()); |
| 975 for (int i = 0; i < handlers.length(); i++) { | 984 for (int i = 0; i < handlers.length(); i++) { |
| 976 // The first handler that isn't the slow handler will have the bits we need. | 985 // The first handler that isn't the slow handler will have the bits we need. |
| 977 Handle<Code> handler = handlers.at(i); | 986 Handle<Code> handler = Handle<Code>::cast(handlers.at(i)); |
| 978 CodeStub::Major major_key = CodeStub::MajorKeyFromKey(handler->stub_key()); | 987 CodeStub::Major major_key = CodeStub::MajorKeyFromKey(handler->stub_key()); |
| 979 uint32_t minor_key = CodeStub::MinorKeyFromKey(handler->stub_key()); | 988 uint32_t minor_key = CodeStub::MinorKeyFromKey(handler->stub_key()); |
| 980 CHECK(major_key == CodeStub::KeyedStoreSloppyArguments || | 989 CHECK(major_key == CodeStub::KeyedStoreSloppyArguments || |
| 981 major_key == CodeStub::StoreFastElement || | 990 major_key == CodeStub::StoreFastElement || |
| 982 major_key == CodeStub::StoreElement || | 991 major_key == CodeStub::StoreElement || |
| 983 major_key == CodeStub::ElementsTransitionAndStore || | 992 major_key == CodeStub::ElementsTransitionAndStore || |
| 984 major_key == CodeStub::NoCache); | 993 major_key == CodeStub::NoCache); |
| 985 if (major_key != CodeStub::NoCache) { | 994 if (major_key != CodeStub::NoCache) { |
| 986 mode = CommonStoreModeBits::decode(minor_key); | 995 mode = CommonStoreModeBits::decode(minor_key); |
| 987 break; | 996 break; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1001 | 1010 |
| 1002 IcCheckType KeyedStoreICNexus::GetKeyType() const { | 1011 IcCheckType KeyedStoreICNexus::GetKeyType() const { |
| 1003 Object* feedback = GetFeedback(); | 1012 Object* feedback = GetFeedback(); |
| 1004 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) { | 1013 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) { |
| 1005 return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value()); | 1014 return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value()); |
| 1006 } | 1015 } |
| 1007 return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT; | 1016 return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT; |
| 1008 } | 1017 } |
| 1009 } // namespace internal | 1018 } // namespace internal |
| 1010 } // namespace v8 | 1019 } // namespace v8 |
| OLD | NEW |