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

Side by Side Diff: src/heap.h

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/factory.cc ('k') | src/heap.cc » ('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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 V(ExternalArray, empty_external_short_array, EmptyExternalShortArray) \ 149 V(ExternalArray, empty_external_short_array, EmptyExternalShortArray) \
150 V(ExternalArray, empty_external_unsigned_short_array, \ 150 V(ExternalArray, empty_external_unsigned_short_array, \
151 EmptyExternalUnsignedShortArray) \ 151 EmptyExternalUnsignedShortArray) \
152 V(ExternalArray, empty_external_int_array, EmptyExternalIntArray) \ 152 V(ExternalArray, empty_external_int_array, EmptyExternalIntArray) \
153 V(ExternalArray, empty_external_unsigned_int_array, \ 153 V(ExternalArray, empty_external_unsigned_int_array, \
154 EmptyExternalUnsignedIntArray) \ 154 EmptyExternalUnsignedIntArray) \
155 V(ExternalArray, empty_external_float_array, EmptyExternalFloatArray) \ 155 V(ExternalArray, empty_external_float_array, EmptyExternalFloatArray) \
156 V(ExternalArray, empty_external_double_array, EmptyExternalDoubleArray) \ 156 V(ExternalArray, empty_external_double_array, EmptyExternalDoubleArray) \
157 V(ExternalArray, empty_external_pixel_array, \ 157 V(ExternalArray, empty_external_pixel_array, \
158 EmptyExternalPixelArray) \ 158 EmptyExternalPixelArray) \
159 V(Map, fixed_uint8_array_map, FixedUint8ArrayMap) \
160 V(Map, fixed_int8_array_map, FixedInt8ArrayMap) \
161 V(Map, fixed_uint16_array_map, FixedUint16ArrayMap) \
162 V(Map, fixed_int16_array_map, FixedInt16ArrayMap) \
163 V(Map, fixed_uint32_array_map, FixedUint32ArrayMap) \
164 V(Map, fixed_int32_array_map, FixedInt32ArrayMap) \
165 V(Map, fixed_float32_array_map, FixedFloat32ArrayMap) \
166 V(Map, fixed_float64_array_map, FixedFloat64ArrayMap) \
167 V(Map, fixed_uint8_clamped_array_map, FixedUint8ClampedArrayMap) \
159 V(Map, non_strict_arguments_elements_map, NonStrictArgumentsElementsMap) \ 168 V(Map, non_strict_arguments_elements_map, NonStrictArgumentsElementsMap) \
160 V(Map, function_context_map, FunctionContextMap) \ 169 V(Map, function_context_map, FunctionContextMap) \
161 V(Map, catch_context_map, CatchContextMap) \ 170 V(Map, catch_context_map, CatchContextMap) \
162 V(Map, with_context_map, WithContextMap) \ 171 V(Map, with_context_map, WithContextMap) \
163 V(Map, block_context_map, BlockContextMap) \ 172 V(Map, block_context_map, BlockContextMap) \
164 V(Map, module_context_map, ModuleContextMap) \ 173 V(Map, module_context_map, ModuleContextMap) \
165 V(Map, global_context_map, GlobalContextMap) \ 174 V(Map, global_context_map, GlobalContextMap) \
166 V(Map, oddball_map, OddballMap) \ 175 V(Map, oddball_map, OddballMap) \
167 V(Map, message_object_map, JSMessageObjectMap) \ 176 V(Map, message_object_map, JSMessageObjectMap) \
168 V(Map, foreign_map, ForeignMap) \ 177 V(Map, foreign_map, ForeignMap) \
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 // Allocates an external array of the specified length and type. 877 // Allocates an external array of the specified length and type.
869 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 878 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
870 // failed. 879 // failed.
871 // Please note this does not perform a garbage collection. 880 // Please note this does not perform a garbage collection.
872 MUST_USE_RESULT MaybeObject* AllocateExternalArray( 881 MUST_USE_RESULT MaybeObject* AllocateExternalArray(
873 int length, 882 int length,
874 ExternalArrayType array_type, 883 ExternalArrayType array_type,
875 void* external_pointer, 884 void* external_pointer,
876 PretenureFlag pretenure); 885 PretenureFlag pretenure);
877 886
887 // Allocates a fixed typed array of the specified length and type.
888 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
889 // failed.
890 // Please note this does not perform a garbage collection.
891 MUST_USE_RESULT MaybeObject* AllocateFixedTypedArray(
892 int length,
893 ExternalArrayType array_type,
894 PretenureFlag pretenure);
895
878 // Allocate a symbol in old space. 896 // Allocate a symbol in old space.
879 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 897 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
880 // failed. 898 // failed.
881 // Please note this does not perform a garbage collection. 899 // Please note this does not perform a garbage collection.
882 MUST_USE_RESULT MaybeObject* AllocateSymbol(); 900 MUST_USE_RESULT MaybeObject* AllocateSymbol();
883 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol(); 901 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol();
884 902
885 // Allocate a tenured AllocationSite. It's payload is null 903 // Allocate a tenured AllocationSite. It's payload is null
886 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); 904 MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
887 905
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); 1572 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index);
1555 // Generated code can treat direct references to this root as constant. 1573 // Generated code can treat direct references to this root as constant.
1556 bool RootCanBeTreatedAsConstant(RootListIndex root_index); 1574 bool RootCanBeTreatedAsConstant(RootListIndex root_index);
1557 1575
1558 MUST_USE_RESULT MaybeObject* NumberToString( 1576 MUST_USE_RESULT MaybeObject* NumberToString(
1559 Object* number, bool check_number_string_cache = true, 1577 Object* number, bool check_number_string_cache = true,
1560 PretenureFlag pretenure = NOT_TENURED); 1578 PretenureFlag pretenure = NOT_TENURED);
1561 MUST_USE_RESULT MaybeObject* Uint32ToString( 1579 MUST_USE_RESULT MaybeObject* Uint32ToString(
1562 uint32_t value, bool check_number_string_cache = true); 1580 uint32_t value, bool check_number_string_cache = true);
1563 1581
1582 Map* MapForFixedTypedArray(ExternalArrayType array_type);
1583 RootListIndex RootIndexForFixedTypedArray(
1584 ExternalArrayType array_type);
1585
1564 Map* MapForExternalArrayType(ExternalArrayType array_type); 1586 Map* MapForExternalArrayType(ExternalArrayType array_type);
1565 RootListIndex RootIndexForExternalArrayType( 1587 RootListIndex RootIndexForExternalArrayType(
1566 ExternalArrayType array_type); 1588 ExternalArrayType array_type);
1567 1589
1568 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind); 1590 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind);
1569 ExternalArray* EmptyExternalArrayForMap(Map* map); 1591 ExternalArray* EmptyExternalArrayForMap(Map* map);
1570 1592
1571 void RecordStats(HeapStats* stats, bool take_snapshot = false); 1593 void RecordStats(HeapStats* stats, bool take_snapshot = false);
1572 1594
1573 // Copy block of memory from src to dst. Size of block should be aligned 1595 // Copy block of memory from src to dst. Size of block should be aligned
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep); 1858 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep);
1837 1859
1838 DependentCode* LookupWeakObjectToCodeDependency(Object* obj); 1860 DependentCode* LookupWeakObjectToCodeDependency(Object* obj);
1839 1861
1840 void InitializeWeakObjectToCodeTable() { 1862 void InitializeWeakObjectToCodeTable() {
1841 set_weak_object_to_code_table(undefined_value()); 1863 set_weak_object_to_code_table(undefined_value());
1842 } 1864 }
1843 1865
1844 void EnsureWeakObjectToCodeTable(); 1866 void EnsureWeakObjectToCodeTable();
1845 1867
1868 static void FatalProcessOutOfMemory(const char* location,
1869 bool take_snapshot = false);
1870
1846 private: 1871 private:
1847 Heap(); 1872 Heap();
1848 1873
1849 // This can be calculated directly from a pointer to the heap; however, it is 1874 // This can be calculated directly from a pointer to the heap; however, it is
1850 // more expedient to get at the isolate directly from within Heap methods. 1875 // more expedient to get at the isolate directly from within Heap methods.
1851 Isolate* isolate_; 1876 Isolate* isolate_;
1852 1877
1853 Object* roots_[kRootListLength]; 1878 Object* roots_[kRootListLength];
1854 1879
1855 intptr_t code_range_size_; 1880 intptr_t code_range_size_;
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3043 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3019 3044
3020 private: 3045 private:
3021 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3046 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3022 }; 3047 };
3023 #endif // DEBUG 3048 #endif // DEBUG
3024 3049
3025 } } // namespace v8::internal 3050 } } // namespace v8::internal
3026 3051
3027 #endif // V8_HEAP_H_ 3052 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698