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

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

Issue 1203493004: [tracing] Adding class-wise memory statistics to blink gc memory dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Disabling the classes dump, avoid double counting, and comments. 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
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 24 matching lines...) Expand all
35 #include "platform/heap/GarbageCollected.h" 35 #include "platform/heap/GarbageCollected.h"
36 #include "platform/heap/StackFrameDepth.h" 36 #include "platform/heap/StackFrameDepth.h"
37 #include "platform/heap/ThreadState.h" 37 #include "platform/heap/ThreadState.h"
38 #include "wtf/Assertions.h" 38 #include "wtf/Assertions.h"
39 #include "wtf/Atomics.h" 39 #include "wtf/Atomics.h"
40 #include "wtf/Deque.h" 40 #include "wtf/Deque.h"
41 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
42 #include "wtf/HashMap.h" 42 #include "wtf/HashMap.h"
43 #include "wtf/HashTraits.h" 43 #include "wtf/HashTraits.h"
44 #include "wtf/TypeTraits.h" 44 #include "wtf/TypeTraits.h"
45 #if ENABLE(GC_PROFILING)
46 #include "wtf/InstanceCounter.h" 45 #include "wtf/InstanceCounter.h"
47 #include "wtf/text/WTFString.h" 46 #include "wtf/text/WTFString.h"
48 #endif
49 47
50 namespace blink { 48 namespace blink {
51 49
52 template<typename T> class GarbageCollected; 50 template<typename T> class GarbageCollected;
53 class HeapObjectHeader; 51 class HeapObjectHeader;
54 class InlinedGlobalMarkingVisitor; 52 class InlinedGlobalMarkingVisitor;
55 template<typename T> class TraceTrait; 53 template<typename T> class TraceTrait;
56 template<typename T> class TraceEagerlyTrait; 54 template<typename T> class TraceEagerlyTrait;
57 class Visitor; 55 class Visitor;
58 56
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 387
390 virtual void registerWeakTable(const void*, EphemeronCallback, EphemeronCall back) = 0; 388 virtual void registerWeakTable(const void*, EphemeronCallback, EphemeronCall back) = 0;
391 #if ENABLE(ASSERT) 389 #if ENABLE(ASSERT)
392 virtual bool weakTableRegistered(const void*) = 0; 390 virtual bool weakTableRegistered(const void*) = 0;
393 #endif 391 #endif
394 392
395 virtual bool ensureMarked(const void*) = 0; 393 virtual bool ensureMarked(const void*) = 0;
396 394
397 inline MarkingMode markingMode() const { return m_markingMode; } 395 inline MarkingMode markingMode() const { return m_markingMode; }
398 396
397 void setHostInfo(void* object, const String& name)
haraken 2015/06/27 07:27:40 Why do we need this?
398 {
399 m_hostObject = object;
400 m_hostName = name;
401 }
402
403 inline bool isGlobalMarkingVisitor() const { return m_isGlobalMarkingVisitor ; }
haraken 2015/06/27 07:27:40 Why do we need this?
404
399 protected: 405 protected:
400 explicit Visitor(MarkingMode markingMode) 406 explicit Visitor(MarkingMode markingMode)
401 : m_markingMode(markingMode) 407 : m_markingMode(markingMode)
402 { } 408 { }
403 409
404 virtual void registerWeakCellWithCallback(void**, WeakCallback) = 0; 410 virtual void registerWeakCellWithCallback(void**, WeakCallback) = 0;
405 411
412 void* m_hostObject;
413 String m_hostName;
414
406 private: 415 private:
407 static Visitor* fromHelper(VisitorHelper<Visitor>* helper) { return static_c ast<Visitor*>(helper); } 416 static Visitor* fromHelper(VisitorHelper<Visitor>* helper) { return static_c ast<Visitor*>(helper); }
408 417
409 const MarkingMode m_markingMode; 418 const MarkingMode m_markingMode;
410 bool m_isGlobalMarkingVisitor; 419 bool m_isGlobalMarkingVisitor;
411 }; 420 };
412 421
413 #if ENABLE(GC_PROFILING)
414 template<typename T> 422 template<typename T>
415 struct TypenameStringTrait { 423 struct TypenameStringTrait {
416 static const String& get() 424 static const String& get()
417 { 425 {
418 DEFINE_STATIC_LOCAL(String, typenameString, (WTF::extractTypeNameFromFun ctionName(WTF::extractNameFunction<T>()))); 426 DEFINE_STATIC_LOCAL(String, typenameString, (WTF::extractTypeNameFromFun ctionName(WTF::extractNameFunction<T>())));
419 return typenameString; 427 return typenameString;
420 } 428 }
421 }; 429 };
422 #endif
423 430
424 } // namespace blink 431 } // namespace blink
425 432
426 #endif // Visitor_h 433 #endif // Visitor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698