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

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: Rebase errors. 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 // Visit local thread stack and trace all pointers conservatively. 482 // Visit local thread stack and trace all pointers conservatively.
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 {
493 // Map from base-classes to a snapshot class-ids (used as index below).
494 using ClassTagMap = HashMap<const GCInfo*, size_t>;
haraken 2015/06/26 05:35:28 How about just using gcInfoIndex for the tag? gcIn
ssid 2015/06/26 10:10:28 Hm, I think it is better to store map of GcInfo* h
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
503 size_t getClassTag(const GCInfo*);
504 };
505
492 #if ENABLE(GC_PROFILING) 506 #if ENABLE(GC_PROFILING)
493 const GCInfo* findGCInfo(Address); 507 const GCInfo* findGCInfo(Address);
494 static const GCInfo* findGCInfoFromAllThreads(Address); 508 static const GCInfo* findGCInfoFromAllThreads(Address);
495 509
496 struct SnapshotInfo { 510 struct SnapshotInfo {
497 ThreadState* state; 511 ThreadState* state;
498 512
499 size_t freeSize; 513 size_t freeSize;
500 size_t pageCount; 514 size_t pageCount;
501 515
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 }; 794 };
781 795
782 template<> class ThreadStateFor<AnyThread> { 796 template<> class ThreadStateFor<AnyThread> {
783 public: 797 public:
784 static ThreadState* state() { return ThreadState::current(); } 798 static ThreadState* state() { return ThreadState::current(); }
785 }; 799 };
786 800
787 } // namespace blink 801 } // namespace blink
788 802
789 #endif // ThreadState_h 803 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698