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