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 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 stub = non_strict_arguments_stub(); | 1692 stub = non_strict_arguments_stub(); |
1693 } else if (key_is_smi_like && | 1693 } else if (key_is_smi_like && |
1694 !(target().is_identical_to(non_strict_arguments_stub()))) { | 1694 !(target().is_identical_to(non_strict_arguments_stub()))) { |
1695 // We should go generic if receiver isn't a dictionary, but our | 1695 // We should go generic if receiver isn't a dictionary, but our |
1696 // prototype chain does have dictionary elements. This ensures that | 1696 // prototype chain does have dictionary elements. This ensures that |
1697 // other non-dictionary receivers in the polymorphic case benefit | 1697 // other non-dictionary receivers in the polymorphic case benefit |
1698 // from fast path keyed stores. | 1698 // from fast path keyed stores. |
1699 if (!(receiver->map()->DictionaryElementsInPrototypeChainOnly())) { | 1699 if (!(receiver->map()->DictionaryElementsInPrototypeChainOnly())) { |
1700 KeyedAccessStoreMode store_mode = | 1700 KeyedAccessStoreMode store_mode = |
1701 GetStoreMode(receiver, key, value); | 1701 GetStoreMode(receiver, key, value); |
1702 stub = StoreElementStub(receiver, store_mode); | 1702 // Use the generic stub if the store would send the receiver to |
| 1703 // dictionary mode. |
| 1704 if (!IsGrowStoreMode(store_mode) || |
| 1705 !receiver->WouldConvertToSlowElements(key)) { |
| 1706 stub = StoreElementStub(receiver, store_mode); |
| 1707 } |
1703 } | 1708 } |
1704 } | 1709 } |
1705 } | 1710 } |
1706 } | 1711 } |
1707 } | 1712 } |
1708 | 1713 |
1709 if (!is_target_set()) { | 1714 if (!is_target_set()) { |
1710 if (*stub == *generic_stub()) { | 1715 if (*stub == *generic_stub()) { |
1711 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); | 1716 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); |
1712 } | 1717 } |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2811 #undef ADDR | 2816 #undef ADDR |
2812 }; | 2817 }; |
2813 | 2818 |
2814 | 2819 |
2815 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2820 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2816 return IC_utilities[id]; | 2821 return IC_utilities[id]; |
2817 } | 2822 } |
2818 | 2823 |
2819 | 2824 |
2820 } } // namespace v8::internal | 2825 } } // namespace v8::internal |
OLD | NEW |