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

Unified Diff: src/log.cc

Issue 39179: Adding support for reporting addresses of JIT compiled code to OProfile (Closed)
Patch Set: Fixes according to Kasper's comments 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') | src/objects.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 21167ddeda3eaa3e55d58d59d62c1f71b78cc155..34631cd52a35f7d8ab614510299fb2ba4f5c3a16 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -711,24 +711,13 @@ void Logger::DeleteEvent(const char* name, void* object) {
}
-#ifdef ENABLE_LOGGING_AND_PROFILING
-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;
-}
-#endif
-
-
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()),
- CodeObjectSize(code));
+ code->ExecutableSize());
for (const char* p = comment; *p != '\0'; p++) {
if (*p == '"') {
msg.Append('\\');
@@ -750,7 +739,7 @@ void Logger::CodeCreateEvent(const char* tag, Code* code, String* name) {
name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
msg.Append("code-creation,%s,0x%x,%d,\"%s\"\n", tag,
reinterpret_cast<unsigned int>(code->address()),
- CodeObjectSize(code), *str);
+ code->ExecutableSize(), *str);
msg.WriteToLogFile();
#endif
}
@@ -767,7 +756,7 @@ void Logger::CodeCreateEvent(const char* tag, Code* code, String* name,
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()),
- CodeObjectSize(code),
+ code->ExecutableSize(),
*str, *sourcestr, line);
msg.WriteToLogFile();
#endif
@@ -780,7 +769,7 @@ void Logger::CodeCreateEvent(const char* tag, Code* code, int args_count) {
LogMessageBuilder msg;
msg.Append("code-creation,%s,0x%x,%d,\"args_count: %d\"\n", tag,
reinterpret_cast<unsigned int>(code->address()),
- CodeObjectSize(code),
+ code->ExecutableSize(),
args_count);
msg.WriteToLogFile();
#endif
« no previous file with comments | « src/log.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698