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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 // Allocates an external array of the specified length and type. | 876 // Allocates an external array of the specified length and type. |
868 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 877 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
869 // failed. | 878 // failed. |
870 // Please note this does not perform a garbage collection. | 879 // Please note this does not perform a garbage collection. |
871 MUST_USE_RESULT MaybeObject* AllocateExternalArray( | 880 MUST_USE_RESULT MaybeObject* AllocateExternalArray( |
872 int length, | 881 int length, |
873 ExternalArrayType array_type, | 882 ExternalArrayType array_type, |
874 void* external_pointer, | 883 void* external_pointer, |
875 PretenureFlag pretenure); | 884 PretenureFlag pretenure); |
876 | 885 |
| 886 // Allocates a fixed typed array of the specified length and type. |
| 887 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 888 // failed. |
| 889 // Please note this does not perform a garbage collection. |
| 890 MUST_USE_RESULT MaybeObject* AllocateFixedTypedArray( |
| 891 int length, |
| 892 ExternalArrayType array_type, |
| 893 PretenureFlag pretenure); |
| 894 |
877 // Allocate a symbol in old space. | 895 // Allocate a symbol in old space. |
878 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 896 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
879 // failed. | 897 // failed. |
880 // Please note this does not perform a garbage collection. | 898 // Please note this does not perform a garbage collection. |
881 MUST_USE_RESULT MaybeObject* AllocateSymbol(); | 899 MUST_USE_RESULT MaybeObject* AllocateSymbol(); |
882 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol(); | 900 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol(); |
883 | 901 |
884 // Allocate a tenured AllocationSite. It's payload is null | 902 // Allocate a tenured AllocationSite. It's payload is null |
885 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); | 903 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); |
886 | 904 |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); | 1566 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); |
1549 // Generated code can treat direct references to this root as constant. | 1567 // Generated code can treat direct references to this root as constant. |
1550 bool RootCanBeTreatedAsConstant(RootListIndex root_index); | 1568 bool RootCanBeTreatedAsConstant(RootListIndex root_index); |
1551 | 1569 |
1552 MUST_USE_RESULT MaybeObject* NumberToString( | 1570 MUST_USE_RESULT MaybeObject* NumberToString( |
1553 Object* number, bool check_number_string_cache = true, | 1571 Object* number, bool check_number_string_cache = true, |
1554 PretenureFlag pretenure = NOT_TENURED); | 1572 PretenureFlag pretenure = NOT_TENURED); |
1555 MUST_USE_RESULT MaybeObject* Uint32ToString( | 1573 MUST_USE_RESULT MaybeObject* Uint32ToString( |
1556 uint32_t value, bool check_number_string_cache = true); | 1574 uint32_t value, bool check_number_string_cache = true); |
1557 | 1575 |
| 1576 Map* MapForFixedTypedArray(ExternalArrayType array_type); |
| 1577 RootListIndex RootIndexForFixedTypedArray( |
| 1578 ExternalArrayType array_type); |
| 1579 |
1558 Map* MapForExternalArrayType(ExternalArrayType array_type); | 1580 Map* MapForExternalArrayType(ExternalArrayType array_type); |
1559 RootListIndex RootIndexForExternalArrayType( | 1581 RootListIndex RootIndexForExternalArrayType( |
1560 ExternalArrayType array_type); | 1582 ExternalArrayType array_type); |
1561 | 1583 |
1562 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind); | 1584 RootListIndex RootIndexForEmptyExternalArray(ElementsKind kind); |
1563 ExternalArray* EmptyExternalArrayForMap(Map* map); | 1585 ExternalArray* EmptyExternalArrayForMap(Map* map); |
1564 | 1586 |
1565 void RecordStats(HeapStats* stats, bool take_snapshot = false); | 1587 void RecordStats(HeapStats* stats, bool take_snapshot = false); |
1566 | 1588 |
1567 // Copy block of memory from src to dst. Size of block should be aligned | 1589 // 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 Loading... |
1830 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep); | 1852 MaybeObject* AddWeakObjectToCodeDependency(Object* obj, DependentCode* dep); |
1831 | 1853 |
1832 DependentCode* LookupWeakObjectToCodeDependency(Object* obj); | 1854 DependentCode* LookupWeakObjectToCodeDependency(Object* obj); |
1833 | 1855 |
1834 void InitializeWeakObjectToCodeTable() { | 1856 void InitializeWeakObjectToCodeTable() { |
1835 set_weak_object_to_code_table(undefined_value()); | 1857 set_weak_object_to_code_table(undefined_value()); |
1836 } | 1858 } |
1837 | 1859 |
1838 void EnsureWeakObjectToCodeTable(); | 1860 void EnsureWeakObjectToCodeTable(); |
1839 | 1861 |
| 1862 static void FatalProcessOutOfMemory(const char* location, |
| 1863 bool take_snapshot = false); |
| 1864 |
1840 private: | 1865 private: |
1841 Heap(); | 1866 Heap(); |
1842 | 1867 |
1843 // This can be calculated directly from a pointer to the heap; however, it is | 1868 // This can be calculated directly from a pointer to the heap; however, it is |
1844 // more expedient to get at the isolate directly from within Heap methods. | 1869 // more expedient to get at the isolate directly from within Heap methods. |
1845 Isolate* isolate_; | 1870 Isolate* isolate_; |
1846 | 1871 |
1847 Object* roots_[kRootListLength]; | 1872 Object* roots_[kRootListLength]; |
1848 | 1873 |
1849 intptr_t code_range_size_; | 1874 intptr_t code_range_size_; |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3021 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2997 | 3022 |
2998 private: | 3023 private: |
2999 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3024 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
3000 }; | 3025 }; |
3001 #endif // DEBUG | 3026 #endif // DEBUG |
3002 | 3027 |
3003 } } // namespace v8::internal | 3028 } } // namespace v8::internal |
3004 | 3029 |
3005 #endif // V8_HEAP_H_ | 3030 #endif // V8_HEAP_H_ |
OLD | NEW |