Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1317 // If the maximum number of receiver maps has been exceeded, use the generic | 1317 // If the maximum number of receiver maps has been exceeded, use the generic |
| 1318 // version of the IC. | 1318 // version of the IC. |
| 1319 if (target_receiver_maps.length() > kMaxKeyedPolymorphism) { | 1319 if (target_receiver_maps.length() > kMaxKeyedPolymorphism) { |
| 1320 TRACE_GENERIC_IC(isolate(), "KeyedIC", "max polymorph exceeded"); | 1320 TRACE_GENERIC_IC(isolate(), "KeyedIC", "max polymorph exceeded"); |
| 1321 return generic_stub(); | 1321 return generic_stub(); |
| 1322 } | 1322 } |
| 1323 | 1323 |
| 1324 return isolate()->stub_cache()->ComputeLoadElementPolymorphic( | 1324 return isolate()->stub_cache()->ComputeLoadElementPolymorphic( |
| 1325 &target_receiver_maps); | 1325 &target_receiver_maps); |
| 1326 } | 1326 } |
| 1327 | 1327 |
|
Hannes Payer (out of office)
2013/03/20 10:22:35
Can you bring back the newline?
danno
2013/03/20 11:44:10
Done.
| |
| 1328 | |
| 1329 MaybeObject* KeyedLoadIC::Load(State state, | 1328 MaybeObject* KeyedLoadIC::Load(State state, |
| 1330 Handle<Object> object, | 1329 Handle<Object> object, |
| 1331 Handle<Object> key, | 1330 Handle<Object> key, |
| 1332 ICMissMode miss_mode) { | 1331 ICMissMode miss_mode) { |
| 1333 // Check for values that can be converted into an internalized string directly | 1332 // Check for values that can be converted into an internalized string directly |
| 1334 // or is representable as a smi. | 1333 // or is representable as a smi. |
| 1335 key = TryConvertKey(key, isolate()); | 1334 key = TryConvertKey(key, isolate()); |
| 1336 | 1335 |
| 1337 if (key->IsInternalizedString()) { | 1336 if (key->IsInternalizedString()) { |
| 1338 return LoadIC::Load(state, object, Handle<String>::cast(key)); | 1337 return LoadIC::Load(state, object, Handle<String>::cast(key)); |
| 1339 } | 1338 } |
| 1340 | 1339 |
| 1341 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); | 1340 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); |
| 1342 ASSERT(!(use_ic && object->IsJSGlobalProxy())); | 1341 ASSERT(!(use_ic && object->IsJSGlobalProxy())); |
| 1343 | 1342 |
| 1344 if (use_ic) { | 1343 if (use_ic) { |
| 1345 Handle<Code> stub = generic_stub(); | 1344 Handle<Code> stub = generic_stub(); |
| 1346 if (miss_mode != MISS_FORCE_GENERIC) { | 1345 if (miss_mode != MISS_FORCE_GENERIC) { |
| 1347 if (object->IsString() && key->IsNumber()) { | 1346 if (object->IsString() && key->IsNumber()) { |
| 1348 if (state == UNINITIALIZED) { | 1347 if (state == UNINITIALIZED) { |
| 1349 stub = string_stub(); | 1348 stub = string_stub(); |
| 1350 } | 1349 } |
| 1351 } else if (object->IsJSObject()) { | 1350 } else if (object->IsJSObject()) { |
| 1352 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1351 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
| 1353 if (receiver->elements()->map() == | 1352 if (receiver->elements()->map() == |
| 1354 isolate()->heap()->non_strict_arguments_elements_map()) { | 1353 isolate()->heap()->non_strict_arguments_elements_map()) { |
| 1355 stub = non_strict_arguments_stub(); | 1354 stub = non_strict_arguments_stub(); |
| 1356 } else if (receiver->HasIndexedInterceptor()) { | 1355 } else if (receiver->HasIndexedInterceptor()) { |
| 1357 stub = indexed_interceptor_stub(); | 1356 stub = indexed_interceptor_stub(); |
| 1358 } else if (key->IsSmi() && (target() != *non_strict_arguments_stub())) { | 1357 } else if (!key->ToSmi()->IsFailure() && |
| 1358 (target() != *non_strict_arguments_stub())) { | |
| 1359 stub = LoadElementStub(receiver); | 1359 stub = LoadElementStub(receiver); |
| 1360 } | 1360 } |
| 1361 } | 1361 } |
| 1362 } else { | 1362 } else { |
| 1363 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "force generic"); | 1363 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "force generic"); |
| 1364 } | 1364 } |
| 1365 ASSERT(!stub.is_null()); | 1365 ASSERT(!stub.is_null()); |
| 1366 set_target(*stub); | 1366 set_target(*stub); |
| 1367 TRACE_IC("KeyedLoadIC", key, state, target()); | 1367 TRACE_IC("KeyedLoadIC", key, state, target()); |
| 1368 } | 1368 } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1642 KeyedAccessStoreMode store_mode, | 1642 KeyedAccessStoreMode store_mode, |
| 1643 StrictModeFlag strict_mode) { | 1643 StrictModeFlag strict_mode) { |
| 1644 // Don't handle megamorphic property accesses for INTERCEPTORS or CALLBACKS | 1644 // Don't handle megamorphic property accesses for INTERCEPTORS or CALLBACKS |
| 1645 // via megamorphic stubs, since they don't have a map in their relocation info | 1645 // via megamorphic stubs, since they don't have a map in their relocation info |
| 1646 // and so the stubs can't be harvested for the object needed for a map check. | 1646 // and so the stubs can't be harvested for the object needed for a map check. |
| 1647 if (target()->type() != Code::NORMAL) { | 1647 if (target()->type() != Code::NORMAL) { |
| 1648 TRACE_GENERIC_IC(isolate(), "KeyedIC", "non-NORMAL target type"); | 1648 TRACE_GENERIC_IC(isolate(), "KeyedIC", "non-NORMAL target type"); |
| 1649 return strict_mode == kStrictMode ? generic_stub_strict() : generic_stub(); | 1649 return strict_mode == kStrictMode ? generic_stub_strict() : generic_stub(); |
| 1650 } | 1650 } |
| 1651 | 1651 |
| 1652 if ((store_mode == STORE_NO_TRANSITION_HANDLE_COW || | 1652 if ((store_mode == STORE_NO_TRANSITION_HANDLE_COW || |
|
Hannes Payer (out of office)
2013/03/20 10:22:35
This code should be executed if FLAG_compiled_keye
danno
2013/03/20 11:44:10
Done.
| |
| 1653 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS)) { | 1653 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS)) { |
| 1654 // TODO(danno): We'll soon handle MONOMORPHIC ICs that also support | 1654 // TODO(danno): We'll soon handle MONOMORPHIC ICs that also support |
| 1655 // copying COW arrays and silently ignoring some OOB stores into external | 1655 // copying COW arrays and silently ignoring some OOB stores into external |
| 1656 // arrays, but for now use the generic. | 1656 // arrays, but for now use the generic. |
| 1657 TRACE_GENERIC_IC(isolate(), "KeyedIC", "COW/OOB external array"); | 1657 TRACE_GENERIC_IC(isolate(), "KeyedIC", "COW/OOB external array"); |
| 1658 return strict_mode == kStrictMode | 1658 return strict_mode == kStrictMode |
| 1659 ? generic_stub_strict() | 1659 ? generic_stub_strict() |
| 1660 : generic_stub(); | 1660 : generic_stub(); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1705 transitioned_kind); | 1705 transitioned_kind); |
| 1706 Map* transitioned_previous_map = more_general_transition | 1706 Map* transitioned_previous_map = more_general_transition |
| 1707 ? previous_receiver_map->LookupElementsTransitionMap(transitioned_kind) | 1707 ? previous_receiver_map->LookupElementsTransitionMap(transitioned_kind) |
| 1708 : NULL; | 1708 : NULL; |
| 1709 if (transitioned_previous_map == *transitioned_receiver_map) { | 1709 if (transitioned_previous_map == *transitioned_receiver_map) { |
| 1710 // Element family is the same, use the "worst" case map. | 1710 // Element family is the same, use the "worst" case map. |
| 1711 store_mode = GetNonTransitioningStoreMode(store_mode); | 1711 store_mode = GetNonTransitioningStoreMode(store_mode); |
| 1712 return isolate()->stub_cache()->ComputeKeyedStoreElement( | 1712 return isolate()->stub_cache()->ComputeKeyedStoreElement( |
| 1713 transitioned_receiver_map, strict_mode, store_mode); | 1713 transitioned_receiver_map, strict_mode, store_mode); |
| 1714 } else if (*previous_receiver_map == receiver->map()) { | 1714 } else if (*previous_receiver_map == receiver->map()) { |
| 1715 if (IsGrowStoreMode(store_mode)) { | 1715 if (IsGrowStoreMode(store_mode) || |
| 1716 store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS || | |
| 1717 store_mode == STORE_NO_TRANSITION_HANDLE_COW) { | |
| 1716 // A "normal" IC that handles stores can switch to a version that can | 1718 // A "normal" IC that handles stores can switch to a version that can |
| 1717 // grow at the end of the array and still stay MONOMORPHIC. | 1719 // grow at the end of the array, handle OOB accesses or copy COW arrays |
| 1720 // and still stay MONOMORPHIC. | |
| 1718 return isolate()->stub_cache()->ComputeKeyedStoreElement( | 1721 return isolate()->stub_cache()->ComputeKeyedStoreElement( |
| 1719 receiver_map, strict_mode, store_mode); | 1722 receiver_map, strict_mode, store_mode); |
| 1720 } | 1723 } |
| 1721 } | 1724 } |
| 1722 } | 1725 } |
| 1723 | 1726 |
| 1724 ASSERT(ic_state != GENERIC); | 1727 ASSERT(ic_state != GENERIC); |
| 1725 | 1728 |
| 1726 bool map_added = | 1729 bool map_added = |
| 1727 AddOneReceiverMapIfMissing(&target_receiver_maps, receiver_map); | 1730 AddOneReceiverMapIfMissing(&target_receiver_maps, receiver_map); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1806 return JSArray::cast(*receiver)->length()->IsSmi() && | 1809 return JSArray::cast(*receiver)->length()->IsSmi() && |
| 1807 index >= Smi::cast(JSArray::cast(*receiver)->length())->value(); | 1810 index >= Smi::cast(JSArray::cast(*receiver)->length())->value(); |
| 1808 } | 1811 } |
| 1809 return index >= receiver->elements()->length(); | 1812 return index >= receiver->elements()->length(); |
| 1810 } | 1813 } |
| 1811 | 1814 |
| 1812 | 1815 |
| 1813 KeyedAccessStoreMode KeyedStoreIC::GetStoreMode(Handle<JSObject> receiver, | 1816 KeyedAccessStoreMode KeyedStoreIC::GetStoreMode(Handle<JSObject> receiver, |
| 1814 Handle<Object> key, | 1817 Handle<Object> key, |
| 1815 Handle<Object> value) { | 1818 Handle<Object> value) { |
| 1816 ASSERT(key->IsSmi()); | 1819 ASSERT(!key->ToSmi()->IsFailure()); |
| 1817 int index = Smi::cast(*key)->value(); | 1820 Smi* smi_key = NULL; |
| 1821 key->ToSmi()->To(&smi_key); | |
| 1822 int index = smi_key->value(); | |
| 1818 bool oob_access = IsOutOfBoundsAccess(receiver, index); | 1823 bool oob_access = IsOutOfBoundsAccess(receiver, index); |
| 1819 bool allow_growth = receiver->IsJSArray() && oob_access; | 1824 bool allow_growth = receiver->IsJSArray() && oob_access; |
| 1820 if (allow_growth) { | 1825 if (allow_growth) { |
| 1821 // Handle growing array in stub if necessary. | 1826 // Handle growing array in stub if necessary. |
| 1822 if (receiver->HasFastSmiElements()) { | 1827 if (receiver->HasFastSmiElements()) { |
| 1823 if (value->IsHeapNumber()) { | 1828 if (value->IsHeapNumber()) { |
| 1824 if (receiver->HasFastHoleyElements()) { | 1829 if (receiver->HasFastHoleyElements()) { |
| 1825 return STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE; | 1830 return STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE; |
| 1826 } else { | 1831 } else { |
| 1827 return STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE; | 1832 return STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1865 if (receiver->HasFastHoleyElements()) { | 1870 if (receiver->HasFastHoleyElements()) { |
| 1866 return STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT; | 1871 return STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT; |
| 1867 } else { | 1872 } else { |
| 1868 return STORE_TRANSITION_DOUBLE_TO_OBJECT; | 1873 return STORE_TRANSITION_DOUBLE_TO_OBJECT; |
| 1869 } | 1874 } |
| 1870 } | 1875 } |
| 1871 } | 1876 } |
| 1872 if (!FLAG_trace_external_array_abuse && | 1877 if (!FLAG_trace_external_array_abuse && |
| 1873 receiver->map()->has_external_array_elements() && oob_access) { | 1878 receiver->map()->has_external_array_elements() && oob_access) { |
| 1874 return STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS; | 1879 return STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS; |
| 1880 } | |
| 1881 Heap* heap = receiver->GetHeap(); | |
| 1882 if (receiver->elements()->map() == heap->fixed_cow_array_map()) { | |
| 1883 return STORE_NO_TRANSITION_HANDLE_COW; | |
| 1875 } else { | 1884 } else { |
| 1876 return STANDARD_STORE; | 1885 return STANDARD_STORE; |
| 1877 } | 1886 } |
| 1878 } | 1887 } |
| 1879 } | 1888 } |
| 1880 | 1889 |
| 1881 | 1890 |
| 1882 MaybeObject* KeyedStoreIC::Store(State state, | 1891 MaybeObject* KeyedStoreIC::Store(State state, |
| 1883 StrictModeFlag strict_mode, | 1892 StrictModeFlag strict_mode, |
| 1884 Handle<Object> object, | 1893 Handle<Object> object, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1903 JSObject::cast(*object)->map()->is_observed()); | 1912 JSObject::cast(*object)->map()->is_observed()); |
| 1904 ASSERT(!(use_ic && object->IsJSGlobalProxy())); | 1913 ASSERT(!(use_ic && object->IsJSGlobalProxy())); |
| 1905 | 1914 |
| 1906 if (use_ic) { | 1915 if (use_ic) { |
| 1907 Handle<Code> stub = (strict_mode == kStrictMode) | 1916 Handle<Code> stub = (strict_mode == kStrictMode) |
| 1908 ? generic_stub_strict() | 1917 ? generic_stub_strict() |
| 1909 : generic_stub(); | 1918 : generic_stub(); |
| 1910 if (miss_mode != MISS_FORCE_GENERIC) { | 1919 if (miss_mode != MISS_FORCE_GENERIC) { |
| 1911 if (object->IsJSObject()) { | 1920 if (object->IsJSObject()) { |
| 1912 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1921 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
| 1922 bool key_is_smi_like = key->IsSmi() || | |
| 1923 (FLAG_compiled_keyed_stores && !key->ToSmi()->IsFailure()); | |
| 1913 if (receiver->elements()->map() == | 1924 if (receiver->elements()->map() == |
| 1914 isolate()->heap()->non_strict_arguments_elements_map()) { | 1925 isolate()->heap()->non_strict_arguments_elements_map()) { |
| 1915 stub = non_strict_arguments_stub(); | 1926 stub = non_strict_arguments_stub(); |
| 1916 } else if (key->IsSmi() && (target() != *non_strict_arguments_stub())) { | 1927 } else if (key_is_smi_like && |
| 1928 (target() != *non_strict_arguments_stub())) { | |
| 1917 KeyedAccessStoreMode store_mode = GetStoreMode(receiver, key, value); | 1929 KeyedAccessStoreMode store_mode = GetStoreMode(receiver, key, value); |
| 1918 stub = StoreElementStub(receiver, store_mode, strict_mode); | 1930 stub = StoreElementStub(receiver, store_mode, strict_mode); |
| 1931 } else { | |
| 1932 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "key not a number"); | |
| 1919 } | 1933 } |
| 1934 } else { | |
| 1935 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "not an object"); | |
| 1920 } | 1936 } |
| 1921 } else { | 1937 } else { |
| 1922 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "force generic"); | 1938 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "force generic"); |
| 1923 } | 1939 } |
| 1924 ASSERT(!stub.is_null()); | 1940 ASSERT(!stub.is_null()); |
| 1925 set_target(*stub); | 1941 set_target(*stub); |
| 1926 TRACE_IC("KeyedStoreIC", key, state, target()); | 1942 TRACE_IC("KeyedStoreIC", key, state, target()); |
| 1927 } | 1943 } |
| 1928 | 1944 |
| 1929 return Runtime::SetObjectProperty( | 1945 return Runtime::SetObjectProperty( |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2067 args.at<Object>(0), | 2083 args.at<Object>(0), |
| 2068 args.at<Object>(1), | 2084 args.at<Object>(1), |
| 2069 MISS_FORCE_GENERIC); | 2085 MISS_FORCE_GENERIC); |
| 2070 } | 2086 } |
| 2071 | 2087 |
| 2072 | 2088 |
| 2073 // Used from ic-<arch>.cc. | 2089 // Used from ic-<arch>.cc. |
| 2074 RUNTIME_FUNCTION(MaybeObject*, StoreIC_Miss) { | 2090 RUNTIME_FUNCTION(MaybeObject*, StoreIC_Miss) { |
| 2075 HandleScope scope(isolate); | 2091 HandleScope scope(isolate); |
| 2076 ASSERT(args.length() == 3); | 2092 ASSERT(args.length() == 3); |
| 2077 StoreIC ic(isolate); | 2093 StoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2078 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); | 2094 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); |
| 2079 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); | 2095 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); |
| 2080 return ic.Store(state, | 2096 return ic.Store(state, |
| 2081 Code::GetStrictMode(extra_ic_state), | 2097 Code::GetStrictMode(extra_ic_state), |
| 2082 args.at<Object>(0), | 2098 args.at<Object>(0), |
| 2083 args.at<String>(1), | 2099 args.at<String>(1), |
| 2084 args.at<Object>(2)); | 2100 args.at<Object>(2)); |
| 2085 } | 2101 } |
| 2086 | 2102 |
| 2087 | 2103 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2143 | 2159 |
| 2144 // Return the stored value. | 2160 // Return the stored value. |
| 2145 return value; | 2161 return value; |
| 2146 } | 2162 } |
| 2147 | 2163 |
| 2148 | 2164 |
| 2149 // Used from ic-<arch>.cc. | 2165 // Used from ic-<arch>.cc. |
| 2150 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Miss) { | 2166 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Miss) { |
| 2151 HandleScope scope(isolate); | 2167 HandleScope scope(isolate); |
| 2152 ASSERT(args.length() == 3); | 2168 ASSERT(args.length() == 3); |
| 2153 KeyedStoreIC ic(isolate); | 2169 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2154 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); | 2170 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); |
| 2155 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); | 2171 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); |
| 2156 return ic.Store(state, | 2172 return ic.Store(state, |
| 2173 Code::GetStrictMode(extra_ic_state), | |
| 2174 args.at<Object>(0), | |
| 2175 args.at<Object>(1), | |
| 2176 args.at<Object>(2), | |
| 2177 MISS); | |
| 2178 } | |
| 2179 | |
| 2180 | |
| 2181 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure) { | |
| 2182 HandleScope scope(isolate); | |
| 2183 ASSERT(args.length() == 3); | |
| 2184 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | |
| 2185 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); | |
| 2186 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); | |
| 2187 return ic.Store(state, | |
| 2157 Code::GetStrictMode(extra_ic_state), | 2188 Code::GetStrictMode(extra_ic_state), |
| 2158 args.at<Object>(0), | 2189 args.at<Object>(0), |
| 2159 args.at<Object>(1), | 2190 args.at<Object>(1), |
| 2160 args.at<Object>(2), | 2191 args.at<Object>(2), |
| 2161 MISS); | 2192 MISS); |
| 2162 } | 2193 } |
| 2163 | 2194 |
| 2164 | 2195 |
| 2165 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Slow) { | 2196 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_Slow) { |
| 2166 NoHandleAllocation na(isolate); | 2197 NoHandleAllocation na(isolate); |
| 2167 ASSERT(args.length() == 3); | 2198 ASSERT(args.length() == 3); |
| 2168 KeyedStoreIC ic(isolate); | 2199 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2169 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); | 2200 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); |
| 2170 Handle<Object> object = args.at<Object>(0); | 2201 Handle<Object> object = args.at<Object>(0); |
| 2171 Handle<Object> key = args.at<Object>(1); | 2202 Handle<Object> key = args.at<Object>(1); |
| 2172 Handle<Object> value = args.at<Object>(2); | 2203 Handle<Object> value = args.at<Object>(2); |
| 2173 StrictModeFlag strict_mode = Code::GetStrictMode(extra_ic_state); | 2204 StrictModeFlag strict_mode = Code::GetStrictMode(extra_ic_state); |
| 2174 return Runtime::SetObjectProperty(isolate, | 2205 return Runtime::SetObjectProperty(isolate, |
| 2175 object, | 2206 object, |
| 2176 key, | 2207 key, |
| 2177 value, | 2208 value, |
| 2178 NONE, | 2209 NONE, |
| 2179 strict_mode); | 2210 strict_mode); |
| 2180 } | 2211 } |
| 2181 | 2212 |
| 2182 | 2213 |
| 2183 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissForceGeneric) { | 2214 RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissForceGeneric) { |
| 2184 HandleScope scope(isolate); | 2215 HandleScope scope(isolate); |
| 2185 ASSERT(args.length() == 3); | 2216 ASSERT(args.length() == 3); |
| 2186 KeyedStoreIC ic(isolate); | 2217 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2187 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); | 2218 IC::State state = IC::StateFrom(ic.target(), args[0], args[1]); |
| 2188 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); | 2219 Code::ExtraICState extra_ic_state = ic.target()->extra_ic_state(); |
| 2189 return ic.Store(state, | 2220 return ic.Store(state, |
| 2190 Code::GetStrictMode(extra_ic_state), | 2221 Code::GetStrictMode(extra_ic_state), |
| 2191 args.at<Object>(0), | 2222 args.at<Object>(0), |
| 2192 args.at<Object>(1), | 2223 args.at<Object>(1), |
| 2193 args.at<Object>(2), | 2224 args.at<Object>(2), |
| 2194 MISS_FORCE_GENERIC); | 2225 MISS_FORCE_GENERIC); |
| 2195 } | 2226 } |
| 2196 | 2227 |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2737 #undef ADDR | 2768 #undef ADDR |
| 2738 }; | 2769 }; |
| 2739 | 2770 |
| 2740 | 2771 |
| 2741 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2772 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 2742 return IC_utilities[id]; | 2773 return IC_utilities[id]; |
| 2743 } | 2774 } |
| 2744 | 2775 |
| 2745 | 2776 |
| 2746 } } // namespace v8::internal | 2777 } } // namespace v8::internal |
| OLD | NEW |