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 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1764 if (store_mode == STANDARD_STORE) { | 1764 if (store_mode == STANDARD_STORE) { |
1765 store_mode = old_store_mode; | 1765 store_mode = old_store_mode; |
1766 } else if (store_mode != old_store_mode) { | 1766 } else if (store_mode != old_store_mode) { |
1767 TRACE_GENERIC_IC(isolate(), "KeyedIC", "store mode mismatch"); | 1767 TRACE_GENERIC_IC(isolate(), "KeyedIC", "store mode mismatch"); |
1768 return strict_mode == kStrictMode | 1768 return strict_mode == kStrictMode |
1769 ? generic_stub_strict() | 1769 ? generic_stub_strict() |
1770 : generic_stub(); | 1770 : generic_stub(); |
1771 } | 1771 } |
1772 } | 1772 } |
1773 | 1773 |
| 1774 // If the store mode isn't the standard mode, make sure that all polymorphic |
| 1775 // receivers are either external arrays, or all "normal" arrays. Otherwise, |
| 1776 // use the generic stub. |
| 1777 if (store_mode != STANDARD_STORE) { |
| 1778 int external_arrays = 0; |
| 1779 for (int i = 0; i < target_receiver_maps.length(); ++i) { |
| 1780 if (target_receiver_maps[i]->has_external_array_elements()) { |
| 1781 external_arrays++; |
| 1782 } |
| 1783 } |
| 1784 if (external_arrays != 0 && |
| 1785 external_arrays != target_receiver_maps.length()) { |
| 1786 TRACE_GENERIC_IC(isolate(), "KeyedIC", |
| 1787 "unsupported combination of external and normal arrays"); |
| 1788 return strict_mode == kStrictMode |
| 1789 ? generic_stub_strict() |
| 1790 : generic_stub(); |
| 1791 } |
| 1792 } |
| 1793 |
1774 return isolate()->stub_cache()->ComputeStoreElementPolymorphic( | 1794 return isolate()->stub_cache()->ComputeStoreElementPolymorphic( |
1775 &target_receiver_maps, store_mode, strict_mode); | 1795 &target_receiver_maps, store_mode, strict_mode); |
1776 } | 1796 } |
1777 | 1797 |
1778 | 1798 |
1779 Handle<Map> KeyedStoreIC::ComputeTransitionedMap( | 1799 Handle<Map> KeyedStoreIC::ComputeTransitionedMap( |
1780 Handle<JSObject> receiver, | 1800 Handle<JSObject> receiver, |
1781 KeyedAccessStoreMode store_mode) { | 1801 KeyedAccessStoreMode store_mode) { |
1782 switch (store_mode) { | 1802 switch (store_mode) { |
1783 case STORE_TRANSITION_SMI_TO_OBJECT: | 1803 case STORE_TRANSITION_SMI_TO_OBJECT: |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2776 #undef ADDR | 2796 #undef ADDR |
2777 }; | 2797 }; |
2778 | 2798 |
2779 | 2799 |
2780 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2800 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2781 return IC_utilities[id]; | 2801 return IC_utilities[id]; |
2782 } | 2802 } |
2783 | 2803 |
2784 | 2804 |
2785 } } // namespace v8::internal | 2805 } } // namespace v8::internal |
OLD | NEW |