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

Unified Diff: src/log.h

Issue 499483002: [WIP] A sampler thread in d8 for consuming the new API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months 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: src/log.h
diff --git a/src/log.h b/src/log.h
index 1b32fded6c980fbc6c6ecf14ea2f310e22950409..b5b694046b259b5e3ea966111d11ed36a9fc209a 100644
--- a/src/log.h
+++ b/src/log.h
@@ -7,6 +7,8 @@
#include <string>
+#include "include/v8-sampler.h"
+
#include "src/allocation.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/base/platform/platform.h"
@@ -149,6 +151,19 @@ class LowLevelLogger;
class PerfJitLogger;
class Sampler;
+class StubCodeEventHandler: public v8::CodeEventHandler {
+ public:
+ void Create(const void* from,
+ const int size,
+ const std::string& name) {}
+ void Delete(const void* from) {}
+ void Move(const void* from, const void* to) {}
+ void SharedLibrary(const std::string& library_path,
+ const void* start,
+ const void* end) {}
+};
+
+
class Logger {
public:
#define DECLARE_ENUM(enum_item, ignore) enum_item,
@@ -165,7 +180,10 @@ class Logger {
void SetCodeEventHandler(uint32_t options,
JitCodeEventHandler event_handler);
+ void SetCodeEventHandler(v8::CodeEventHandler* handler);
+
Sampler* sampler();
+ v8::CodeEventHandler* codeEventHandler();
// Frees resources acquired in SetUp.
// When a temporary file is used for the log, returns its stream descriptor,
@@ -435,6 +453,7 @@ class Logger {
LowLevelLogger* ll_logger_;
JitLogger* jit_logger_;
List<CodeEventListener*> listeners_;
+ CodeEventHandler* code_event_handler_;
// Guards against multiple calls to TearDown() that can happen in some tests.
// 'true' between SetUp() and TearDown().

Powered by Google App Engine
This is Rietveld 408576698