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

Side by Side Diff: runtime/vm/thread_registry.h

Issue 2554983002: Created methods to surface zone memory information for each isolate and thread in JSON. (Closed)
Patch Set: Created methods to surface zone memory information for each isolate and thread in JSON. Created 4 years 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 | « runtime/vm/thread.cc ('k') | runtime/vm/thread_registry.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 (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_THREAD_REGISTRY_H_ 5 #ifndef RUNTIME_VM_THREAD_REGISTRY_H_
6 #define RUNTIME_VM_THREAD_REGISTRY_H_ 6 #define RUNTIME_VM_THREAD_REGISTRY_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
11 #include "vm/lockers.h" 11 #include "vm/lockers.h"
12 #include "vm/stack_frame.h" 12 #include "vm/stack_frame.h"
13 #include "vm/thread.h" 13 #include "vm/thread.h"
14 14
15 namespace dart { 15 namespace dart {
16 16
17 #ifndef PRODUCT
18 class JSONStream;
19 class JSONArray;
20 #endif
21
17 // Unordered collection of threads relating to a particular isolate. 22 // Unordered collection of threads relating to a particular isolate.
18 class ThreadRegistry { 23 class ThreadRegistry {
19 public: 24 public:
20 ThreadRegistry() 25 ThreadRegistry()
21 : threads_lock_(new Monitor()), 26 : threads_lock_(new Monitor()),
22 active_list_(NULL), 27 active_list_(NULL),
23 free_list_(NULL), 28 free_list_(NULL),
24 mutator_thread_(NULL) {} 29 mutator_thread_(NULL) {}
25 ~ThreadRegistry(); 30 ~ThreadRegistry();
26 31
27 void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames); 32 void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames);
28 void PrepareForGC(); 33 void PrepareForGC();
29 Thread* mutator_thread() const { return mutator_thread_; } 34 Thread* mutator_thread() const { return mutator_thread_; }
30 35
36 #ifndef PRODUCT
37 void PrintJSON(JSONStream* stream) const;
38 #endif
39
31 private: 40 private:
32 Thread* active_list() const { return active_list_; } 41 Thread* active_list() const { return active_list_; }
33 Monitor* threads_lock() const { return threads_lock_; } 42 Monitor* threads_lock() const { return threads_lock_; }
34 43
35 Thread* GetFreeThreadLocked(Isolate* isolate, bool is_mutator); 44 Thread* GetFreeThreadLocked(Isolate* isolate, bool is_mutator);
36 void ReturnThreadLocked(bool is_mutator, Thread* thread); 45 void ReturnThreadLocked(bool is_mutator, Thread* thread);
37 void AddToActiveListLocked(Thread* thread); 46 void AddToActiveListLocked(Thread* thread);
38 void RemoveFromActiveListLocked(Thread* thread); 47 void RemoveFromActiveListLocked(Thread* thread);
39 Thread* GetFromFreelistLocked(Isolate* isolate); 48 Thread* GetFromFreelistLocked(Isolate* isolate);
40 void ReturnToFreelistLocked(Thread* thread); 49 void ReturnToFreelistLocked(Thread* thread);
(...skipping 20 matching lines...) Expand all
61 Thread* mutator_thread_; 70 Thread* mutator_thread_;
62 71
63 friend class Isolate; 72 friend class Isolate;
64 friend class SafepointHandler; 73 friend class SafepointHandler;
65 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); 74 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry);
66 }; 75 };
67 76
68 } // namespace dart 77 } // namespace dart
69 78
70 #endif // RUNTIME_VM_THREAD_REGISTRY_H_ 79 #endif // RUNTIME_VM_THREAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/thread.cc ('k') | runtime/vm/thread_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698