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

Side by Side Diff: Source/platform/heap/ThreadState.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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 void visitStack(Visitor*); 483 void visitStack(Visitor*);
484 484
485 // Visit the asan fake stack frame corresponding to a slot on the 485 // Visit the asan fake stack frame corresponding to a slot on the
486 // real machine stack if there is one. 486 // real machine stack if there is one.
487 void visitAsanFakeStackForPointer(Visitor*, Address); 487 void visitAsanFakeStackForPointer(Visitor*, Address);
488 488
489 // Visit all persistents allocated on this thread. 489 // Visit all persistents allocated on this thread.
490 void visitPersistents(Visitor*); 490 void visitPersistents(Visitor*);
491 491
492 struct GCSnapshotInfo { 492 struct GCSnapshotInfo {
493 // Map from gcInfoIndex to a snapshot class-ids (used as index below).
haraken 2015/06/27 07:27:40 I'm wondering why you simply can't use gcInfoIndex
494 using ClassTagMap = HashMap<size_t, size_t>;
495 ClassTagMap classTags;
496
497 // Map from class-id (index) to count/size.
498 Vector<int> liveCount;
499 Vector<int> deadCount;
500 Vector<size_t> liveSize;
501 Vector<size_t> deadSize;
502
493 size_t currentHeapFreeSize; 503 size_t currentHeapFreeSize;
494 size_t currentHeapFreeCount; 504 size_t currentHeapFreeCount;
505
506 size_t getClassTag(const size_t GCInfoIndex);
495 }; 507 };
496 508
497 #if ENABLE(GC_PROFILING) 509 #if ENABLE(GC_PROFILING)
498 const GCInfo* findGCInfo(Address); 510 const GCInfo* findGCInfo(Address);
499 static const GCInfo* findGCInfoFromAllThreads(Address); 511 static const GCInfo* findGCInfoFromAllThreads(Address);
500 512
501 struct SnapshotInfo { 513 struct SnapshotInfo {
502 ThreadState* state; 514 ThreadState* state;
503 515
504 size_t freeSize; 516 size_t freeSize;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 static bool isVectorHeapIndex(int heapIndex) 654 static bool isVectorHeapIndex(int heapIndex)
643 { 655 {
644 return Vector1HeapIndex <= heapIndex && heapIndex <= Vector4HeapIndex; 656 return Vector1HeapIndex <= heapIndex && heapIndex <= Vector4HeapIndex;
645 } 657 }
646 void allocationPointAdjusted(int heapIndex); 658 void allocationPointAdjusted(int heapIndex);
647 void promptlyFreed(size_t gcInfoIndex); 659 void promptlyFreed(size_t gcInfoIndex);
648 660
649 private: 661 private:
650 enum SnapshotType { 662 enum SnapshotType {
651 HeapSnapshot, 663 HeapSnapshot,
652 FreelistSnapshot 664 FreelistSnapshot,
665 HeapSnapshotWithClasses
653 }; 666 };
654 667
655 ThreadState(); 668 ThreadState();
656 ~ThreadState(); 669 ~ThreadState();
657 670
658 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); 671 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope();
659 void clearSafePointScopeMarker() 672 void clearSafePointScopeMarker()
660 { 673 {
661 m_safePointStackCopy.clear(); 674 m_safePointStackCopy.clear();
662 m_safePointScopeMarker = nullptr; 675 m_safePointScopeMarker = nullptr;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 }; 798 };
786 799
787 template<> class ThreadStateFor<AnyThread> { 800 template<> class ThreadStateFor<AnyThread> {
788 public: 801 public:
789 static ThreadState* state() { return ThreadState::current(); } 802 static ThreadState* state() { return ThreadState::current(); }
790 }; 803 };
791 804
792 } // namespace blink 805 } // namespace blink
793 806
794 #endif // ThreadState_h 807 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698