OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_CODE_OBSERVERS_H_ | 5 #ifndef RUNTIME_VM_CODE_OBSERVERS_H_ |
6 #define RUNTIME_VM_CODE_OBSERVERS_H_ | 6 #define RUNTIME_VM_CODE_OBSERVERS_H_ |
7 | 7 |
| 8 #include "vm/allocation.h" |
8 #include "vm/globals.h" | 9 #include "vm/globals.h" |
9 #include "vm/allocation.h" | |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 #ifndef PRODUCT | 13 #ifndef PRODUCT |
14 | 14 |
15 class Mutex; | 15 class Mutex; |
16 | 16 |
17 // Object observing code creation events. Used by external profilers and | 17 // Object observing code creation events. Used by external profilers and |
18 // debuggers to map address ranges to function names. | 18 // debuggers to map address ranges to function names. |
19 class CodeObserver { | 19 class CodeObserver { |
(...skipping 11 matching lines...) Expand all Loading... |
31 virtual void Notify(const char* name, | 31 virtual void Notify(const char* name, |
32 uword base, | 32 uword base, |
33 uword prologue_offset, | 33 uword prologue_offset, |
34 uword size, | 34 uword size, |
35 bool optimized) = 0; | 35 bool optimized) = 0; |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(CodeObserver); | 38 DISALLOW_COPY_AND_ASSIGN(CodeObserver); |
39 }; | 39 }; |
40 | 40 |
41 | |
42 class CodeObservers : public AllStatic { | 41 class CodeObservers : public AllStatic { |
43 public: | 42 public: |
44 static void InitOnce(); | 43 static void InitOnce(); |
45 | 44 |
46 static void Register(CodeObserver* observer); | 45 static void Register(CodeObserver* observer); |
47 | 46 |
48 // Notify all active code observers about a newly created code object. | 47 // Notify all active code observers about a newly created code object. |
49 static void NotifyAll(const char* name, | 48 static void NotifyAll(const char* name, |
50 uword base, | 49 uword base, |
51 uword prologue_offset, | 50 uword prologue_offset, |
(...skipping 11 matching lines...) Expand all Loading... |
63 static Mutex* mutex_; | 62 static Mutex* mutex_; |
64 static intptr_t observers_length_; | 63 static intptr_t observers_length_; |
65 static CodeObserver** observers_; | 64 static CodeObserver** observers_; |
66 }; | 65 }; |
67 | 66 |
68 #endif // !PRODUCT | 67 #endif // !PRODUCT |
69 | 68 |
70 } // namespace dart | 69 } // namespace dart |
71 | 70 |
72 #endif // RUNTIME_VM_CODE_OBSERVERS_H_ | 71 #endif // RUNTIME_VM_CODE_OBSERVERS_H_ |
OLD | NEW |