| 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 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 GenerateStoreViaSetter(masm(), setter); | 1669 GenerateStoreViaSetter(masm(), setter); |
| 1670 | 1670 |
| 1671 return GetCode(kind(), Code::FAST, name); | 1671 return GetCode(kind(), Code::FAST, name); |
| 1672 } | 1672 } |
| 1673 | 1673 |
| 1674 | 1674 |
| 1675 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( | 1675 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( |
| 1676 Handle<Map> receiver_map) { | 1676 Handle<Map> receiver_map) { |
| 1677 ElementsKind elements_kind = receiver_map->elements_kind(); | 1677 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1678 if (receiver_map->has_fast_elements() || | 1678 if (receiver_map->has_fast_elements() || |
| 1679 receiver_map->has_external_array_elements() || | 1679 receiver_map->has_external_array_elements()) { |
| 1680 receiver_map->has_fixed_typed_array_elements()) { | |
| 1681 Handle<Code> stub = KeyedLoadFastElementStub( | 1680 Handle<Code> stub = KeyedLoadFastElementStub( |
| 1682 receiver_map->instance_type() == JS_ARRAY_TYPE, | 1681 receiver_map->instance_type() == JS_ARRAY_TYPE, |
| 1683 elements_kind).GetCode(isolate()); | 1682 elements_kind).GetCode(isolate()); |
| 1684 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1683 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
| 1685 } else { | 1684 } else { |
| 1686 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads | 1685 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads |
| 1687 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) | 1686 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) |
| 1688 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); | 1687 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); |
| 1689 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1688 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
| 1690 } | 1689 } |
| 1691 | 1690 |
| 1692 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); | 1691 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); |
| 1693 | 1692 |
| 1694 // Return the generated code. | 1693 // Return the generated code. |
| 1695 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); | 1694 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); |
| 1696 } | 1695 } |
| 1697 | 1696 |
| 1698 | 1697 |
| 1699 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( | 1698 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( |
| 1700 Handle<Map> receiver_map) { | 1699 Handle<Map> receiver_map) { |
| 1701 ElementsKind elements_kind = receiver_map->elements_kind(); | 1700 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1702 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1701 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1703 Handle<Code> stub; | 1702 Handle<Code> stub; |
| 1704 if (receiver_map->has_fast_elements() || | 1703 if (receiver_map->has_fast_elements() || |
| 1705 receiver_map->has_external_array_elements() || | 1704 receiver_map->has_external_array_elements()) { |
| 1706 receiver_map->has_fixed_typed_array_elements()) { | |
| 1707 stub = KeyedStoreFastElementStub( | 1705 stub = KeyedStoreFastElementStub( |
| 1708 is_jsarray, | 1706 is_jsarray, |
| 1709 elements_kind, | 1707 elements_kind, |
| 1710 store_mode()).GetCode(isolate()); | 1708 store_mode()).GetCode(isolate()); |
| 1711 } else { | 1709 } else { |
| 1712 stub = KeyedStoreElementStub(is_jsarray, | 1710 stub = KeyedStoreElementStub(is_jsarray, |
| 1713 elements_kind, | 1711 elements_kind, |
| 1714 store_mode()).GetCode(isolate()); | 1712 store_mode()).GetCode(isolate()); |
| 1715 } | 1713 } |
| 1716 | 1714 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 | 1792 |
| 1795 if ((receiver_map->instance_type() & kNotStringTag) == 0) { | 1793 if ((receiver_map->instance_type() & kNotStringTag) == 0) { |
| 1796 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); | 1794 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); |
| 1797 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 1795 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
| 1798 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); | 1796 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); |
| 1799 } else { | 1797 } else { |
| 1800 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1798 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1801 ElementsKind elements_kind = receiver_map->elements_kind(); | 1799 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1802 | 1800 |
| 1803 if (IsFastElementsKind(elements_kind) || | 1801 if (IsFastElementsKind(elements_kind) || |
| 1804 IsExternalArrayElementsKind(elements_kind) || | 1802 IsExternalArrayElementsKind(elements_kind)) { |
| 1805 IsFixedTypedArrayElementsKind(elements_kind)) { | |
| 1806 cached_stub = | 1803 cached_stub = |
| 1807 KeyedLoadFastElementStub(is_js_array, | 1804 KeyedLoadFastElementStub(is_js_array, |
| 1808 elements_kind).GetCode(isolate()); | 1805 elements_kind).GetCode(isolate()); |
| 1809 } else { | 1806 } else { |
| 1810 ASSERT(elements_kind == DICTIONARY_ELEMENTS); | 1807 ASSERT(elements_kind == DICTIONARY_ELEMENTS); |
| 1811 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); | 1808 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); |
| 1812 } | 1809 } |
| 1813 } | 1810 } |
| 1814 | 1811 |
| 1815 handlers->Add(cached_stub); | 1812 handlers->Add(cached_stub); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1838 if (!transitioned_map.is_null()) { | 1835 if (!transitioned_map.is_null()) { |
| 1839 cached_stub = ElementsTransitionAndStoreStub( | 1836 cached_stub = ElementsTransitionAndStoreStub( |
| 1840 elements_kind, | 1837 elements_kind, |
| 1841 transitioned_map->elements_kind(), | 1838 transitioned_map->elements_kind(), |
| 1842 is_js_array, | 1839 is_js_array, |
| 1843 store_mode()).GetCode(isolate()); | 1840 store_mode()).GetCode(isolate()); |
| 1844 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 1841 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
| 1845 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); | 1842 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); |
| 1846 } else { | 1843 } else { |
| 1847 if (receiver_map->has_fast_elements() || | 1844 if (receiver_map->has_fast_elements() || |
| 1848 receiver_map->has_external_array_elements() || | 1845 receiver_map->has_external_array_elements()) { |
| 1849 receiver_map->has_fixed_typed_array_elements()) { | |
| 1850 cached_stub = KeyedStoreFastElementStub( | 1846 cached_stub = KeyedStoreFastElementStub( |
| 1851 is_js_array, | 1847 is_js_array, |
| 1852 elements_kind, | 1848 elements_kind, |
| 1853 store_mode()).GetCode(isolate()); | 1849 store_mode()).GetCode(isolate()); |
| 1854 } else { | 1850 } else { |
| 1855 cached_stub = KeyedStoreElementStub( | 1851 cached_stub = KeyedStoreElementStub( |
| 1856 is_js_array, | 1852 is_js_array, |
| 1857 elements_kind, | 1853 elements_kind, |
| 1858 store_mode()).GetCode(isolate()); | 1854 store_mode()).GetCode(isolate()); |
| 1859 } | 1855 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 Handle<FunctionTemplateInfo>( | 2029 Handle<FunctionTemplateInfo>( |
| 2034 FunctionTemplateInfo::cast(signature->receiver())); | 2030 FunctionTemplateInfo::cast(signature->receiver())); |
| 2035 } | 2031 } |
| 2036 } | 2032 } |
| 2037 | 2033 |
| 2038 is_simple_api_call_ = true; | 2034 is_simple_api_call_ = true; |
| 2039 } | 2035 } |
| 2040 | 2036 |
| 2041 | 2037 |
| 2042 } } // namespace v8::internal | 2038 } } // namespace v8::internal |
| OLD | NEW |