Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: src/stub-cache.cc

Issue 101413006: Implement in-heap backing store for typed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: GC fixes Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | src/third_party/valgrind/valgrind.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()) {
1680 Handle<Code> stub = KeyedLoadFastElementStub( 1681 Handle<Code> stub = KeyedLoadFastElementStub(
1681 receiver_map->instance_type() == JS_ARRAY_TYPE, 1682 receiver_map->instance_type() == JS_ARRAY_TYPE,
1682 elements_kind).GetCode(isolate()); 1683 elements_kind).GetCode(isolate());
1683 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); 1684 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK);
1684 } else { 1685 } else {
1685 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads 1686 Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads
1686 ? KeyedLoadDictionaryElementStub().GetCode(isolate()) 1687 ? KeyedLoadDictionaryElementStub().GetCode(isolate())
1687 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate()); 1688 : KeyedLoadDictionaryElementPlatformStub().GetCode(isolate());
1688 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); 1689 __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK);
1689 } 1690 }
1690 1691
1691 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss); 1692 TailCallBuiltin(masm(), Builtins::kKeyedLoadIC_Miss);
1692 1693
1693 // Return the generated code. 1694 // Return the generated code.
1694 return GetICCode(kind(), Code::NORMAL, factory()->empty_string()); 1695 return GetICCode(kind(), Code::NORMAL, factory()->empty_string());
1695 } 1696 }
1696 1697
1697 1698
1698 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( 1699 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(
1699 Handle<Map> receiver_map) { 1700 Handle<Map> receiver_map) {
1700 ElementsKind elements_kind = receiver_map->elements_kind(); 1701 ElementsKind elements_kind = receiver_map->elements_kind();
1701 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; 1702 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE;
1702 Handle<Code> stub; 1703 Handle<Code> stub;
1703 if (receiver_map->has_fast_elements() || 1704 if (receiver_map->has_fast_elements() ||
1704 receiver_map->has_external_array_elements()) { 1705 receiver_map->has_external_array_elements() ||
1706 receiver_map->has_fixed_typed_array_elements()) {
1705 stub = KeyedStoreFastElementStub( 1707 stub = KeyedStoreFastElementStub(
1706 is_jsarray, 1708 is_jsarray,
1707 elements_kind, 1709 elements_kind,
1708 store_mode()).GetCode(isolate()); 1710 store_mode()).GetCode(isolate());
1709 } else { 1711 } else {
1710 stub = KeyedStoreElementStub(is_jsarray, 1712 stub = KeyedStoreElementStub(is_jsarray,
1711 elements_kind, 1713 elements_kind,
1712 store_mode()).GetCode(isolate()); 1714 store_mode()).GetCode(isolate());
1713 } 1715 }
1714 1716
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 1794
1793 if ((receiver_map->instance_type() & kNotStringTag) == 0) { 1795 if ((receiver_map->instance_type() & kNotStringTag) == 0) {
1794 cached_stub = isolate()->builtins()->KeyedLoadIC_String(); 1796 cached_stub = isolate()->builtins()->KeyedLoadIC_String();
1795 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { 1797 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
1796 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow(); 1798 cached_stub = isolate()->builtins()->KeyedLoadIC_Slow();
1797 } else { 1799 } else {
1798 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; 1800 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
1799 ElementsKind elements_kind = receiver_map->elements_kind(); 1801 ElementsKind elements_kind = receiver_map->elements_kind();
1800 1802
1801 if (IsFastElementsKind(elements_kind) || 1803 if (IsFastElementsKind(elements_kind) ||
1802 IsExternalArrayElementsKind(elements_kind)) { 1804 IsExternalArrayElementsKind(elements_kind) ||
1805 IsFixedTypedArrayElementsKind(elements_kind)) {
1803 cached_stub = 1806 cached_stub =
1804 KeyedLoadFastElementStub(is_js_array, 1807 KeyedLoadFastElementStub(is_js_array,
1805 elements_kind).GetCode(isolate()); 1808 elements_kind).GetCode(isolate());
1806 } else { 1809 } else {
1807 ASSERT(elements_kind == DICTIONARY_ELEMENTS); 1810 ASSERT(elements_kind == DICTIONARY_ELEMENTS);
1808 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate()); 1811 cached_stub = KeyedLoadDictionaryElementStub().GetCode(isolate());
1809 } 1812 }
1810 } 1813 }
1811 1814
1812 handlers->Add(cached_stub); 1815 handlers->Add(cached_stub);
(...skipping 22 matching lines...) Expand all
1835 if (!transitioned_map.is_null()) { 1838 if (!transitioned_map.is_null()) {
1836 cached_stub = ElementsTransitionAndStoreStub( 1839 cached_stub = ElementsTransitionAndStoreStub(
1837 elements_kind, 1840 elements_kind,
1838 transitioned_map->elements_kind(), 1841 transitioned_map->elements_kind(),
1839 is_js_array, 1842 is_js_array,
1840 store_mode()).GetCode(isolate()); 1843 store_mode()).GetCode(isolate());
1841 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { 1844 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
1842 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); 1845 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow();
1843 } else { 1846 } else {
1844 if (receiver_map->has_fast_elements() || 1847 if (receiver_map->has_fast_elements() ||
1845 receiver_map->has_external_array_elements()) { 1848 receiver_map->has_external_array_elements() ||
1849 receiver_map->has_fixed_typed_array_elements()) {
1846 cached_stub = KeyedStoreFastElementStub( 1850 cached_stub = KeyedStoreFastElementStub(
1847 is_js_array, 1851 is_js_array,
1848 elements_kind, 1852 elements_kind,
1849 store_mode()).GetCode(isolate()); 1853 store_mode()).GetCode(isolate());
1850 } else { 1854 } else {
1851 cached_stub = KeyedStoreElementStub( 1855 cached_stub = KeyedStoreElementStub(
1852 is_js_array, 1856 is_js_array,
1853 elements_kind, 1857 elements_kind,
1854 store_mode()).GetCode(isolate()); 1858 store_mode()).GetCode(isolate());
1855 } 1859 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 Handle<FunctionTemplateInfo>( 2033 Handle<FunctionTemplateInfo>(
2030 FunctionTemplateInfo::cast(signature->receiver())); 2034 FunctionTemplateInfo::cast(signature->receiver()));
2031 } 2035 }
2032 } 2036 }
2033 2037
2034 is_simple_api_call_ = true; 2038 is_simple_api_call_ = true;
2035 } 2039 }
2036 2040
2037 2041
2038 } } // namespace v8::internal 2042 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/third_party/valgrind/valgrind.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698