| 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 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1681 GenerateStoreViaSetter(masm(), setter); | 1681 GenerateStoreViaSetter(masm(), setter); |
| 1682 | 1682 |
| 1683 return GetCode(kind(), Code::FAST, name); | 1683 return GetCode(kind(), Code::FAST, name); |
| 1684 } | 1684 } |
| 1685 | 1685 |
| 1686 | 1686 |
| 1687 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( | 1687 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( |
| 1688 Handle<Map> receiver_map) { | 1688 Handle<Map> receiver_map) { |
| 1689 ElementsKind elements_kind = receiver_map->elements_kind(); | 1689 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1690 if (receiver_map->has_fast_elements() || | 1690 if (receiver_map->has_fast_elements() || |
| 1691 receiver_map->has_external_array_elements()) { | 1691 receiver_map->has_external_array_elements() || |
| 1692 receiver_map->has_fixed_typed_array_elements()) { |
| 1692 Handle<Code> stub = KeyedLoadFastElementStub( | 1693 Handle<Code> stub = KeyedLoadFastElementStub( |
| 1693 receiver_map->instance_type() == JS_ARRAY_TYPE, | 1694 receiver_map->instance_type() == JS_ARRAY_TYPE, |
| 1694 elements_kind).GetCode(isolate()); | 1695 elements_kind).GetCode(isolate()); |
| 1695 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1696 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
| 1696 } else { | 1697 } else { |
| 1697 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads | 1698 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads |
| 1698 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) | 1699 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) |
| 1699 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); | 1700 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); |
| 1700 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); | 1701 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); |
| 1701 } | 1702 } |
| 1702 | 1703 |
| 1703 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); | 1704 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); |
| 1704 | 1705 |
| 1705 // Return the generated code. | 1706 // Return the generated code. |
| 1706 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); | 1707 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); |
| 1707 } | 1708 } |
| 1708 | 1709 |
| 1709 | 1710 |
| 1710 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( | 1711 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( |
| 1711 Handle<Map> receiver_map) { | 1712 Handle<Map> receiver_map) { |
| 1712 ElementsKind elements_kind = receiver_map->elements_kind(); | 1713 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1713 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1714 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1714 Handle<Code> stub; | 1715 Handle<Code> stub; |
| 1715 if (receiver_map->has_fast_elements() || | 1716 if (receiver_map->has_fast_elements() || |
| 1716 receiver_map->has_external_array_elements()) { | 1717 receiver_map->has_external_array_elements() || |
| 1718 receiver_map->has_fixed_typed_array_elements()) { |
| 1717 stub = KeyedStoreFastElementStub( | 1719 stub = KeyedStoreFastElementStub( |
| 1718 is_jsarray, | 1720 is_jsarray, |
| 1719 elements_kind, | 1721 elements_kind, |
| 1720 store_mode()).GetCode(isolate()); | 1722 store_mode()).GetCode(isolate()); |
| 1721 } else { | 1723 } else { |
| 1722 stub = KeyedStoreElementStub(is_jsarray, | 1724 stub = KeyedStoreElementStub(is_jsarray, |
| 1723 elements_kind, | 1725 elements_kind, |
| 1724 store_mode()).GetCode(isolate()); | 1726 store_mode()).GetCode(isolate()); |
| 1725 } | 1727 } |
| 1726 | 1728 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 | 1806 |
| 1805 if ((receiver_map->instance_type() & kNotStringTag) == 0) { | 1807 if ((receiver_map->instance_type() & kNotStringTag) == 0) { |
| 1806 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); | 1808 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); |
| 1807 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 1809 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
| 1808 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); | 1810 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); |
| 1809 } else { | 1811 } else { |
| 1810 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 1812 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 1811 ElementsKind elements_kind = receiver_map->elements_kind(); | 1813 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 1812 | 1814 |
| 1813 if (IsFastElementsKind(elements_kind) || | 1815 if (IsFastElementsKind(elements_kind) || |
| 1814 IsExternalArrayElementsKind(elements_kind)) { | 1816 IsExternalArrayElementsKind(elements_kind) || |
| 1817 IsFixedTypedArrayElementsKind(elements_kind)) { |
| 1815 cached_stub = | 1818 cached_stub = |
| 1816 KeyedLoadFastElementStub(is_js_array, | 1819 KeyedLoadFastElementStub(is_js_array, |
| 1817 elements_kind).GetCode(isolate()); | 1820 elements_kind).GetCode(isolate()); |
| 1818 } else { | 1821 } else { |
| 1819 ASSERT(elements_kind == DICTIONARY_ELEMENTS); | 1822 ASSERT(elements_kind == DICTIONARY_ELEMENTS); |
| 1820 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); | 1823 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); |
| 1821 } | 1824 } |
| 1822 } | 1825 } |
| 1823 | 1826 |
| 1824 handlers->Add(cached_stub); | 1827 handlers->Add(cached_stub); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1847 if (!transitioned_map.is_null()) { | 1850 if (!transitioned_map.is_null()) { |
| 1848 cached_stub = ElementsTransitionAndStoreStub( | 1851 cached_stub = ElementsTransitionAndStoreStub( |
| 1849 elements_kind, | 1852 elements_kind, |
| 1850 transitioned_map->elements_kind(), | 1853 transitioned_map->elements_kind(), |
| 1851 is_js_array, | 1854 is_js_array, |
| 1852 store_mode()).GetCode(isolate()); | 1855 store_mode()).GetCode(isolate()); |
| 1853 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 1856 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
| 1854 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); | 1857 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); |
| 1855 } else { | 1858 } else { |
| 1856 if (receiver_map->has_fast_elements() || | 1859 if (receiver_map->has_fast_elements() || |
| 1857 receiver_map->has_external_array_elements()) { | 1860 receiver_map->has_external_array_elements() || |
| 1861 receiver_map->has_fixed_typed_array_elements()) { |
| 1858 cached_stub = KeyedStoreFastElementStub( | 1862 cached_stub = KeyedStoreFastElementStub( |
| 1859 is_js_array, | 1863 is_js_array, |
| 1860 elements_kind, | 1864 elements_kind, |
| 1861 store_mode()).GetCode(isolate()); | 1865 store_mode()).GetCode(isolate()); |
| 1862 } else { | 1866 } else { |
| 1863 cached_stub = KeyedStoreElementStub( | 1867 cached_stub = KeyedStoreElementStub( |
| 1864 is_js_array, | 1868 is_js_array, |
| 1865 elements_kind, | 1869 elements_kind, |
| 1866 store_mode()).GetCode(isolate()); | 1870 store_mode()).GetCode(isolate()); |
| 1867 } | 1871 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 Handle<FunctionTemplateInfo>( | 2045 Handle<FunctionTemplateInfo>( |
| 2042 FunctionTemplateInfo::cast(signature->receiver())); | 2046 FunctionTemplateInfo::cast(signature->receiver())); |
| 2043 } | 2047 } |
| 2044 } | 2048 } |
| 2045 | 2049 |
| 2046 is_simple_api_call_ = true; | 2050 is_simple_api_call_ = true; |
| 2047 } | 2051 } |
| 2048 | 2052 |
| 2049 | 2053 |
| 2050 } } // namespace v8::internal | 2054 } } // namespace v8::internal |
| OLD | NEW |