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

Unified Diff: src/log.cc

Issue 21410: Include all the code in code creation log events. The code object header size... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « src/log.h ('k') | tools/linux-tick-processor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
===================================================================
--- src/log.cc (revision 1294)
+++ src/log.cc (working copy)
@@ -679,13 +679,22 @@
}
+int Logger::CodeObjectSize(Code* code) {
+ // Check that the assumptions about the layout of the code object holds.
+ ASSERT_EQ(reinterpret_cast<unsigned int>(code->instruction_start()) -
+ reinterpret_cast<unsigned int>(code->address()),
+ Code::kHeaderSize);
+ return code->instruction_size() + Code::kHeaderSize;
+}
+
+
void Logger::CodeCreateEvent(const char* tag, Code* code, const char* comment) {
#ifdef ENABLE_LOGGING_AND_PROFILING
if (logfile_ == NULL || !FLAG_log_code) return;
LogMessageBuilder msg;
msg.Append("code-creation,%s,0x%x,%d,\"", tag,
reinterpret_cast<unsigned int>(code->address()),
- code->instruction_size());
+ CodeObjectSize(code));
for (const char* p = comment; *p != '\0'; p++) {
if (*p == '"') {
msg.Append('\\');
@@ -707,7 +716,7 @@
name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
msg.Append("code-creation,%s,0x%x,%d,\"%s\"\n", tag,
reinterpret_cast<unsigned int>(code->address()),
- code->instruction_size(), *str);
+ CodeObjectSize(code), *str);
msg.WriteToLogFile();
#endif
}
@@ -724,7 +733,8 @@
source->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
msg.Append("code-creation,%s,0x%x,%d,\"%s %s:%d\"\n", tag,
reinterpret_cast<unsigned int>(code->address()),
- code->instruction_size(), *str, *sourcestr, line);
+ CodeObjectSize(code),
+ *str, *sourcestr, line);
msg.WriteToLogFile();
#endif
}
@@ -736,7 +746,7 @@
LogMessageBuilder msg;
msg.Append("code-creation,%s,0x%x,%d,\"args_count: %d\"\n", tag,
reinterpret_cast<unsigned int>(code->address()),
- code->instruction_size(),
+ CodeObjectSize(code),
args_count);
msg.WriteToLogFile();
#endif
« no previous file with comments | « src/log.h ('k') | tools/linux-tick-processor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698