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

Unified Diff: src/log.cc

Issue 14888: Code regions (Closed)
Patch Set: Created 12 years 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
« src/log.h ('K') | « src/log.h ('k') | src/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 4fa398c8e2a6a45e17a4a61b68148365dfbba97a..bbea7006fbeadd549f922c8c661c33377411aa44 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -32,6 +32,7 @@
#include "log.h"
#include "platform.h"
#include "string-stream.h"
+#include "assembler.h"
namespace v8 { namespace internal {
@@ -556,6 +557,18 @@ void Logger::CodeCreateEvent(const char* tag, Code* code, int args_count) {
}
+void Logger::CodeAllocateEvent(Code* code, Assembler* assem) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+ if (logfile_ == NULL || !FLAG_log_code) return;
+ ScopedLock sl(mutex_);
+
+ fprintf(logfile_, "code-allocate,0x%x,0x%x\n",
+ reinterpret_cast<unsigned int>(code->address()),
+ reinterpret_cast<unsigned int>(assem));
+#endif
+}
+
+
void Logger::CodeMoveEvent(Address from, Address to) {
#ifdef ENABLE_LOGGING_AND_PROFILING
if (logfile_ == NULL || !FLAG_log_code) return;
@@ -576,6 +589,33 @@ void Logger::CodeDeleteEvent(Address from) {
}
+void Logger::BeginCodeRegionEvent(CodeRegion* region,
+ Assembler* masm,
+ const char* name) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+ if (logfile_ == NULL || !FLAG_log_code) return;
+ ScopedLock sl(mutex_);
+ fprintf(logfile_, "begin-code-region,0x%x,0x%x,0x%x,%s\n",
+ reinterpret_cast<unsigned int>(region),
+ reinterpret_cast<unsigned int>(masm),
+ masm->pc_offset(),
+ name);
+#endif
+}
+
+
+void Logger::EndCodeRegionEvent(CodeRegion* region, Assembler* masm) {
+#ifdef ENABLE_LOGGING_AND_PROFILING
+ if (logfile_ == NULL || !FLAG_log_code) return;
+ ScopedLock sl(mutex_);
+ fprintf(logfile_, "end-code-region,0x%x,0x%x,0x%x\n",
+ reinterpret_cast<unsigned int>(region),
+ reinterpret_cast<unsigned int>(masm),
+ masm->pc_offset());
+#endif
+}
+
+
void Logger::ResourceEvent(const char* name, const char* tag) {
#ifdef ENABLE_LOGGING_AND_PROFILING
if (logfile_ == NULL || !FLAG_log) return;
« src/log.h ('K') | « src/log.h ('k') | src/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698