| 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 VM_CODE_OBSERVERS_H_ | 5 #ifndef VM_CODE_OBSERVERS_H_ | 
| 6 #define VM_CODE_OBSERVERS_H_ | 6 #define VM_CODE_OBSERVERS_H_ | 
| 7 | 7 | 
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" | 
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" | 
| 10 | 10 | 
| 11 namespace dart { | 11 namespace dart { | 
| 12 | 12 | 
|  | 13 class Mutex; | 
|  | 14 | 
| 13 // Object observing code creation events. Used by external profilers and | 15 // Object observing code creation events. Used by external profilers and | 
| 14 // debuggers to map address ranges to function names. | 16 // debuggers to map address ranges to function names. | 
| 15 class CodeObserver { | 17 class CodeObserver { | 
| 16  public: | 18  public: | 
| 17   CodeObserver() { } | 19   CodeObserver() { } | 
| 18 | 20 | 
| 19   virtual ~CodeObserver() { } | 21   virtual ~CodeObserver() { } | 
| 20 | 22 | 
| 21   // Returns true if this observer is active and should be notified | 23   // Returns true if this observer is active and should be notified | 
| 22   // about newly created code objects. | 24   // about newly created code objects. | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 46                         uword base, | 48                         uword base, | 
| 47                         uword prologue_offset, | 49                         uword prologue_offset, | 
| 48                         uword size, | 50                         uword size, | 
| 49                         bool optimized); | 51                         bool optimized); | 
| 50 | 52 | 
| 51   // Returns true if there is at least one active code observer. | 53   // Returns true if there is at least one active code observer. | 
| 52   static bool AreActive(); | 54   static bool AreActive(); | 
| 53 | 55 | 
| 54   static void DeleteAll(); | 56   static void DeleteAll(); | 
| 55 | 57 | 
|  | 58   static Mutex* mutex() { | 
|  | 59     return mutex_; | 
|  | 60   } | 
|  | 61 | 
| 56  private: | 62  private: | 
|  | 63   static Mutex* mutex_; | 
| 57   static intptr_t observers_length_; | 64   static intptr_t observers_length_; | 
| 58   static CodeObserver** observers_; | 65   static CodeObserver** observers_; | 
| 59 }; | 66 }; | 
| 60 | 67 | 
| 61 | 68 | 
| 62 }  // namespace dart | 69 }  // namespace dart | 
| 63 | 70 | 
| 64 #endif  // VM_CODE_OBSERVERS_H_ | 71 #endif  // VM_CODE_OBSERVERS_H_ | 
| OLD | NEW | 
|---|