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

Side by Side Diff: Source/platform/heap/Visitor.h

Issue 1159773004: Oilpan: Implement a GC to take a heap snapshot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/heap/ThreadState.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // 321 //
322 // Pointers within objects are traced by calling the |trace| methods 322 // Pointers within objects are traced by calling the |trace| methods
323 // with the object as an argument. Tracing objects will mark all of the 323 // with the object as an argument. Tracing objects will mark all of the
324 // contained pointers and push them on the marking stack. 324 // contained pointers and push them on the marking stack.
325 class PLATFORM_EXPORT Visitor : public VisitorHelper<Visitor> { 325 class PLATFORM_EXPORT Visitor : public VisitorHelper<Visitor> {
326 public: 326 public:
327 friend class VisitorHelper<Visitor>; 327 friend class VisitorHelper<Visitor>;
328 friend class InlinedGlobalMarkingVisitor; 328 friend class InlinedGlobalMarkingVisitor;
329 329
330 enum MarkingMode { 330 enum MarkingMode {
331 // This is a default visitor. This is used for GCType=GCWithSweep
332 // and GCType=GCWithoutSweep.
331 GlobalMarking, 333 GlobalMarking,
334 // This visitor does not trace objects outside the heap of the
335 // GCing thread. This is used for GCType=ThreadTerminationGC.
332 ThreadLocalMarking, 336 ThreadLocalMarking,
337 // This visitor just marks objects and ignores weak processing.
338 // This is used for GCType=TakeSnapshot.
339 SnapshotMarking,
340 // This visitor is used to trace objects during weak processing.
341 // This visitor is allowed to trace only already marked objects.
333 WeakProcessing, 342 WeakProcessing,
334 }; 343 };
335 344
336 virtual ~Visitor() { } 345 virtual ~Visitor() { }
337 346
338 using VisitorHelper<Visitor>::mark; 347 using VisitorHelper<Visitor>::mark;
339 348
340 // This method marks an object and adds it to the set of objects 349 // This method marks an object and adds it to the set of objects
341 // that should have their trace method called. Since not all 350 // that should have their trace method called. Since not all
342 // objects have vtables we have to have the callback as an 351 // objects have vtables we have to have the callback as an
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 { 431 {
423 DEFINE_STATIC_LOCAL(String, typenameString, (WTF::extractTypeNameFromFun ctionName(WTF::extractNameFunction<T>()))); 432 DEFINE_STATIC_LOCAL(String, typenameString, (WTF::extractTypeNameFromFun ctionName(WTF::extractNameFunction<T>())));
424 return typenameString; 433 return typenameString;
425 } 434 }
426 }; 435 };
427 #endif 436 #endif
428 437
429 } // namespace blink 438 } // namespace blink
430 439
431 #endif // Visitor_h 440 #endif // Visitor_h
OLDNEW
« no previous file with comments | « Source/platform/heap/ThreadState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698