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

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

Issue 640303006: Weak Cells (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Skip cleared weak cells Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/factory.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 V(Map, meta_map, MetaMap) \ 45 V(Map, meta_map, MetaMap) \
46 V(Map, heap_number_map, HeapNumberMap) \ 46 V(Map, heap_number_map, HeapNumberMap) \
47 V(Map, mutable_heap_number_map, MutableHeapNumberMap) \ 47 V(Map, mutable_heap_number_map, MutableHeapNumberMap) \
48 V(Map, native_context_map, NativeContextMap) \ 48 V(Map, native_context_map, NativeContextMap) \
49 V(Map, fixed_array_map, FixedArrayMap) \ 49 V(Map, fixed_array_map, FixedArrayMap) \
50 V(Map, code_map, CodeMap) \ 50 V(Map, code_map, CodeMap) \
51 V(Map, scope_info_map, ScopeInfoMap) \ 51 V(Map, scope_info_map, ScopeInfoMap) \
52 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ 52 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
53 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ 53 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
54 V(Map, constant_pool_array_map, ConstantPoolArrayMap) \ 54 V(Map, constant_pool_array_map, ConstantPoolArrayMap) \
55 V(Map, weak_cell_map, WeakCellMap) \
55 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ 56 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \
56 V(Map, hash_table_map, HashTableMap) \ 57 V(Map, hash_table_map, HashTableMap) \
57 V(Map, ordered_hash_table_map, OrderedHashTableMap) \ 58 V(Map, ordered_hash_table_map, OrderedHashTableMap) \
58 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ 59 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
59 V(ByteArray, empty_byte_array, EmptyByteArray) \ 60 V(ByteArray, empty_byte_array, EmptyByteArray) \
60 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ 61 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
61 V(ConstantPoolArray, empty_constant_pool_array, EmptyConstantPoolArray) \ 62 V(ConstantPoolArray, empty_constant_pool_array, EmptyConstantPoolArray) \
62 V(Oddball, arguments_marker, ArgumentsMarker) \ 63 V(Oddball, arguments_marker, ArgumentsMarker) \
63 /* 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. */ \
64 /* 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 */ \
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 V(meta_map) \ 217 V(meta_map) \
217 V(heap_number_map) \ 218 V(heap_number_map) \
218 V(mutable_heap_number_map) \ 219 V(mutable_heap_number_map) \
219 V(native_context_map) \ 220 V(native_context_map) \
220 V(fixed_array_map) \ 221 V(fixed_array_map) \
221 V(code_map) \ 222 V(code_map) \
222 V(scope_info_map) \ 223 V(scope_info_map) \
223 V(fixed_cow_array_map) \ 224 V(fixed_cow_array_map) \
224 V(fixed_double_array_map) \ 225 V(fixed_double_array_map) \
225 V(constant_pool_array_map) \ 226 V(constant_pool_array_map) \
227 V(weak_cell_map) \
226 V(no_interceptor_result_sentinel) \ 228 V(no_interceptor_result_sentinel) \
227 V(hash_table_map) \ 229 V(hash_table_map) \
228 V(ordered_hash_table_map) \ 230 V(ordered_hash_table_map) \
229 V(empty_fixed_array) \ 231 V(empty_fixed_array) \
230 V(empty_byte_array) \ 232 V(empty_byte_array) \
231 V(empty_descriptor_array) \ 233 V(empty_descriptor_array) \
232 V(empty_constant_pool_array) \ 234 V(empty_constant_pool_array) \
233 V(arguments_marker) \ 235 V(arguments_marker) \
234 V(symbol_map) \ 236 V(symbol_map) \
235 V(sloppy_arguments_elements_map) \ 237 V(sloppy_arguments_elements_map) \
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 824
823 Object* weak_object_to_code_table() { return weak_object_to_code_table_; } 825 Object* weak_object_to_code_table() { return weak_object_to_code_table_; }
824 826
825 void set_encountered_weak_collections(Object* weak_collection) { 827 void set_encountered_weak_collections(Object* weak_collection) {
826 encountered_weak_collections_ = weak_collection; 828 encountered_weak_collections_ = weak_collection;
827 } 829 }
828 Object* encountered_weak_collections() const { 830 Object* encountered_weak_collections() const {
829 return encountered_weak_collections_; 831 return encountered_weak_collections_;
830 } 832 }
831 833
834 void set_encountered_weak_cells(Object* weak_cell) {
835 encountered_weak_cells_ = weak_cell;
836 }
837 Object* encountered_weak_cells() const { return encountered_weak_cells_; }
838
832 // Number of mark-sweeps. 839 // Number of mark-sweeps.
833 unsigned int ms_count() { return ms_count_; } 840 unsigned int ms_count() { return ms_count_; }
834 841
835 // Iterates over all roots in the heap. 842 // Iterates over all roots in the heap.
836 void IterateRoots(ObjectVisitor* v, VisitMode mode); 843 void IterateRoots(ObjectVisitor* v, VisitMode mode);
837 // Iterates over all strong roots in the heap. 844 // Iterates over all strong roots in the heap.
838 void IterateStrongRoots(ObjectVisitor* v, VisitMode mode); 845 void IterateStrongRoots(ObjectVisitor* v, VisitMode mode);
839 // Iterates over entries in the smi roots list. Only interesting to the 846 // Iterates over entries in the smi roots list. Only interesting to the
840 // serializer/deserializer, since GC does not care about smis. 847 // serializer/deserializer, since GC does not care about smis.
841 void IterateSmiRoots(ObjectVisitor* v); 848 void IterateSmiRoots(ObjectVisitor* v);
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 // WeakHashTable that maps objects embedded in optimized code to dependent 1559 // WeakHashTable that maps objects embedded in optimized code to dependent
1553 // code list. It is initilized lazily and contains the undefined_value at 1560 // code list. It is initilized lazily and contains the undefined_value at
1554 // start. 1561 // start.
1555 Object* weak_object_to_code_table_; 1562 Object* weak_object_to_code_table_;
1556 1563
1557 // List of encountered weak collections (JSWeakMap and JSWeakSet) during 1564 // List of encountered weak collections (JSWeakMap and JSWeakSet) during
1558 // marking. It is initialized during marking, destroyed after marking and 1565 // marking. It is initialized during marking, destroyed after marking and
1559 // contains Smi(0) while marking is not active. 1566 // contains Smi(0) while marking is not active.
1560 Object* encountered_weak_collections_; 1567 Object* encountered_weak_collections_;
1561 1568
1569 Object* encountered_weak_cells_;
1570
1562 StoreBufferRebuilder store_buffer_rebuilder_; 1571 StoreBufferRebuilder store_buffer_rebuilder_;
1563 1572
1564 struct StringTypeTable { 1573 struct StringTypeTable {
1565 InstanceType type; 1574 InstanceType type;
1566 int size; 1575 int size;
1567 RootListIndex index; 1576 RootListIndex index;
1568 }; 1577 };
1569 1578
1570 struct ConstantStringTable { 1579 struct ConstantStringTable {
1571 const char* contents; 1580 const char* contents;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 1841
1833 // Allocate empty constant pool array. 1842 // Allocate empty constant pool array.
1834 MUST_USE_RESULT AllocationResult AllocateEmptyConstantPoolArray(); 1843 MUST_USE_RESULT AllocationResult AllocateEmptyConstantPoolArray();
1835 1844
1836 // Allocate a tenured simple cell. 1845 // Allocate a tenured simple cell.
1837 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); 1846 MUST_USE_RESULT AllocationResult AllocateCell(Object* value);
1838 1847
1839 // Allocate a tenured JS global property cell initialized with the hole. 1848 // Allocate a tenured JS global property cell initialized with the hole.
1840 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); 1849 MUST_USE_RESULT AllocationResult AllocatePropertyCell();
1841 1850
1851 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value);
1852
1842 // Allocates a new utility object in the old generation. 1853 // Allocates a new utility object in the old generation.
1843 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type); 1854 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type);
1844 1855
1845 // Allocates a new foreign object. 1856 // Allocates a new foreign object.
1846 MUST_USE_RESULT AllocationResult 1857 MUST_USE_RESULT AllocationResult
1847 AllocateForeign(Address address, PretenureFlag pretenure = NOT_TENURED); 1858 AllocateForeign(Address address, PretenureFlag pretenure = NOT_TENURED);
1848 1859
1849 MUST_USE_RESULT AllocationResult 1860 MUST_USE_RESULT AllocationResult
1850 AllocateCode(int object_size, bool immovable); 1861 AllocateCode(int object_size, bool immovable);
1851 1862
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2531 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2521 2532
2522 private: 2533 private:
2523 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2534 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2524 }; 2535 };
2525 #endif // DEBUG 2536 #endif // DEBUG
2526 } 2537 }
2527 } // namespace v8::internal 2538 } // namespace v8::internal
2528 2539
2529 #endif // V8_HEAP_HEAP_H_ 2540 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698