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

Side by Side Diff: src/heap/objects-visiting.h

Issue 2915793002: [api] Prototype WeakRef implementation
Patch Set: Created 3 years, 6 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
« no previous file with comments | « src/heap/object-stats.cc ('k') | src/heap/objects-visiting.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_OBJECTS_VISITING_H_ 5 #ifndef V8_OBJECTS_VISITING_H_
6 #define V8_OBJECTS_VISITING_H_ 6 #define V8_OBJECTS_VISITING_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/heap/embedder-tracing.h" 9 #include "src/heap/embedder-tracing.h"
10 #include "src/heap/heap.h" 10 #include "src/heap/heap.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 V(Oddball) \ 53 V(Oddball) \
54 V(Code) \ 54 V(Code) \
55 V(Map) \ 55 V(Map) \
56 V(Cell) \ 56 V(Cell) \
57 V(PropertyCell) \ 57 V(PropertyCell) \
58 V(WeakCell) \ 58 V(WeakCell) \
59 V(TransitionArray) \ 59 V(TransitionArray) \
60 V(SharedFunctionInfo) \ 60 V(SharedFunctionInfo) \
61 V(JSFunction) \ 61 V(JSFunction) \
62 V(JSWeakCollection) \ 62 V(JSWeakCollection) \
63 V(JSWeakRef) \
63 V(JSArrayBuffer) \ 64 V(JSArrayBuffer) \
64 V(JSRegExp) 65 V(JSRegExp)
65 66
66 // For data objects, JS objects and structs along with generic visitor which 67 // For data objects, JS objects and structs along with generic visitor which
67 // can visit object of any size we provide visitors specialized by 68 // can visit object of any size we provide visitors specialized by
68 // object size in words. 69 // object size in words.
69 // Ids of specialized visitors are declared in a linear order (without 70 // Ids of specialized visitors are declared in a linear order (without
70 // holes) starting from the id of visitor specialized for 2 words objects 71 // holes) starting from the id of visitor specialized for 2 words objects
71 // (base visitor id) and ending with the id of generic visitor. 72 // (base visitor id) and ending with the id of generic visitor.
72 // Method GetVisitorIdForSize depends on this ordering to calculate visitor 73 // Method GetVisitorIdForSize depends on this ordering to calculate visitor
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {} 281 INLINE(static void VisitRuntimeEntry(RelocInfo* rinfo)) {}
281 // Skip the weak next code link in a code object. 282 // Skip the weak next code link in a code object.
282 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {} 283 INLINE(static void VisitNextCodeLink(Heap* heap, Object** slot)) {}
283 284
284 protected: 285 protected:
285 INLINE(static void VisitMap(Map* map, HeapObject* object)); 286 INLINE(static void VisitMap(Map* map, HeapObject* object));
286 INLINE(static void VisitCode(Map* map, HeapObject* object)); 287 INLINE(static void VisitCode(Map* map, HeapObject* object));
287 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object)); 288 INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object));
288 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); 289 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object));
289 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); 290 INLINE(static void VisitWeakCollection(Map* map, HeapObject* object));
291 INLINE(static void VisitWeakRef(Map* map, HeapObject* object));
290 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); 292 INLINE(static void VisitJSFunction(Map* map, HeapObject* object));
291 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); 293 INLINE(static void VisitNativeContext(Map* map, HeapObject* object));
292 294
293 // Mark pointers in a Map treating some elements of the descriptor array weak. 295 // Mark pointers in a Map treating some elements of the descriptor array weak.
294 static void MarkMapContents(Heap* heap, Map* map); 296 static void MarkMapContents(Heap* heap, Map* map);
295 297
296 // Code flushing support. 298 // Code flushing support.
297 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); 299 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function));
298 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); 300 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info));
299 301
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // the next element. Given the head of the list, this function removes dead 359 // the next element. Given the head of the list, this function removes dead
358 // elements from the list and if requested records slots for next-element 360 // elements from the list and if requested records slots for next-element
359 // pointers. The template parameter T is a WeakListVisitor that defines how to 361 // pointers. The template parameter T is a WeakListVisitor that defines how to
360 // access the next-element pointers. 362 // access the next-element pointers.
361 template <class T> 363 template <class T>
362 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer); 364 Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer);
363 } // namespace internal 365 } // namespace internal
364 } // namespace v8 366 } // namespace v8
365 367
366 #endif // V8_OBJECTS_VISITING_H_ 368 #endif // V8_OBJECTS_VISITING_H_
OLDNEW
« no previous file with comments | « src/heap/object-stats.cc ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698