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 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ | 67 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ |
68 V(Object, instanceof_cache_map, InstanceofCacheMap) \ | 68 V(Object, instanceof_cache_map, InstanceofCacheMap) \ |
69 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ | 69 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ |
70 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ | 70 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ |
71 V(FixedArray, string_split_cache, StringSplitCache) \ | 71 V(FixedArray, string_split_cache, StringSplitCache) \ |
72 V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \ | 72 V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \ |
73 V(Oddball, termination_exception, TerminationException) \ | 73 V(Oddball, termination_exception, TerminationException) \ |
74 V(Smi, hash_seed, HashSeed) \ | 74 V(Smi, hash_seed, HashSeed) \ |
75 V(Map, symbol_map, SymbolMap) \ | 75 V(Map, symbol_map, SymbolMap) \ |
76 V(Map, string_map, StringMap) \ | 76 V(Map, string_map, StringMap) \ |
77 V(Map, ascii_string_map, AsciiStringMap) \ | 77 V(Map, one_byte_string_map, OneByteStringMap) \ |
78 V(Map, cons_string_map, ConsStringMap) \ | 78 V(Map, cons_string_map, ConsStringMap) \ |
79 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ | 79 V(Map, cons_one_byte_string_map, ConsOneByteStringMap) \ |
80 V(Map, sliced_string_map, SlicedStringMap) \ | 80 V(Map, sliced_string_map, SlicedStringMap) \ |
81 V(Map, sliced_ascii_string_map, SlicedAsciiStringMap) \ | 81 V(Map, sliced_one_byte_string_map, SlicedOneByteStringMap) \ |
82 V(Map, external_string_map, ExternalStringMap) \ | 82 V(Map, external_string_map, ExternalStringMap) \ |
83 V(Map, external_string_with_one_byte_data_map, \ | 83 V(Map, external_string_with_one_byte_data_map, \ |
84 ExternalStringWithOneByteDataMap) \ | 84 ExternalStringWithOneByteDataMap) \ |
85 V(Map, external_ascii_string_map, ExternalAsciiStringMap) \ | 85 V(Map, external_one_byte_string_map, ExternalOneByteStringMap) \ |
86 V(Map, short_external_string_map, ShortExternalStringMap) \ | 86 V(Map, short_external_string_map, ShortExternalStringMap) \ |
87 V(Map, short_external_string_with_one_byte_data_map, \ | 87 V(Map, short_external_string_with_one_byte_data_map, \ |
88 ShortExternalStringWithOneByteDataMap) \ | 88 ShortExternalStringWithOneByteDataMap) \ |
89 V(Map, internalized_string_map, InternalizedStringMap) \ | 89 V(Map, internalized_string_map, InternalizedStringMap) \ |
90 V(Map, ascii_internalized_string_map, AsciiInternalizedStringMap) \ | 90 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ |
91 V(Map, external_internalized_string_map, ExternalInternalizedStringMap) \ | 91 V(Map, external_internalized_string_map, ExternalInternalizedStringMap) \ |
92 V(Map, external_internalized_string_with_one_byte_data_map, \ | 92 V(Map, external_internalized_string_with_one_byte_data_map, \ |
93 ExternalInternalizedStringWithOneByteDataMap) \ | 93 ExternalInternalizedStringWithOneByteDataMap) \ |
94 V(Map, external_ascii_internalized_string_map, \ | 94 V(Map, external_one_byte_internalized_string_map, \ |
95 ExternalAsciiInternalizedStringMap) \ | 95 ExternalOneByteInternalizedStringMap) \ |
96 V(Map, short_external_internalized_string_map, \ | 96 V(Map, short_external_internalized_string_map, \ |
97 ShortExternalInternalizedStringMap) \ | 97 ShortExternalInternalizedStringMap) \ |
98 V(Map, short_external_internalized_string_with_one_byte_data_map, \ | 98 V(Map, short_external_internalized_string_with_one_byte_data_map, \ |
99 ShortExternalInternalizedStringWithOneByteDataMap) \ | 99 ShortExternalInternalizedStringWithOneByteDataMap) \ |
100 V(Map, short_external_ascii_internalized_string_map, \ | 100 V(Map, short_external_one_byte_internalized_string_map, \ |
101 ShortExternalAsciiInternalizedStringMap) \ | 101 ShortExternalOneByteInternalizedStringMap) \ |
102 V(Map, short_external_ascii_string_map, ShortExternalAsciiStringMap) \ | 102 V(Map, short_external_one_byte_string_map, ShortExternalOneByteStringMap) \ |
103 V(Map, undetectable_string_map, UndetectableStringMap) \ | 103 V(Map, undetectable_string_map, UndetectableStringMap) \ |
104 V(Map, undetectable_ascii_string_map, UndetectableAsciiStringMap) \ | 104 V(Map, undetectable_one_byte_string_map, UndetectableOneByteStringMap) \ |
105 V(Map, external_int8_array_map, ExternalInt8ArrayMap) \ | 105 V(Map, external_int8_array_map, ExternalInt8ArrayMap) \ |
106 V(Map, external_uint8_array_map, ExternalUint8ArrayMap) \ | 106 V(Map, external_uint8_array_map, ExternalUint8ArrayMap) \ |
107 V(Map, external_int16_array_map, ExternalInt16ArrayMap) \ | 107 V(Map, external_int16_array_map, ExternalInt16ArrayMap) \ |
108 V(Map, external_uint16_array_map, ExternalUint16ArrayMap) \ | 108 V(Map, external_uint16_array_map, ExternalUint16ArrayMap) \ |
109 V(Map, external_int32_array_map, ExternalInt32ArrayMap) \ | 109 V(Map, external_int32_array_map, ExternalInt32ArrayMap) \ |
110 V(Map, external_uint32_array_map, ExternalUint32ArrayMap) \ | 110 V(Map, external_uint32_array_map, ExternalUint32ArrayMap) \ |
111 V(Map, external_float32_array_map, ExternalFloat32ArrayMap) \ | 111 V(Map, external_float32_array_map, ExternalFloat32ArrayMap) \ |
112 V(Map, external_float64_array_map, ExternalFloat64ArrayMap) \ | 112 V(Map, external_float64_array_map, ExternalFloat64ArrayMap) \ |
113 V(Map, external_uint8_clamped_array_map, ExternalUint8ClampedArrayMap) \ | 113 V(Map, external_uint8_clamped_array_map, ExternalUint8ClampedArrayMap) \ |
114 V(ExternalArray, empty_external_int8_array, EmptyExternalInt8Array) \ | 114 V(ExternalArray, empty_external_int8_array, EmptyExternalInt8Array) \ |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 // Allocate an uninitialized fixed double array. | 1687 // Allocate an uninitialized fixed double array. |
1688 MUST_USE_RESULT AllocationResult | 1688 MUST_USE_RESULT AllocationResult |
1689 AllocateRawFixedDoubleArray(int length, PretenureFlag pretenure); | 1689 AllocateRawFixedDoubleArray(int length, PretenureFlag pretenure); |
1690 | 1690 |
1691 // Allocate an initialized fixed array with the given filler value. | 1691 // Allocate an initialized fixed array with the given filler value. |
1692 MUST_USE_RESULT AllocationResult | 1692 MUST_USE_RESULT AllocationResult |
1693 AllocateFixedArrayWithFiller(int length, PretenureFlag pretenure, | 1693 AllocateFixedArrayWithFiller(int length, PretenureFlag pretenure, |
1694 Object* filler); | 1694 Object* filler); |
1695 | 1695 |
1696 // Allocate and partially initializes a String. There are two String | 1696 // Allocate and partially initializes a String. There are two String |
1697 // encodings: ASCII and two byte. These functions allocate a string of the | 1697 // encodings: one-byte and two-byte. These functions allocate a string of |
1698 // given length and set its map and length fields. The characters of the | 1698 // the given length and set its map and length fields. The characters of |
1699 // string are uninitialized. | 1699 // the string are uninitialized. |
1700 MUST_USE_RESULT AllocationResult | 1700 MUST_USE_RESULT AllocationResult |
1701 AllocateRawOneByteString(int length, PretenureFlag pretenure); | 1701 AllocateRawOneByteString(int length, PretenureFlag pretenure); |
1702 MUST_USE_RESULT AllocationResult | 1702 MUST_USE_RESULT AllocationResult |
1703 AllocateRawTwoByteString(int length, PretenureFlag pretenure); | 1703 AllocateRawTwoByteString(int length, PretenureFlag pretenure); |
1704 | 1704 |
1705 bool CreateInitialMaps(); | 1705 bool CreateInitialMaps(); |
1706 void CreateInitialObjects(); | 1706 void CreateInitialObjects(); |
1707 | 1707 |
1708 // Allocates an internalized string in old space based on the character | 1708 // Allocates an internalized string in old space based on the character |
1709 // stream. | 1709 // stream. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray( | 1741 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray( |
1742 FixedDoubleArray* src); | 1742 FixedDoubleArray* src); |
1743 | 1743 |
1744 // Make a copy of src and return it. Returns | 1744 // Make a copy of src and return it. Returns |
1745 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. | 1745 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. |
1746 MUST_USE_RESULT inline AllocationResult CopyConstantPoolArray( | 1746 MUST_USE_RESULT inline AllocationResult CopyConstantPoolArray( |
1747 ConstantPoolArray* src); | 1747 ConstantPoolArray* src); |
1748 | 1748 |
1749 | 1749 |
1750 // Computes a single character string where the character has code. | 1750 // Computes a single character string where the character has code. |
1751 // A cache is used for ASCII codes. | 1751 // A cache is used for one-byte (Latin1) codes. |
1752 MUST_USE_RESULT AllocationResult | 1752 MUST_USE_RESULT AllocationResult |
1753 LookupSingleCharacterStringFromCode(uint16_t code); | 1753 LookupSingleCharacterStringFromCode(uint16_t code); |
1754 | 1754 |
1755 // Allocate a symbol in old space. | 1755 // Allocate a symbol in old space. |
1756 MUST_USE_RESULT AllocationResult AllocateSymbol(); | 1756 MUST_USE_RESULT AllocationResult AllocateSymbol(); |
1757 | 1757 |
1758 // Make a copy of src, set the map, and return the copy. | 1758 // Make a copy of src, set the map, and return the copy. |
1759 MUST_USE_RESULT AllocationResult | 1759 MUST_USE_RESULT AllocationResult |
1760 CopyConstantPoolArrayWithMap(ConstantPoolArray* src, Map* map); | 1760 CopyConstantPoolArrayWithMap(ConstantPoolArray* src, Map* map); |
1761 | 1761 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2490 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2491 | 2491 |
2492 private: | 2492 private: |
2493 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2493 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2494 }; | 2494 }; |
2495 #endif // DEBUG | 2495 #endif // DEBUG |
2496 } | 2496 } |
2497 } // namespace v8::internal | 2497 } // namespace v8::internal |
2498 | 2498 |
2499 #endif // V8_HEAP_HEAP_H_ | 2499 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |