OLD | NEW |
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/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 Memory::Object_at(fp_ + JavaScriptFrameConstants::kFunctionOffset); | 116 Memory::Object_at(fp_ + JavaScriptFrameConstants::kFunctionOffset); |
117 if (maybe_function->IsJSFunction()) { | 117 if (maybe_function->IsJSFunction()) { |
118 JSFunction* function = JSFunction::cast(maybe_function); | 118 JSFunction* function = JSFunction::cast(maybe_function); |
119 JavaScriptFrame::PrintFunctionAndOffset(function, function->code(), pc(), | 119 JavaScriptFrame::PrintFunctionAndOffset(function, function->code(), pc(), |
120 stdout, true); | 120 stdout, true); |
121 } | 121 } |
122 | 122 |
123 ExtraICState extra_state = new_target->extra_ic_state(); | 123 ExtraICState extra_state = new_target->extra_ic_state(); |
124 const char* modifier = ""; | 124 const char* modifier = ""; |
125 if (new_target->kind() == Code::KEYED_STORE_IC) { | 125 if (new_target->kind() == Code::KEYED_STORE_IC) { |
126 modifier = GetTransitionMarkModifier( | 126 KeyedAccessStoreMode mode = |
127 KeyedStoreIC::GetKeyedAccessStoreMode(extra_state)); | 127 FLAG_vector_stores |
| 128 ? casted_nexus<KeyedStoreICNexus>()->GetKeyedAccessStoreMode() |
| 129 : KeyedStoreIC::GetKeyedAccessStoreMode(extra_state); |
| 130 modifier = GetTransitionMarkModifier(mode); |
128 } | 131 } |
129 PrintF(" (%c->%c%s) ", TransitionMarkFromState(old_state), | 132 PrintF(" (%c->%c%s) ", TransitionMarkFromState(old_state), |
130 TransitionMarkFromState(new_state), modifier); | 133 TransitionMarkFromState(new_state), modifier); |
131 #ifdef OBJECT_PRINT | 134 #ifdef OBJECT_PRINT |
132 OFStream os(stdout); | 135 OFStream os(stdout); |
133 name->Print(os); | 136 name->Print(os); |
134 #else | 137 #else |
135 name->ShortPrint(stdout); | 138 name->ShortPrint(stdout); |
136 #endif | 139 #endif |
137 PrintF("]\n"); | 140 PrintF("]\n"); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>(); | 662 KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>(); |
660 nexus->ConfigurePolymorphic(name, maps, handlers); | 663 nexus->ConfigurePolymorphic(name, maps, handlers); |
661 } | 664 } |
662 | 665 |
663 vector_set_ = true; | 666 vector_set_ = true; |
664 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(), | 667 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(), |
665 POLYMORPHIC); | 668 POLYMORPHIC); |
666 } | 669 } |
667 | 670 |
668 | 671 |
| 672 void IC::ConfigureVectorState(MapHandleList* maps, |
| 673 MapHandleList* transitioned_maps, |
| 674 CodeHandleList* handlers) { |
| 675 DCHECK(UseVector()); |
| 676 DCHECK(kind() == Code::KEYED_STORE_IC); |
| 677 KeyedStoreICNexus* nexus = casted_nexus<KeyedStoreICNexus>(); |
| 678 nexus->ConfigurePolymorphic(maps, transitioned_maps, handlers); |
| 679 |
| 680 vector_set_ = true; |
| 681 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(), |
| 682 POLYMORPHIC); |
| 683 } |
| 684 |
| 685 |
669 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { | 686 MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) { |
670 // If the object is undefined or null it's illegal to try to get any | 687 // If the object is undefined or null it's illegal to try to get any |
671 // of its properties; throw a TypeError in that case. | 688 // of its properties; throw a TypeError in that case. |
672 if (object->IsUndefined() || object->IsNull()) { | 689 if (object->IsUndefined() || object->IsNull()) { |
673 return TypeError(MessageTemplate::kNonObjectPropertyLoad, object, name); | 690 return TypeError(MessageTemplate::kNonObjectPropertyLoad, object, name); |
674 } | 691 } |
675 | 692 |
676 // Check if the name is trivially convertible to an index and get | 693 // Check if the name is trivially convertible to an index and get |
677 // the element or char if so. | 694 // the element or char if so. |
678 uint32_t index; | 695 uint32_t index; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 default: | 977 default: |
961 UNREACHABLE(); | 978 UNREACHABLE(); |
962 } | 979 } |
963 return Handle<Code>(); | 980 return Handle<Code>(); |
964 } | 981 } |
965 | 982 |
966 | 983 |
967 Handle<Code> KeyedStoreIC::initialize_stub(Isolate* isolate, | 984 Handle<Code> KeyedStoreIC::initialize_stub(Isolate* isolate, |
968 LanguageMode language_mode, | 985 LanguageMode language_mode, |
969 State initialization_state) { | 986 State initialization_state) { |
970 if (FLAG_vector_stores) { | 987 if (FLAG_vector_stores && initialization_state != MEGAMORPHIC) { |
971 VectorKeyedStoreICTrampolineStub stub(isolate, StoreICState(language_mode)); | 988 VectorKeyedStoreICTrampolineStub stub(isolate, StoreICState(language_mode)); |
972 return stub.GetCode(); | 989 return stub.GetCode(); |
973 } | 990 } |
974 | 991 |
975 return KeyedStoreICInitializeStubHelper(isolate, language_mode, | 992 return KeyedStoreICInitializeStubHelper(isolate, language_mode, |
976 initialization_state); | 993 initialization_state); |
977 } | 994 } |
978 | 995 |
979 | 996 |
980 Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code( | 997 Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code( |
981 Isolate* isolate, LanguageMode language_mode, State initialization_state) { | 998 Isolate* isolate, LanguageMode language_mode, State initialization_state) { |
982 if (FLAG_vector_stores && initialization_state != MEGAMORPHIC) { | 999 if (FLAG_vector_stores && initialization_state != MEGAMORPHIC) { |
983 VectorKeyedStoreICStub stub(isolate, StoreICState(language_mode)); | 1000 VectorKeyedStoreICStub stub(isolate, StoreICState(language_mode)); |
984 return stub.GetCode(); | 1001 return stub.GetCode(); |
985 } | 1002 } |
986 | 1003 |
987 return KeyedStoreICInitializeStubHelper(isolate, language_mode, | 1004 return KeyedStoreICInitializeStubHelper(isolate, language_mode, |
988 initialization_state); | 1005 initialization_state); |
989 } | 1006 } |
990 | 1007 |
991 | 1008 |
| 1009 Handle<Code> KeyedStoreIC::ChooseMegamorphicStub(Isolate* isolate, |
| 1010 ExtraICState extra_state) { |
| 1011 LanguageMode mode = StoreICState::GetLanguageMode(extra_state); |
| 1012 return KeyedStoreICInitializeStubHelper(isolate, mode, MEGAMORPHIC); |
| 1013 } |
| 1014 |
| 1015 |
992 Handle<Code> LoadIC::megamorphic_stub() { | 1016 Handle<Code> LoadIC::megamorphic_stub() { |
993 DCHECK_EQ(Code::KEYED_LOAD_IC, kind()); | 1017 DCHECK_EQ(Code::KEYED_LOAD_IC, kind()); |
994 return KeyedLoadIC::ChooseMegamorphicStub(isolate(), extra_ic_state()); | 1018 return KeyedLoadIC::ChooseMegamorphicStub(isolate(), extra_ic_state()); |
995 } | 1019 } |
996 | 1020 |
997 | 1021 |
998 Handle<Code> LoadIC::SimpleFieldLoad(FieldIndex index) { | 1022 Handle<Code> LoadIC::SimpleFieldLoad(FieldIndex index) { |
999 LoadFieldStub stub(isolate(), index); | 1023 LoadFieldStub stub(isolate(), index); |
1000 return stub.GetCode(); | 1024 return stub.GetCode(); |
1001 } | 1025 } |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1847 case LookupIterator::JSPROXY: | 1871 case LookupIterator::JSPROXY: |
1848 case LookupIterator::NOT_FOUND: | 1872 case LookupIterator::NOT_FOUND: |
1849 UNREACHABLE(); | 1873 UNREACHABLE(); |
1850 } | 1874 } |
1851 return slow_stub(); | 1875 return slow_stub(); |
1852 } | 1876 } |
1853 | 1877 |
1854 | 1878 |
1855 Handle<Code> KeyedStoreIC::StoreElementStub(Handle<Map> receiver_map, | 1879 Handle<Code> KeyedStoreIC::StoreElementStub(Handle<Map> receiver_map, |
1856 KeyedAccessStoreMode store_mode) { | 1880 KeyedAccessStoreMode store_mode) { |
| 1881 Handle<Code> null_handle; |
1857 // Don't handle megamorphic property accesses for INTERCEPTORS or | 1882 // Don't handle megamorphic property accesses for INTERCEPTORS or |
1858 // ACCESSOR_CONSTANT | 1883 // ACCESSOR_CONSTANT |
1859 // via megamorphic stubs, since they don't have a map in their relocation info | 1884 // via megamorphic stubs, since they don't have a map in their relocation info |
1860 // and so the stubs can't be harvested for the object needed for a map check. | 1885 // and so the stubs can't be harvested for the object needed for a map check. |
1861 if (target()->type() != Code::NORMAL) { | 1886 if (target()->type() != Code::NORMAL) { |
1862 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "non-NORMAL target type"); | 1887 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "non-NORMAL target type"); |
1863 return megamorphic_stub(); | 1888 return megamorphic_stub(); |
1864 } | 1889 } |
1865 | 1890 |
1866 MapHandleList target_receiver_maps; | 1891 MapHandleList target_receiver_maps; |
1867 TargetMaps(&target_receiver_maps); | 1892 TargetMaps(&target_receiver_maps); |
1868 if (target_receiver_maps.length() == 0) { | 1893 if (target_receiver_maps.length() == 0) { |
1869 Handle<Map> monomorphic_map = | 1894 Handle<Map> monomorphic_map = |
1870 ComputeTransitionedMap(receiver_map, store_mode); | 1895 ComputeTransitionedMap(receiver_map, store_mode); |
1871 store_mode = GetNonTransitioningStoreMode(store_mode); | 1896 store_mode = GetNonTransitioningStoreMode(store_mode); |
| 1897 if (FLAG_vector_stores) { |
| 1898 Handle<Code> handler = |
| 1899 PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler( |
| 1900 monomorphic_map, language_mode(), store_mode); |
| 1901 ConfigureVectorState(Handle<Name>::null(), monomorphic_map, handler); |
| 1902 return null_handle; |
| 1903 } |
1872 return PropertyICCompiler::ComputeKeyedStoreMonomorphic( | 1904 return PropertyICCompiler::ComputeKeyedStoreMonomorphic( |
1873 monomorphic_map, language_mode(), store_mode); | 1905 monomorphic_map, language_mode(), store_mode); |
1874 } | 1906 } |
1875 | 1907 |
1876 // There are several special cases where an IC that is MONOMORPHIC can still | 1908 // There are several special cases where an IC that is MONOMORPHIC can still |
1877 // transition to a different GetNonTransitioningStoreMode IC that handles a | 1909 // transition to a different GetNonTransitioningStoreMode IC that handles a |
1878 // superset of the original IC. Handle those here if the receiver map hasn't | 1910 // superset of the original IC. Handle those here if the receiver map hasn't |
1879 // changed or it has transitioned to a more general kind. | 1911 // changed or it has transitioned to a more general kind. |
1880 KeyedAccessStoreMode old_store_mode = | 1912 KeyedAccessStoreMode old_store_mode = |
1881 KeyedStoreIC::GetKeyedAccessStoreMode(target()->extra_ic_state()); | 1913 FLAG_vector_stores |
| 1914 ? GetKeyedAccessStoreMode() |
| 1915 : KeyedStoreIC::GetKeyedAccessStoreMode(target()->extra_ic_state()); |
1882 Handle<Map> previous_receiver_map = target_receiver_maps.at(0); | 1916 Handle<Map> previous_receiver_map = target_receiver_maps.at(0); |
1883 if (state() == MONOMORPHIC) { | 1917 if (state() == MONOMORPHIC) { |
1884 Handle<Map> transitioned_receiver_map = receiver_map; | 1918 Handle<Map> transitioned_receiver_map = receiver_map; |
1885 if (IsTransitionStoreMode(store_mode)) { | 1919 if (IsTransitionStoreMode(store_mode)) { |
1886 transitioned_receiver_map = | 1920 transitioned_receiver_map = |
1887 ComputeTransitionedMap(receiver_map, store_mode); | 1921 ComputeTransitionedMap(receiver_map, store_mode); |
1888 } | 1922 } |
1889 if ((receiver_map.is_identical_to(previous_receiver_map) && | 1923 if ((receiver_map.is_identical_to(previous_receiver_map) && |
1890 IsTransitionStoreMode(store_mode)) || | 1924 IsTransitionStoreMode(store_mode)) || |
1891 IsTransitionOfMonomorphicTarget(*previous_receiver_map, | 1925 IsTransitionOfMonomorphicTarget(*previous_receiver_map, |
1892 *transitioned_receiver_map)) { | 1926 *transitioned_receiver_map)) { |
1893 // If the "old" and "new" maps are in the same elements map family, or | 1927 // If the "old" and "new" maps are in the same elements map family, or |
1894 // if they at least come from the same origin for a transitioning store, | 1928 // if they at least come from the same origin for a transitioning store, |
1895 // stay MONOMORPHIC and use the map for the most generic ElementsKind. | 1929 // stay MONOMORPHIC and use the map for the most generic ElementsKind. |
1896 store_mode = GetNonTransitioningStoreMode(store_mode); | 1930 store_mode = GetNonTransitioningStoreMode(store_mode); |
| 1931 if (FLAG_vector_stores) { |
| 1932 Handle<Code> handler = |
| 1933 PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler( |
| 1934 transitioned_receiver_map, language_mode(), store_mode); |
| 1935 ConfigureVectorState(Handle<Name>::null(), transitioned_receiver_map, |
| 1936 handler); |
| 1937 return null_handle; |
| 1938 } |
1897 return PropertyICCompiler::ComputeKeyedStoreMonomorphic( | 1939 return PropertyICCompiler::ComputeKeyedStoreMonomorphic( |
1898 transitioned_receiver_map, language_mode(), store_mode); | 1940 transitioned_receiver_map, language_mode(), store_mode); |
1899 } else if (receiver_map.is_identical_to(previous_receiver_map) && | 1941 } else if (receiver_map.is_identical_to(previous_receiver_map) && |
1900 old_store_mode == STANDARD_STORE && | 1942 old_store_mode == STANDARD_STORE && |
1901 (store_mode == STORE_AND_GROW_NO_TRANSITION || | 1943 (store_mode == STORE_AND_GROW_NO_TRANSITION || |
1902 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || | 1944 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || |
1903 store_mode == STORE_NO_TRANSITION_HANDLE_COW)) { | 1945 store_mode == STORE_NO_TRANSITION_HANDLE_COW)) { |
1904 // A "normal" IC that handles stores can switch to a version that can | 1946 // A "normal" IC that handles stores can switch to a version that can |
1905 // grow at the end of the array, handle OOB accesses or copy COW arrays | 1947 // grow at the end of the array, handle OOB accesses or copy COW arrays |
1906 // and still stay MONOMORPHIC. | 1948 // and still stay MONOMORPHIC. |
| 1949 if (FLAG_vector_stores) { |
| 1950 Handle<Code> handler = |
| 1951 PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler( |
| 1952 receiver_map, language_mode(), store_mode); |
| 1953 ConfigureVectorState(Handle<Name>::null(), receiver_map, handler); |
| 1954 return null_handle; |
| 1955 } |
1907 return PropertyICCompiler::ComputeKeyedStoreMonomorphic( | 1956 return PropertyICCompiler::ComputeKeyedStoreMonomorphic( |
1908 receiver_map, language_mode(), store_mode); | 1957 receiver_map, language_mode(), store_mode); |
1909 } | 1958 } |
1910 } | 1959 } |
1911 | 1960 |
1912 DCHECK(state() != GENERIC); | 1961 DCHECK(state() != GENERIC); |
1913 | 1962 |
1914 bool map_added = | 1963 bool map_added = |
1915 AddOneReceiverMapIfMissing(&target_receiver_maps, receiver_map); | 1964 AddOneReceiverMapIfMissing(&target_receiver_maps, receiver_map); |
1916 | 1965 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 } | 2006 } |
1958 } | 2007 } |
1959 if (external_arrays != 0 && | 2008 if (external_arrays != 0 && |
1960 external_arrays != target_receiver_maps.length()) { | 2009 external_arrays != target_receiver_maps.length()) { |
1961 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", | 2010 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", |
1962 "unsupported combination of external and normal arrays"); | 2011 "unsupported combination of external and normal arrays"); |
1963 return megamorphic_stub(); | 2012 return megamorphic_stub(); |
1964 } | 2013 } |
1965 } | 2014 } |
1966 | 2015 |
| 2016 if (FLAG_vector_stores) { |
| 2017 MapHandleList transitioned_maps(target_receiver_maps.length()); |
| 2018 CodeHandleList handlers(target_receiver_maps.length()); |
| 2019 PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers( |
| 2020 &target_receiver_maps, &transitioned_maps, &handlers, store_mode, |
| 2021 language_mode()); |
| 2022 ConfigureVectorState(&target_receiver_maps, &transitioned_maps, &handlers); |
| 2023 return null_handle; |
| 2024 } |
| 2025 |
1967 return PropertyICCompiler::ComputeKeyedStorePolymorphic( | 2026 return PropertyICCompiler::ComputeKeyedStorePolymorphic( |
1968 &target_receiver_maps, store_mode, language_mode()); | 2027 &target_receiver_maps, store_mode, language_mode()); |
1969 } | 2028 } |
1970 | 2029 |
1971 | 2030 |
1972 Handle<Map> KeyedStoreIC::ComputeTransitionedMap( | 2031 Handle<Map> KeyedStoreIC::ComputeTransitionedMap( |
1973 Handle<Map> map, KeyedAccessStoreMode store_mode) { | 2032 Handle<Map> map, KeyedAccessStoreMode store_mode) { |
1974 switch (store_mode) { | 2033 switch (store_mode) { |
1975 case STORE_TRANSITION_TO_OBJECT: | 2034 case STORE_TRANSITION_TO_OBJECT: |
1976 case STORE_AND_GROW_TRANSITION_TO_OBJECT: { | 2035 case STORE_AND_GROW_TRANSITION_TO_OBJECT: { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 } else if (key_is_valid_index) { | 2252 } else if (key_is_valid_index) { |
2194 // We should go generic if receiver isn't a dictionary, but our | 2253 // We should go generic if receiver isn't a dictionary, but our |
2195 // prototype chain does have dictionary elements. This ensures that | 2254 // prototype chain does have dictionary elements. This ensures that |
2196 // other non-dictionary receivers in the polymorphic case benefit | 2255 // other non-dictionary receivers in the polymorphic case benefit |
2197 // from fast path keyed stores. | 2256 // from fast path keyed stores. |
2198 if (!old_receiver_map->DictionaryElementsInPrototypeChainOnly()) { | 2257 if (!old_receiver_map->DictionaryElementsInPrototypeChainOnly()) { |
2199 stub = StoreElementStub(old_receiver_map, store_mode); | 2258 stub = StoreElementStub(old_receiver_map, store_mode); |
2200 | 2259 |
2201 // Validate that the store_mode in the stub can also be derived | 2260 // Validate that the store_mode in the stub can also be derived |
2202 // from peeking in the code bits of the handlers. | 2261 // from peeking in the code bits of the handlers. |
2203 ValidateStoreMode(stub); | 2262 if (!FLAG_vector_stores) ValidateStoreMode(stub); |
2204 } else { | 2263 } else { |
2205 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "dictionary prototype"); | 2264 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "dictionary prototype"); |
2206 } | 2265 } |
2207 } else { | 2266 } else { |
2208 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "non-smi-like key"); | 2267 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "non-smi-like key"); |
2209 } | 2268 } |
2210 } else { | 2269 } else { |
2211 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "non-JSObject receiver"); | 2270 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "non-JSObject receiver"); |
2212 } | 2271 } |
2213 } | 2272 } |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2460 // Used from ic-<arch>.cc. | 2519 // Used from ic-<arch>.cc. |
2461 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2520 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
2462 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2521 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2463 HandleScope scope(isolate); | 2522 HandleScope scope(isolate); |
2464 Handle<Object> receiver = args.at<Object>(0); | 2523 Handle<Object> receiver = args.at<Object>(0); |
2465 Handle<Name> key = args.at<Name>(1); | 2524 Handle<Name> key = args.at<Name>(1); |
2466 Handle<Object> value = args.at<Object>(2); | 2525 Handle<Object> value = args.at<Object>(2); |
2467 Handle<Object> result; | 2526 Handle<Object> result; |
2468 | 2527 |
2469 if (FLAG_vector_stores) { | 2528 if (FLAG_vector_stores) { |
2470 DCHECK(args.length() == 5); | 2529 DCHECK(args.length() == 5 || args.length() == 6); |
2471 Handle<Smi> slot = args.at<Smi>(3); | 2530 Handle<Smi> slot = args.at<Smi>(3); |
2472 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2531 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2473 FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value()); | 2532 FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value()); |
2474 if (vector->GetKind(vector_slot) == Code::STORE_IC) { | 2533 if (vector->GetKind(vector_slot) == Code::STORE_IC) { |
2475 StoreICNexus nexus(vector, vector_slot); | 2534 StoreICNexus nexus(vector, vector_slot); |
2476 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2535 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2477 ic.UpdateState(receiver, key); | 2536 ic.UpdateState(receiver, key); |
2478 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2537 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
2479 ic.Store(receiver, key, value)); | 2538 ic.Store(receiver, key, value)); |
2480 } else { | 2539 } else { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2588 ic.UpdateState(receiver, key); | 2647 ic.UpdateState(receiver, key); |
2589 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2648 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2590 isolate, result, ic.Store(receiver, key, args.at<Object>(2))); | 2649 isolate, result, ic.Store(receiver, key, args.at<Object>(2))); |
2591 } | 2650 } |
2592 return *result; | 2651 return *result; |
2593 } | 2652 } |
2594 | 2653 |
2595 | 2654 |
2596 RUNTIME_FUNCTION(Runtime_StoreIC_Slow) { | 2655 RUNTIME_FUNCTION(Runtime_StoreIC_Slow) { |
2597 HandleScope scope(isolate); | 2656 HandleScope scope(isolate); |
2598 DCHECK(args.length() == 3); | 2657 DCHECK(args.length() == (FLAG_vector_stores ? 5 : 3)); |
2599 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); | |
2600 Handle<Object> object = args.at<Object>(0); | 2658 Handle<Object> object = args.at<Object>(0); |
2601 Handle<Object> key = args.at<Object>(1); | 2659 Handle<Object> key = args.at<Object>(1); |
2602 Handle<Object> value = args.at<Object>(2); | 2660 Handle<Object> value = args.at<Object>(2); |
2603 LanguageMode language_mode = ic.language_mode(); | 2661 LanguageMode language_mode; |
| 2662 if (FLAG_vector_stores) { |
| 2663 StoreICNexus nexus(isolate); |
| 2664 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2665 language_mode = ic.language_mode(); |
| 2666 } else { |
| 2667 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2668 language_mode = ic.language_mode(); |
| 2669 } |
2604 Handle<Object> result; | 2670 Handle<Object> result; |
2605 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2671 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2606 isolate, result, | 2672 isolate, result, |
2607 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2673 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
2608 return *result; | 2674 return *result; |
2609 } | 2675 } |
2610 | 2676 |
2611 | 2677 |
2612 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { | 2678 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { |
2613 HandleScope scope(isolate); | 2679 HandleScope scope(isolate); |
2614 DCHECK(args.length() == 3); | 2680 DCHECK(args.length() == (FLAG_vector_stores ? 5 : 3)); |
2615 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); | |
2616 Handle<Object> object = args.at<Object>(0); | 2681 Handle<Object> object = args.at<Object>(0); |
2617 Handle<Object> key = args.at<Object>(1); | 2682 Handle<Object> key = args.at<Object>(1); |
2618 Handle<Object> value = args.at<Object>(2); | 2683 Handle<Object> value = args.at<Object>(2); |
2619 LanguageMode language_mode = ic.language_mode(); | 2684 LanguageMode language_mode; |
| 2685 if (FLAG_vector_stores) { |
| 2686 KeyedStoreICNexus nexus(isolate); |
| 2687 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2688 language_mode = ic.language_mode(); |
| 2689 } else { |
| 2690 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2691 language_mode = ic.language_mode(); |
| 2692 } |
2620 Handle<Object> result; | 2693 Handle<Object> result; |
2621 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2694 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2622 isolate, result, | 2695 isolate, result, |
2623 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2696 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
2624 return *result; | 2697 return *result; |
2625 } | 2698 } |
2626 | 2699 |
2627 | 2700 |
2628 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { | 2701 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { |
2629 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2702 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2630 HandleScope scope(isolate); | 2703 HandleScope scope(isolate); |
2631 DCHECK(args.length() == 4); | 2704 DCHECK(args.length() == (FLAG_vector_stores ? 6 : 4)); |
2632 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | |
2633 Handle<Object> object = args.at<Object>(0); | 2705 Handle<Object> object = args.at<Object>(0); |
2634 Handle<Object> key = args.at<Object>(1); | 2706 Handle<Object> key = args.at<Object>(1); |
2635 Handle<Object> value = args.at<Object>(2); | 2707 Handle<Object> value = args.at<Object>(2); |
2636 Handle<Map> map = args.at<Map>(3); | 2708 Handle<Map> map = args.at<Map>(FLAG_vector_stores ? 5 : 3); |
2637 | 2709 LanguageMode language_mode; |
2638 LanguageMode language_mode = ic.language_mode(); | 2710 if (FLAG_vector_stores) { |
| 2711 KeyedStoreICNexus nexus(isolate); |
| 2712 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2713 language_mode = ic.language_mode(); |
| 2714 } else { |
| 2715 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
| 2716 language_mode = ic.language_mode(); |
| 2717 } |
2639 if (object->IsJSObject()) { | 2718 if (object->IsJSObject()) { |
2640 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), | 2719 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), |
2641 map->elements_kind()); | 2720 map->elements_kind()); |
2642 } | 2721 } |
2643 Handle<Object> result; | 2722 Handle<Object> result; |
2644 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2723 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2645 isolate, result, | 2724 isolate, result, |
2646 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2725 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
2647 return *result; | 2726 return *result; |
2648 } | 2727 } |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3132 KeyedLoadICNexus nexus(vector, vector_slot); | 3211 KeyedLoadICNexus nexus(vector, vector_slot); |
3133 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3212 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3134 ic.UpdateState(receiver, key); | 3213 ic.UpdateState(receiver, key); |
3135 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 3214 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
3136 } | 3215 } |
3137 | 3216 |
3138 return *result; | 3217 return *result; |
3139 } | 3218 } |
3140 } // namespace internal | 3219 } // namespace internal |
3141 } // namespace v8 | 3220 } // namespace v8 |
OLD | NEW |