| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 ExternalInternalizedStringWithOneByteDataMap) \ | 98 ExternalInternalizedStringWithOneByteDataMap) \ |
| 99 V(Map, external_one_byte_internalized_string_map, \ | 99 V(Map, external_one_byte_internalized_string_map, \ |
| 100 ExternalOneByteInternalizedStringMap) \ | 100 ExternalOneByteInternalizedStringMap) \ |
| 101 V(Map, short_external_internalized_string_map, \ | 101 V(Map, short_external_internalized_string_map, \ |
| 102 ShortExternalInternalizedStringMap) \ | 102 ShortExternalInternalizedStringMap) \ |
| 103 V(Map, short_external_internalized_string_with_one_byte_data_map, \ | 103 V(Map, short_external_internalized_string_with_one_byte_data_map, \ |
| 104 ShortExternalInternalizedStringWithOneByteDataMap) \ | 104 ShortExternalInternalizedStringWithOneByteDataMap) \ |
| 105 V(Map, short_external_one_byte_internalized_string_map, \ | 105 V(Map, short_external_one_byte_internalized_string_map, \ |
| 106 ShortExternalOneByteInternalizedStringMap) \ | 106 ShortExternalOneByteInternalizedStringMap) \ |
| 107 V(Map, short_external_one_byte_string_map, ShortExternalOneByteStringMap) \ | 107 V(Map, short_external_one_byte_string_map, ShortExternalOneByteStringMap) \ |
| 108 V(Map, external_int8_array_map, ExternalInt8ArrayMap) \ | |
| 109 V(Map, external_uint8_array_map, ExternalUint8ArrayMap) \ | |
| 110 V(Map, external_int16_array_map, ExternalInt16ArrayMap) \ | |
| 111 V(Map, external_uint16_array_map, ExternalUint16ArrayMap) \ | |
| 112 V(Map, external_int32_array_map, ExternalInt32ArrayMap) \ | |
| 113 V(Map, external_uint32_array_map, ExternalUint32ArrayMap) \ | |
| 114 V(Map, external_float32_array_map, ExternalFloat32ArrayMap) \ | |
| 115 V(Map, external_float64_array_map, ExternalFloat64ArrayMap) \ | |
| 116 V(Map, external_uint8_clamped_array_map, ExternalUint8ClampedArrayMap) \ | |
| 117 V(ExternalArray, empty_external_int8_array, EmptyExternalInt8Array) \ | |
| 118 V(ExternalArray, empty_external_uint8_array, EmptyExternalUint8Array) \ | |
| 119 V(ExternalArray, empty_external_int16_array, EmptyExternalInt16Array) \ | |
| 120 V(ExternalArray, empty_external_uint16_array, EmptyExternalUint16Array) \ | |
| 121 V(ExternalArray, empty_external_int32_array, EmptyExternalInt32Array) \ | |
| 122 V(ExternalArray, empty_external_uint32_array, EmptyExternalUint32Array) \ | |
| 123 V(ExternalArray, empty_external_float32_array, EmptyExternalFloat32Array) \ | |
| 124 V(ExternalArray, empty_external_float64_array, EmptyExternalFloat64Array) \ | |
| 125 V(ExternalArray, empty_external_uint8_clamped_array, \ | |
| 126 EmptyExternalUint8ClampedArray) \ | |
| 127 V(Map, fixed_uint8_array_map, FixedUint8ArrayMap) \ | 108 V(Map, fixed_uint8_array_map, FixedUint8ArrayMap) \ |
| 128 V(Map, fixed_int8_array_map, FixedInt8ArrayMap) \ | 109 V(Map, fixed_int8_array_map, FixedInt8ArrayMap) \ |
| 129 V(Map, fixed_uint16_array_map, FixedUint16ArrayMap) \ | 110 V(Map, fixed_uint16_array_map, FixedUint16ArrayMap) \ |
| 130 V(Map, fixed_int16_array_map, FixedInt16ArrayMap) \ | 111 V(Map, fixed_int16_array_map, FixedInt16ArrayMap) \ |
| 131 V(Map, fixed_uint32_array_map, FixedUint32ArrayMap) \ | 112 V(Map, fixed_uint32_array_map, FixedUint32ArrayMap) \ |
| 132 V(Map, fixed_int32_array_map, FixedInt32ArrayMap) \ | 113 V(Map, fixed_int32_array_map, FixedInt32ArrayMap) \ |
| 133 V(Map, fixed_float32_array_map, FixedFloat32ArrayMap) \ | 114 V(Map, fixed_float32_array_map, FixedFloat32ArrayMap) \ |
| 134 V(Map, fixed_float64_array_map, FixedFloat64ArrayMap) \ | 115 V(Map, fixed_float64_array_map, FixedFloat64ArrayMap) \ |
| 135 V(Map, fixed_uint8_clamped_array_map, FixedUint8ClampedArrayMap) \ | 116 V(Map, fixed_uint8_clamped_array_map, FixedUint8ClampedArrayMap) \ |
| 136 V(FixedTypedArrayBase, empty_fixed_uint8_array, EmptyFixedUint8Array) \ | 117 V(FixedTypedArrayBase, empty_fixed_uint8_array, EmptyFixedUint8Array) \ |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 | 1233 |
| 1253 // Generated code can embed direct references to non-writable roots if | 1234 // Generated code can embed direct references to non-writable roots if |
| 1254 // they are in new space. | 1235 // they are in new space. |
| 1255 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); | 1236 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); |
| 1256 // Generated code can treat direct references to this root as constant. | 1237 // Generated code can treat direct references to this root as constant. |
| 1257 bool RootCanBeTreatedAsConstant(RootListIndex root_index); | 1238 bool RootCanBeTreatedAsConstant(RootListIndex root_index); |
| 1258 | 1239 |
| 1259 Map* MapForFixedTypedArray(ExternalArrayType array_type); | 1240 Map* MapForFixedTypedArray(ExternalArrayType array_type); |
| 1260 RootListIndex RootIndexForFixedTypedArray(ExternalArrayType array_type); | 1241 RootListIndex RootIndexForFixedTypedArray(ExternalArrayType array_type); |
| 1261 | 1242 |
| 1262 Map* MapForExternalArrayType(ExternalArrayType array_type); | |
| 1263 RootListIndex RootIndexForExternalArrayType(ExternalArrayType array_type); | |
| 1264 | |
| 1265 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind); | |
| 1266 RootListIndex RootIndexForEmptyFixedTypedArray(ElementsKind kind); | 1243 RootListIndex RootIndexForEmptyFixedTypedArray(ElementsKind kind); |
| 1267 ExternalArray* EmptyExternalArrayForMap(Map* map); | |
| 1268 FixedTypedArrayBase* EmptyFixedTypedArrayForMap(Map* map); | 1244 FixedTypedArrayBase* EmptyFixedTypedArrayForMap(Map* map); |
| 1269 | 1245 |
| 1270 void RecordStats(HeapStats* stats, bool take_snapshot = false); | 1246 void RecordStats(HeapStats* stats, bool take_snapshot = false); |
| 1271 | 1247 |
| 1272 // Copy block of memory from src to dst. Size of block should be aligned | 1248 // Copy block of memory from src to dst. Size of block should be aligned |
| 1273 // by pointer size. | 1249 // by pointer size. |
| 1274 static inline void CopyBlock(Address dst, Address src, int byte_size); | 1250 static inline void CopyBlock(Address dst, Address src, int byte_size); |
| 1275 | 1251 |
| 1276 // Optimized version of memmove for blocks with pointer size aligned sizes and | 1252 // Optimized version of memmove for blocks with pointer size aligned sizes and |
| 1277 // pointer size aligned addresses. | 1253 // pointer size aligned addresses. |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 // These five Create*EntryStub functions are here and forced to not be inlined | 2030 // These five Create*EntryStub functions are here and forced to not be inlined |
| 2055 // because of a gcc-4.4 bug that assigns wrong vtable entries. | 2031 // because of a gcc-4.4 bug that assigns wrong vtable entries. |
| 2056 NO_INLINE(void CreateJSEntryStub()); | 2032 NO_INLINE(void CreateJSEntryStub()); |
| 2057 NO_INLINE(void CreateJSConstructEntryStub()); | 2033 NO_INLINE(void CreateJSConstructEntryStub()); |
| 2058 | 2034 |
| 2059 void CreateFixedStubs(); | 2035 void CreateFixedStubs(); |
| 2060 | 2036 |
| 2061 // Allocate empty fixed array. | 2037 // Allocate empty fixed array. |
| 2062 MUST_USE_RESULT AllocationResult AllocateEmptyFixedArray(); | 2038 MUST_USE_RESULT AllocationResult AllocateEmptyFixedArray(); |
| 2063 | 2039 |
| 2064 // Allocate empty external array of given type. | |
| 2065 MUST_USE_RESULT AllocationResult | |
| 2066 AllocateEmptyExternalArray(ExternalArrayType array_type); | |
| 2067 | |
| 2068 // Allocate empty fixed typed array of given type. | 2040 // Allocate empty fixed typed array of given type. |
| 2069 MUST_USE_RESULT AllocationResult | 2041 MUST_USE_RESULT AllocationResult |
| 2070 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); | 2042 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); |
| 2071 | 2043 |
| 2072 // Allocate a tenured simple cell. | 2044 // Allocate a tenured simple cell. |
| 2073 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); | 2045 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); |
| 2074 | 2046 |
| 2075 // Allocate a tenured JS global property cell initialized with the hole. | 2047 // Allocate a tenured JS global property cell initialized with the hole. |
| 2076 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); | 2048 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); |
| 2077 | 2049 |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2872 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2844 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2873 | 2845 |
| 2874 private: | 2846 private: |
| 2875 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2847 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2876 }; | 2848 }; |
| 2877 #endif // DEBUG | 2849 #endif // DEBUG |
| 2878 } | 2850 } |
| 2879 } // namespace v8::internal | 2851 } // namespace v8::internal |
| 2880 | 2852 |
| 2881 #endif // V8_HEAP_HEAP_H_ | 2853 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |