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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 V(Map, meta_map, MetaMap) \ | 46 V(Map, meta_map, MetaMap) \ |
47 V(Map, heap_number_map, HeapNumberMap) \ | 47 V(Map, heap_number_map, HeapNumberMap) \ |
48 V(Map, mutable_heap_number_map, MutableHeapNumberMap) \ | 48 V(Map, mutable_heap_number_map, MutableHeapNumberMap) \ |
49 V(Map, float32x4_map, Float32x4Map) \ | 49 V(Map, float32x4_map, Float32x4Map) \ |
50 V(Map, native_context_map, NativeContextMap) \ | 50 V(Map, native_context_map, NativeContextMap) \ |
51 V(Map, fixed_array_map, FixedArrayMap) \ | 51 V(Map, fixed_array_map, FixedArrayMap) \ |
52 V(Map, code_map, CodeMap) \ | 52 V(Map, code_map, CodeMap) \ |
53 V(Map, scope_info_map, ScopeInfoMap) \ | 53 V(Map, scope_info_map, ScopeInfoMap) \ |
54 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ | 54 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ |
55 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ | 55 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ |
56 V(Map, constant_pool_array_map, ConstantPoolArrayMap) \ | |
57 V(Map, weak_cell_map, WeakCellMap) \ | 56 V(Map, weak_cell_map, WeakCellMap) \ |
58 V(Map, one_byte_string_map, OneByteStringMap) \ | 57 V(Map, one_byte_string_map, OneByteStringMap) \ |
59 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ | 58 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ |
60 V(Map, function_context_map, FunctionContextMap) \ | 59 V(Map, function_context_map, FunctionContextMap) \ |
61 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ | 60 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
62 V(ByteArray, empty_byte_array, EmptyByteArray) \ | 61 V(ByteArray, empty_byte_array, EmptyByteArray) \ |
63 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ | 62 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ |
64 V(ConstantPoolArray, empty_constant_pool_array, EmptyConstantPoolArray) \ | |
65 /* The roots above this line should be boring from a GC point of view. */ \ | 63 /* The roots above this line should be boring from a GC point of view. */ \ |
66 /* This means they are never in new space and never on a page that is */ \ | 64 /* This means they are never in new space and never on a page that is */ \ |
67 /* being compacted. */ \ | 65 /* being compacted. */ \ |
68 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ | 66 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ |
69 V(Oddball, arguments_marker, ArgumentsMarker) \ | 67 V(Oddball, arguments_marker, ArgumentsMarker) \ |
70 V(Oddball, exception, Exception) \ | 68 V(Oddball, exception, Exception) \ |
71 V(Oddball, termination_exception, TerminationException) \ | 69 V(Oddball, termination_exception, TerminationException) \ |
72 V(FixedArray, number_string_cache, NumberStringCache) \ | 70 V(FixedArray, number_string_cache, NumberStringCache) \ |
73 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ | 71 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ |
74 V(Object, instanceof_cache_map, InstanceofCacheMap) \ | 72 V(Object, instanceof_cache_map, InstanceofCacheMap) \ |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 V(MetaMap) \ | 343 V(MetaMap) \ |
346 V(HeapNumberMap) \ | 344 V(HeapNumberMap) \ |
347 V(MutableHeapNumberMap) \ | 345 V(MutableHeapNumberMap) \ |
348 V(Float32x4Map) \ | 346 V(Float32x4Map) \ |
349 V(NativeContextMap) \ | 347 V(NativeContextMap) \ |
350 V(FixedArrayMap) \ | 348 V(FixedArrayMap) \ |
351 V(CodeMap) \ | 349 V(CodeMap) \ |
352 V(ScopeInfoMap) \ | 350 V(ScopeInfoMap) \ |
353 V(FixedCOWArrayMap) \ | 351 V(FixedCOWArrayMap) \ |
354 V(FixedDoubleArrayMap) \ | 352 V(FixedDoubleArrayMap) \ |
355 V(ConstantPoolArrayMap) \ | |
356 V(WeakCellMap) \ | 353 V(WeakCellMap) \ |
357 V(NoInterceptorResultSentinel) \ | 354 V(NoInterceptorResultSentinel) \ |
358 V(HashTableMap) \ | 355 V(HashTableMap) \ |
359 V(OrderedHashTableMap) \ | 356 V(OrderedHashTableMap) \ |
360 V(EmptyFixedArray) \ | 357 V(EmptyFixedArray) \ |
361 V(EmptyByteArray) \ | 358 V(EmptyByteArray) \ |
362 V(EmptyDescriptorArray) \ | 359 V(EmptyDescriptorArray) \ |
363 V(EmptyConstantPoolArray) \ | |
364 V(ArgumentsMarker) \ | 360 V(ArgumentsMarker) \ |
365 V(SymbolMap) \ | 361 V(SymbolMap) \ |
366 V(SloppyArgumentsElementsMap) \ | 362 V(SloppyArgumentsElementsMap) \ |
367 V(FunctionContextMap) \ | 363 V(FunctionContextMap) \ |
368 V(CatchContextMap) \ | 364 V(CatchContextMap) \ |
369 V(WithContextMap) \ | 365 V(WithContextMap) \ |
370 V(BlockContextMap) \ | 366 V(BlockContextMap) \ |
371 V(ModuleContextMap) \ | 367 V(ModuleContextMap) \ |
372 V(ScriptContextMap) \ | 368 V(ScriptContextMap) \ |
373 V(UndefinedMap) \ | 369 V(UndefinedMap) \ |
(...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 // Make a copy of src, set the map, and return the copy. Returns | 1963 // Make a copy of src, set the map, and return the copy. Returns |
1968 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. | 1964 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. |
1969 MUST_USE_RESULT AllocationResult | 1965 MUST_USE_RESULT AllocationResult |
1970 CopyFixedArrayWithMap(FixedArray* src, Map* map); | 1966 CopyFixedArrayWithMap(FixedArray* src, Map* map); |
1971 | 1967 |
1972 // Make a copy of src and return it. Returns | 1968 // Make a copy of src and return it. Returns |
1973 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. | 1969 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. |
1974 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray( | 1970 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray( |
1975 FixedDoubleArray* src); | 1971 FixedDoubleArray* src); |
1976 | 1972 |
1977 // Make a copy of src and return it. Returns | |
1978 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. | |
1979 MUST_USE_RESULT inline AllocationResult CopyConstantPoolArray( | |
1980 ConstantPoolArray* src); | |
1981 | |
1982 | |
1983 // Computes a single character string where the character has code. | 1973 // Computes a single character string where the character has code. |
1984 // A cache is used for one-byte (Latin1) codes. | 1974 // A cache is used for one-byte (Latin1) codes. |
1985 MUST_USE_RESULT AllocationResult | 1975 MUST_USE_RESULT AllocationResult |
1986 LookupSingleCharacterStringFromCode(uint16_t code); | 1976 LookupSingleCharacterStringFromCode(uint16_t code); |
1987 | 1977 |
1988 // Allocate a symbol in old space. | 1978 // Allocate a symbol in old space. |
1989 MUST_USE_RESULT AllocationResult AllocateSymbol(); | 1979 MUST_USE_RESULT AllocationResult AllocateSymbol(); |
1990 | 1980 |
1991 // Make a copy of src, set the map, and return the copy. | |
1992 MUST_USE_RESULT AllocationResult | |
1993 CopyConstantPoolArrayWithMap(ConstantPoolArray* src, Map* map); | |
1994 | |
1995 MUST_USE_RESULT AllocationResult AllocateConstantPoolArray( | |
1996 const ConstantPoolArray::NumberOfEntries& small); | |
1997 | |
1998 MUST_USE_RESULT AllocationResult AllocateExtendedConstantPoolArray( | |
1999 const ConstantPoolArray::NumberOfEntries& small, | |
2000 const ConstantPoolArray::NumberOfEntries& extended); | |
2001 | |
2002 // Allocates an external array of the specified length and type. | 1981 // Allocates an external array of the specified length and type. |
2003 MUST_USE_RESULT AllocationResult | 1982 MUST_USE_RESULT AllocationResult |
2004 AllocateExternalArray(int length, ExternalArrayType array_type, | 1983 AllocateExternalArray(int length, ExternalArrayType array_type, |
2005 void* external_pointer, PretenureFlag pretenure); | 1984 void* external_pointer, PretenureFlag pretenure); |
2006 | 1985 |
2007 // Allocates a fixed typed array of the specified length and type. | 1986 // Allocates a fixed typed array of the specified length and type. |
2008 MUST_USE_RESULT AllocationResult | 1987 MUST_USE_RESULT AllocationResult |
2009 AllocateFixedTypedArray(int length, ExternalArrayType array_type, | 1988 AllocateFixedTypedArray(int length, ExternalArrayType array_type, |
2010 bool initialize, PretenureFlag pretenure); | 1989 bool initialize, PretenureFlag pretenure); |
2011 | 1990 |
(...skipping 19 matching lines...) Expand all Loading... |
2031 MUST_USE_RESULT AllocationResult AllocateEmptyFixedArray(); | 2010 MUST_USE_RESULT AllocationResult AllocateEmptyFixedArray(); |
2032 | 2011 |
2033 // Allocate empty external array of given type. | 2012 // Allocate empty external array of given type. |
2034 MUST_USE_RESULT AllocationResult | 2013 MUST_USE_RESULT AllocationResult |
2035 AllocateEmptyExternalArray(ExternalArrayType array_type); | 2014 AllocateEmptyExternalArray(ExternalArrayType array_type); |
2036 | 2015 |
2037 // Allocate empty fixed typed array of given type. | 2016 // Allocate empty fixed typed array of given type. |
2038 MUST_USE_RESULT AllocationResult | 2017 MUST_USE_RESULT AllocationResult |
2039 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); | 2018 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); |
2040 | 2019 |
2041 // Allocate empty constant pool array. | |
2042 MUST_USE_RESULT AllocationResult AllocateEmptyConstantPoolArray(); | |
2043 | |
2044 // Allocate a tenured simple cell. | 2020 // Allocate a tenured simple cell. |
2045 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); | 2021 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); |
2046 | 2022 |
2047 // Allocate a tenured JS global property cell initialized with the hole. | 2023 // Allocate a tenured JS global property cell initialized with the hole. |
2048 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); | 2024 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); |
2049 | 2025 |
2050 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value); | 2026 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value); |
2051 | 2027 |
2052 // Allocates a new utility object in the old generation. | 2028 // Allocates a new utility object in the old generation. |
2053 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type); | 2029 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2753 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2729 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2754 | 2730 |
2755 private: | 2731 private: |
2756 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2732 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2757 }; | 2733 }; |
2758 #endif // DEBUG | 2734 #endif // DEBUG |
2759 } | 2735 } |
2760 } // namespace v8::internal | 2736 } // namespace v8::internal |
2761 | 2737 |
2762 #endif // V8_HEAP_HEAP_H_ | 2738 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |