OLD | NEW |
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" |
(...skipping 19 matching lines...) Expand all Loading... |
30 ~ThreadRegistry(); | 30 ~ThreadRegistry(); |
31 | 31 |
32 void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames); | 32 void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames); |
33 void PrepareForGC(); | 33 void PrepareForGC(); |
34 Thread* mutator_thread() const { return mutator_thread_; } | 34 Thread* mutator_thread() const { return mutator_thread_; } |
35 | 35 |
36 #ifndef PRODUCT | 36 #ifndef PRODUCT |
37 void PrintJSON(JSONStream* stream) const; | 37 void PrintJSON(JSONStream* stream) const; |
38 #endif | 38 #endif |
39 | 39 |
40 // Calculates the sum of the max memory usage in bytes of each thread. | |
41 intptr_t ThreadHighWatermarksTotalLocked() const; | |
42 | |
43 private: | 40 private: |
44 Thread* active_list() const { return active_list_; } | 41 Thread* active_list() const { return active_list_; } |
45 Monitor* threads_lock() const { return threads_lock_; } | 42 Monitor* threads_lock() const { return threads_lock_; } |
46 | 43 |
47 Thread* GetFreeThreadLocked(Isolate* isolate, bool is_mutator); | 44 Thread* GetFreeThreadLocked(Isolate* isolate, bool is_mutator); |
48 void ReturnThreadLocked(bool is_mutator, Thread* thread); | 45 void ReturnThreadLocked(bool is_mutator, Thread* thread); |
49 void AddToActiveListLocked(Thread* thread); | 46 void AddToActiveListLocked(Thread* thread); |
50 void RemoveFromActiveListLocked(Thread* thread); | 47 void RemoveFromActiveListLocked(Thread* thread); |
51 Thread* GetFromFreelistLocked(Isolate* isolate); | 48 Thread* GetFromFreelistLocked(Isolate* isolate); |
52 void ReturnToFreelistLocked(Thread* thread); | 49 void ReturnToFreelistLocked(Thread* thread); |
(...skipping 20 matching lines...) Expand all Loading... |
73 Thread* mutator_thread_; | 70 Thread* mutator_thread_; |
74 | 71 |
75 friend class Isolate; | 72 friend class Isolate; |
76 friend class SafepointHandler; | 73 friend class SafepointHandler; |
77 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); | 74 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); |
78 }; | 75 }; |
79 | 76 |
80 } // namespace dart | 77 } // namespace dart |
81 | 78 |
82 #endif // RUNTIME_VM_THREAD_REGISTRY_H_ | 79 #endif // RUNTIME_VM_THREAD_REGISTRY_H_ |
OLD | NEW |