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

Unified Diff: src/objects.h

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.cc ('k') | src/oprofile-agent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index b01f3301a2b5e9dc49c63ff2c699cb59c713dc62..c7d4808cf1ca0d039eaa4fbd61e4b5c20b3054ce 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2258,6 +2258,16 @@ class Code: public HeapObject {
return RoundUp(kHeaderSize + body_size + sinfo_size, kCodeAlignment);
}
+ // Calculate the size of the code object to report for log events. This takes
+ // the layout of the code object into account.
+ int ExecutableSize() {
+ // Check that the assumptions about the layout of the code object holds.
+ ASSERT_EQ(reinterpret_cast<unsigned int>(instruction_start()) -
+ reinterpret_cast<unsigned int>(address()),
+ Code::kHeaderSize);
+ return instruction_size() + Code::kHeaderSize;
+ }
+
// Locating source position.
int SourcePosition(Address pc);
int SourceStatementPosition(Address pc);
« no previous file with comments | « src/log.cc ('k') | src/oprofile-agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698