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/v8.h" | 5 #include "src/v8.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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 | 1858 |
1859 if (IsTransitionStoreMode(store_mode)) { | 1859 if (IsTransitionStoreMode(store_mode)) { |
1860 Handle<Map> transitioned_receiver_map = | 1860 Handle<Map> transitioned_receiver_map = |
1861 ComputeTransitionedMap(receiver_map, store_mode); | 1861 ComputeTransitionedMap(receiver_map, store_mode); |
1862 map_added |= AddOneReceiverMapIfMissing(&target_receiver_maps, | 1862 map_added |= AddOneReceiverMapIfMissing(&target_receiver_maps, |
1863 transitioned_receiver_map); | 1863 transitioned_receiver_map); |
1864 } | 1864 } |
1865 | 1865 |
1866 if (!map_added) { | 1866 if (!map_added) { |
1867 // If the miss wasn't due to an unseen map, a polymorphic stub | 1867 // If the miss wasn't due to an unseen map, a polymorphic stub |
1868 // won't help, use the generic stub. | 1868 // won't help. In theory we should use the generic stub, but in |
| 1869 // practice there are a number of hard-to-avoid reasons why this |
| 1870 // can happen occasionally, and where the additional logic in the |
| 1871 // megamorphic stub is beneficial because it can handle most cases |
| 1872 // without calling into the runtime. |
1869 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "same map added twice"); | 1873 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "same map added twice"); |
1870 return generic_stub(); | 1874 return megamorphic_stub(); |
1871 } | 1875 } |
1872 | 1876 |
1873 // If the maximum number of receiver maps has been exceeded, use the | 1877 // If the maximum number of receiver maps has been exceeded, use the |
1874 // megamorphic version of the IC. | 1878 // megamorphic version of the IC. |
1875 if (target_receiver_maps.length() > kMaxKeyedPolymorphism) { | 1879 if (target_receiver_maps.length() > kMaxKeyedPolymorphism) { |
1876 return megamorphic_stub(); | 1880 return megamorphic_stub(); |
1877 } | 1881 } |
1878 | 1882 |
1879 // Make sure all polymorphic handlers have the same store mode, otherwise the | 1883 // Make sure all polymorphic handlers have the same store mode, otherwise the |
1880 // generic stub must be used. | 1884 // generic stub must be used. |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2991 static const Address IC_utilities[] = { | 2995 static const Address IC_utilities[] = { |
2992 #define ADDR(name) FUNCTION_ADDR(name), | 2996 #define ADDR(name) FUNCTION_ADDR(name), |
2993 IC_UTIL_LIST(ADDR) NULL | 2997 IC_UTIL_LIST(ADDR) NULL |
2994 #undef ADDR | 2998 #undef ADDR |
2995 }; | 2999 }; |
2996 | 3000 |
2997 | 3001 |
2998 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3002 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
2999 } | 3003 } |
3000 } // namespace v8::internal | 3004 } // namespace v8::internal |
OLD | NEW |