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

Unified Diff: runtime/vm/dart.h

Issue 11412106: Support VTune's JIT interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: introduce CodeObserver interface Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/dart.h
diff --git a/runtime/vm/dart.h b/runtime/vm/dart.h
index 585cdddf982a15b9212ca2381fc0dc8d96ec6159..6344f501faf4898f642c61ad4a3508c6fd83b621 100644
--- a/runtime/vm/dart.h
+++ b/runtime/vm/dart.h
@@ -16,6 +16,25 @@ class Isolate;
class RawError;
class ThreadPool;
+// Object observing code creation events. Used by external profilers and
+// debuggers to map address ranges to function names.
+class CodeObserver {
Ivan Posva 2012/11/27 09:11:20 I am not certain whether this belongs into this fi
Vyacheslav Egorov (Google) 2012/11/27 16:26:12 Moved all code observers related code to a separat
+ public:
+ virtual ~CodeObserver() { }
+
+ // Returns true if this observer is active and should be notified
+ // about newly created code objects.
+ virtual bool IsActive() const = 0;
+
+ // Notify code observer about newly created code object with the
Ivan Posva 2012/11/27 09:11:20 about a newly
Vyacheslav Egorov (Google) 2012/11/27 16:26:12 Done.
+ // given properties.
+ virtual void Notify(const char* name,
+ uword base,
+ uword prologue_offset,
+ uword size,
+ bool optimized) = 0;
+};
+
class Dart : public AllStatic {
public:
static const char* InitOnce(Dart_IsolateCreateCallback create,
@@ -48,12 +67,29 @@ class Dart : public AllStatic {
return flow_graph_writer_;
}
+ static void RegisterCodeObserver(CodeObserver* observer);
+
+ // Notify all active code observers about newly created code object.
+ static void NotifyCodeObservers(const char* name,
+ uword base,
+ uword prologue_offset,
+ uword size,
+ bool optimized);
+
+ // Returns true if there is at least one active code observer.
+ static bool AreCodeObserversActive();
+
private:
+ static void RegisterDefaultCodeObservers();
+
static Isolate* vm_isolate_;
static ThreadPool* thread_pool_;
static Dart_FileWriterFunction perf_events_writer_;
static DebugInfo* pprof_symbol_generator_;
static Dart_FileWriterFunction flow_graph_writer_;
+
+ static intptr_t code_observers_length_;
+ static CodeObserver** code_observers_;
};
} // namespace dart
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/dart.cc » ('j') | runtime/vm/dart.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698