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

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: Self-review Created 7 years 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
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 V(ExternalArray, empty_external_short_array, EmptyExternalShortArray) \ 148 V(ExternalArray, empty_external_short_array, EmptyExternalShortArray) \
149 V(ExternalArray, empty_external_unsigned_short_array, \ 149 V(ExternalArray, empty_external_unsigned_short_array, \
150 EmptyExternalUnsignedShortArray) \ 150 EmptyExternalUnsignedShortArray) \
151 V(ExternalArray, empty_external_int_array, EmptyExternalIntArray) \ 151 V(ExternalArray, empty_external_int_array, EmptyExternalIntArray) \
152 V(ExternalArray, empty_external_unsigned_int_array, \ 152 V(ExternalArray, empty_external_unsigned_int_array, \
153 EmptyExternalUnsignedIntArray) \ 153 EmptyExternalUnsignedIntArray) \
154 V(ExternalArray, empty_external_float_array, EmptyExternalFloatArray) \ 154 V(ExternalArray, empty_external_float_array, EmptyExternalFloatArray) \
155 V(ExternalArray, empty_external_double_array, EmptyExternalDoubleArray) \ 155 V(ExternalArray, empty_external_double_array, EmptyExternalDoubleArray) \
156 V(ExternalArray, empty_external_pixel_array, \ 156 V(ExternalArray, empty_external_pixel_array, \
157 EmptyExternalPixelArray) \ 157 EmptyExternalPixelArray) \
158 V(Map, fixed_uint8_array_map, FixedUint8ArrayMap) \
159 V(Map, fixed_int8_array_map, FixedInt8ArrayMap) \
160 V(Map, fixed_uint16_array_map, FixedUint16ArrayMap) \
161 V(Map, fixed_int16_array_map, FixedInt16ArrayMap) \
162 V(Map, fixed_uint32_array_map, FixedUint32ArrayMap) \
163 V(Map, fixed_int32_array_map, FixedInt32ArrayMap) \
164 V(Map, fixed_float32_array_map, FixedFloat32ArrayMap) \
165 V(Map, fixed_float64_array_map, FixedFloat64ArrayMap) \
166 V(Map, fixed_uint8_clamped_array_map, FixedUint8ClampedArrayMap) \
158 V(Map, non_strict_arguments_elements_map, NonStrictArgumentsElementsMap) \ 167 V(Map, non_strict_arguments_elements_map, NonStrictArgumentsElementsMap) \
159 V(Map, function_context_map, FunctionContextMap) \ 168 V(Map, function_context_map, FunctionContextMap) \
160 V(Map, catch_context_map, CatchContextMap) \ 169 V(Map, catch_context_map, CatchContextMap) \
161 V(Map, with_context_map, WithContextMap) \ 170 V(Map, with_context_map, WithContextMap) \
162 V(Map, block_context_map, BlockContextMap) \ 171 V(Map, block_context_map, BlockContextMap) \
163 V(Map, module_context_map, ModuleContextMap) \ 172 V(Map, module_context_map, ModuleContextMap) \
164 V(Map, global_context_map, GlobalContextMap) \ 173 V(Map, global_context_map, GlobalContextMap) \
165 V(Map, oddball_map, OddballMap) \ 174 V(Map, oddball_map, OddballMap) \
166 V(Map, message_object_map, JSMessageObjectMap) \ 175 V(Map, message_object_map, JSMessageObjectMap) \
167 V(Map, foreign_map, ForeignMap) \ 176 V(Map, foreign_map, ForeignMap) \
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 // Allocates an external array of the specified length and type. 875 // Allocates an external array of the specified length and type.
867 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 876 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
868 // failed. 877 // failed.
869 // Please note this does not perform a garbage collection. 878 // Please note this does not perform a garbage collection.
870 MUST_USE_RESULT MaybeObject* AllocateExternalArray( 879 MUST_USE_RESULT MaybeObject* AllocateExternalArray(
871 int length, 880 int length,
872 ExternalArrayType array_type, 881 ExternalArrayType array_type,
873 void* external_pointer, 882 void* external_pointer,
874 PretenureFlag pretenure); 883 PretenureFlag pretenure);
875 884
885 // Allocates a fixed typed array of the specified length and type.
886 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
887 // failed.
888 // Please note this does not perform a garbage collection.
889 MUST_USE_RESULT MaybeObject* AllocateFixedTypedArray(
890 int length,
891 ExternalArrayType array_type,
892 PretenureFlag pretenure);
893
876 // Allocate a symbol in old space. 894 // Allocate a symbol in old space.
877 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 895 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
878 // failed. 896 // failed.
879 // Please note this does not perform a garbage collection. 897 // Please note this does not perform a garbage collection.
880 MUST_USE_RESULT MaybeObject* AllocateSymbol(); 898 MUST_USE_RESULT MaybeObject* AllocateSymbol();
881 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol(); 899 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol();
882 900
883 // Allocate a tenured AllocationSite. It's payload is null 901 // Allocate a tenured AllocationSite. It's payload is null
884 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); 902 MUST_USE_RESULT MaybeObject* AllocateAllocationSite();
885 903
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); 1584 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index);
1567 // Generated code can treat direct references to this root as constant. 1585 // Generated code can treat direct references to this root as constant.
1568 bool RootCanBeTreatedAsConstant(RootListIndex root_index); 1586 bool RootCanBeTreatedAsConstant(RootListIndex root_index);
1569 1587
1570 MUST_USE_RESULT MaybeObject* NumberToString( 1588 MUST_USE_RESULT MaybeObject* NumberToString(
1571 Object* number, bool check_number_string_cache = true, 1589 Object* number, bool check_number_string_cache = true,
1572 PretenureFlag pretenure = NOT_TENURED); 1590 PretenureFlag pretenure = NOT_TENURED);
1573 MUST_USE_RESULT MaybeObject* Uint32ToString( 1591 MUST_USE_RESULT MaybeObject* Uint32ToString(
1574 uint32_t value, bool check_number_string_cache = true); 1592 uint32_t value, bool check_number_string_cache = true);
1575 1593
1594 Map* MapForFixedTypedArray(ExternalArrayType array_type);
1595 RootListIndex RootIndexForFixedTypedArray(
1596 ExternalArrayType array_type);
1597
1576 Map* MapForExternalArrayType(ExternalArrayType array_type); 1598 Map* MapForExternalArrayType(ExternalArrayType array_type);
1577 RootListIndex RootIndexForExternalArrayType( 1599 RootListIndex RootIndexForExternalArrayType(
1578 ExternalArrayType array_type); 1600 ExternalArrayType array_type);
1579 1601
1580 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind); 1602 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind);
1581 ExternalArray* EmptyExternalArrayForMap(Map* map); 1603 ExternalArray* EmptyExternalArrayForMap(Map* map);
1582 1604
1583 void RecordStats(HeapStats* stats, bool take_snapshot = false); 1605 void RecordStats(HeapStats* stats, bool take_snapshot = false);
1584 1606
1585 // Copy block of memory from src to dst. Size of block should be aligned 1607 // 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
1848 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep); 1870 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep);
1849 1871
1850 DependentCode* LookupWeakObjectToCodeDependency(Object* obj); 1872 DependentCode* LookupWeakObjectToCodeDependency(Object* obj);
1851 1873
1852 void InitializeWeakObjectToCodeTable() { 1874 void InitializeWeakObjectToCodeTable() {
1853 set_weak_object_to_code_table(undefined_value()); 1875 set_weak_object_to_code_table(undefined_value());
1854 } 1876 }
1855 1877
1856 void EnsureWeakObjectToCodeTable(); 1878 void EnsureWeakObjectToCodeTable();
1857 1879
1880 static void FatalProcessOutOfMemory(const char* location,
1881 bool take_snapshot = false);
1882
1858 private: 1883 private:
1859 Heap(); 1884 Heap();
1860 1885
1861 // This can be calculated directly from a pointer to the heap; however, it is 1886 // This can be calculated directly from a pointer to the heap; however, it is
1862 // more expedient to get at the isolate directly from within Heap methods. 1887 // more expedient to get at the isolate directly from within Heap methods.
1863 Isolate* isolate_; 1888 Isolate* isolate_;
1864 1889
1865 Object* roots_[kRootListLength]; 1890 Object* roots_[kRootListLength];
1866 1891
1867 intptr_t code_range_size_; 1892 intptr_t code_range_size_;
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 3036 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
3012 3037
3013 private: 3038 private:
3014 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 3039 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
3015 }; 3040 };
3016 #endif // DEBUG 3041 #endif // DEBUG
3017 3042
3018 } } // namespace v8::internal 3043 } } // namespace v8::internal
3019 3044
3020 #endif // V8_HEAP_H_ 3045 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698