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

Side by Side Diff: src/heap/heap.h

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months 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
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 V(Map, shared_function_info_map, SharedFunctionInfoMap) \ 45 V(Map, shared_function_info_map, SharedFunctionInfoMap) \
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, native_context_map, NativeContextMap) \ 49 V(Map, native_context_map, NativeContextMap) \
50 V(Map, fixed_array_map, FixedArrayMap) \ 50 V(Map, fixed_array_map, FixedArrayMap) \
51 V(Map, code_map, CodeMap) \ 51 V(Map, code_map, CodeMap) \
52 V(Map, scope_info_map, ScopeInfoMap) \ 52 V(Map, scope_info_map, ScopeInfoMap) \
53 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ 53 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
54 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ 54 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
55 V(Map, constant_pool_array_map, ConstantPoolArrayMap) \
56 V(Map, weak_cell_map, WeakCellMap) \ 55 V(Map, weak_cell_map, WeakCellMap) \
57 V(Map, one_byte_string_map, OneByteStringMap) \ 56 V(Map, one_byte_string_map, OneByteStringMap) \
58 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ 57 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \
59 V(Map, function_context_map, FunctionContextMap) \ 58 V(Map, function_context_map, FunctionContextMap) \
60 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ 59 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
61 V(ByteArray, empty_byte_array, EmptyByteArray) \ 60 V(ByteArray, empty_byte_array, EmptyByteArray) \
62 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ 61 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
63 V(ConstantPoolArray, empty_constant_pool_array, EmptyConstantPoolArray) \
64 /* The roots above this line should be boring from a GC point of view. */ \ 62 /* The roots above this line should be boring from a GC point of view. */ \
65 /* This means they are never in new space and never on a page that is */ \ 63 /* This means they are never in new space and never on a page that is */ \
66 /* being compacted. */ \ 64 /* being compacted. */ \
67 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ 65 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
68 V(Oddball, arguments_marker, ArgumentsMarker) \ 66 V(Oddball, arguments_marker, ArgumentsMarker) \
69 V(Oddball, exception, Exception) \ 67 V(Oddball, exception, Exception) \
70 V(Oddball, termination_exception, TerminationException) \ 68 V(Oddball, termination_exception, TerminationException) \
71 V(FixedArray, number_string_cache, NumberStringCache) \ 69 V(FixedArray, number_string_cache, NumberStringCache) \
72 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ 70 V(Object, instanceof_cache_function, InstanceofCacheFunction) \
73 V(Object, instanceof_cache_map, InstanceofCacheMap) \ 71 V(Object, instanceof_cache_map, InstanceofCacheMap) \
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 V(SharedFunctionInfoMap) \ 339 V(SharedFunctionInfoMap) \
342 V(MetaMap) \ 340 V(MetaMap) \
343 V(HeapNumberMap) \ 341 V(HeapNumberMap) \
344 V(MutableHeapNumberMap) \ 342 V(MutableHeapNumberMap) \
345 V(NativeContextMap) \ 343 V(NativeContextMap) \
346 V(FixedArrayMap) \ 344 V(FixedArrayMap) \
347 V(CodeMap) \ 345 V(CodeMap) \
348 V(ScopeInfoMap) \ 346 V(ScopeInfoMap) \
349 V(FixedCOWArrayMap) \ 347 V(FixedCOWArrayMap) \
350 V(FixedDoubleArrayMap) \ 348 V(FixedDoubleArrayMap) \
351 V(ConstantPoolArrayMap) \
352 V(WeakCellMap) \ 349 V(WeakCellMap) \
353 V(NoInterceptorResultSentinel) \ 350 V(NoInterceptorResultSentinel) \
354 V(HashTableMap) \ 351 V(HashTableMap) \
355 V(OrderedHashTableMap) \ 352 V(OrderedHashTableMap) \
356 V(EmptyFixedArray) \ 353 V(EmptyFixedArray) \
357 V(EmptyByteArray) \ 354 V(EmptyByteArray) \
358 V(EmptyDescriptorArray) \ 355 V(EmptyDescriptorArray) \
359 V(EmptyConstantPoolArray) \
360 V(ArgumentsMarker) \ 356 V(ArgumentsMarker) \
361 V(SymbolMap) \ 357 V(SymbolMap) \
362 V(SloppyArgumentsElementsMap) \ 358 V(SloppyArgumentsElementsMap) \
363 V(FunctionContextMap) \ 359 V(FunctionContextMap) \
364 V(CatchContextMap) \ 360 V(CatchContextMap) \
365 V(WithContextMap) \ 361 V(WithContextMap) \
366 V(BlockContextMap) \ 362 V(BlockContextMap) \
367 V(ModuleContextMap) \ 363 V(ModuleContextMap) \
368 V(ScriptContextMap) \ 364 V(ScriptContextMap) \
369 V(UndefinedMap) \ 365 V(UndefinedMap) \
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1896 // Make a copy of src, set the map, and return the copy. Returns 1892 // Make a copy of src, set the map, and return the copy. Returns
1897 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. 1893 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
1898 MUST_USE_RESULT AllocationResult 1894 MUST_USE_RESULT AllocationResult
1899 CopyFixedArrayWithMap(FixedArray* src, Map* map); 1895 CopyFixedArrayWithMap(FixedArray* src, Map* map);
1900 1896
1901 // Make a copy of src and return it. Returns 1897 // Make a copy of src and return it. Returns
1902 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. 1898 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
1903 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray( 1899 MUST_USE_RESULT inline AllocationResult CopyFixedDoubleArray(
1904 FixedDoubleArray* src); 1900 FixedDoubleArray* src);
1905 1901
1906 // Make a copy of src and return it. Returns
1907 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed.
1908 MUST_USE_RESULT inline AllocationResult CopyConstantPoolArray(
1909 ConstantPoolArray* src);
1910
1911
1912 // Computes a single character string where the character has code. 1902 // Computes a single character string where the character has code.
1913 // A cache is used for one-byte (Latin1) codes. 1903 // A cache is used for one-byte (Latin1) codes.
1914 MUST_USE_RESULT AllocationResult 1904 MUST_USE_RESULT AllocationResult
1915 LookupSingleCharacterStringFromCode(uint16_t code); 1905 LookupSingleCharacterStringFromCode(uint16_t code);
1916 1906
1917 // Allocate a symbol in old space. 1907 // Allocate a symbol in old space.
1918 MUST_USE_RESULT AllocationResult AllocateSymbol(); 1908 MUST_USE_RESULT AllocationResult AllocateSymbol();
1919 1909
1920 // Make a copy of src, set the map, and return the copy.
1921 MUST_USE_RESULT AllocationResult
1922 CopyConstantPoolArrayWithMap(ConstantPoolArray* src, Map* map);
1923
1924 MUST_USE_RESULT AllocationResult AllocateConstantPoolArray(
1925 const ConstantPoolArray::NumberOfEntries& small);
1926
1927 MUST_USE_RESULT AllocationResult AllocateExtendedConstantPoolArray(
1928 const ConstantPoolArray::NumberOfEntries& small,
1929 const ConstantPoolArray::NumberOfEntries& extended);
1930
1931 // Allocates an external array of the specified length and type. 1910 // Allocates an external array of the specified length and type.
1932 MUST_USE_RESULT AllocationResult 1911 MUST_USE_RESULT AllocationResult
1933 AllocateExternalArray(int length, ExternalArrayType array_type, 1912 AllocateExternalArray(int length, ExternalArrayType array_type,
1934 void* external_pointer, PretenureFlag pretenure); 1913 void* external_pointer, PretenureFlag pretenure);
1935 1914
1936 // Allocates a fixed typed array of the specified length and type. 1915 // Allocates a fixed typed array of the specified length and type.
1937 MUST_USE_RESULT AllocationResult 1916 MUST_USE_RESULT AllocationResult
1938 AllocateFixedTypedArray(int length, ExternalArrayType array_type, 1917 AllocateFixedTypedArray(int length, ExternalArrayType array_type,
1939 PretenureFlag pretenure); 1918 PretenureFlag pretenure);
1940 1919
(...skipping 19 matching lines...) Expand all
1960 MUST_USE_RESULT AllocationResult AllocateEmptyFixedArray(); 1939 MUST_USE_RESULT AllocationResult AllocateEmptyFixedArray();
1961 1940
1962 // Allocate empty external array of given type. 1941 // Allocate empty external array of given type.
1963 MUST_USE_RESULT AllocationResult 1942 MUST_USE_RESULT AllocationResult
1964 AllocateEmptyExternalArray(ExternalArrayType array_type); 1943 AllocateEmptyExternalArray(ExternalArrayType array_type);
1965 1944
1966 // Allocate empty fixed typed array of given type. 1945 // Allocate empty fixed typed array of given type.
1967 MUST_USE_RESULT AllocationResult 1946 MUST_USE_RESULT AllocationResult
1968 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); 1947 AllocateEmptyFixedTypedArray(ExternalArrayType array_type);
1969 1948
1970 // Allocate empty constant pool array.
1971 MUST_USE_RESULT AllocationResult AllocateEmptyConstantPoolArray();
1972
1973 // Allocate a tenured simple cell. 1949 // Allocate a tenured simple cell.
1974 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); 1950 MUST_USE_RESULT AllocationResult AllocateCell(Object* value);
1975 1951
1976 // Allocate a tenured JS global property cell initialized with the hole. 1952 // Allocate a tenured JS global property cell initialized with the hole.
1977 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); 1953 MUST_USE_RESULT AllocationResult AllocatePropertyCell();
1978 1954
1979 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value); 1955 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value);
1980 1956
1981 // Allocates a new utility object in the old generation. 1957 // Allocates a new utility object in the old generation.
1982 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type); 1958 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type);
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2615 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2640 2616
2641 private: 2617 private:
2642 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2618 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2643 }; 2619 };
2644 #endif // DEBUG 2620 #endif // DEBUG
2645 } 2621 }
2646 } // namespace v8::internal 2622 } // namespace v8::internal
2647 2623
2648 #endif // V8_HEAP_HEAP_H_ 2624 #endif // V8_HEAP_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698