Reviewers: Søren Gjesse,

Description:
Report code stubs to OProfile.

Patch from Dineel D Sule <[email protected]>.
Original issue: http://codereview.chromium.org/600019

[email protected]

Please review this at http://codereview.chromium.org/593038

Affected files:
  M AUTHORS
  M src/code-stubs.cc


Index: AUTHORS
diff --git a/AUTHORS b/AUTHORS
index 9128ba3e743dcc5c541944c3f21e72f884792689..8b0db5c37699de3fe9d07aba13dc9244290b0c25 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,3 +23,4 @@ Rene Rebe <[email protected]>
 Ryan Dahl <[email protected]>
 Patrick Gansterer <[email protected]>
 Subrato K De <[email protected]>
+Dineel D Sule <[email protected]>
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 95f0760aec097c88aca4eae18e704c37d1c07f44..a65a1604fc7acb2c277b05caa69e17ec5b44a972 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -31,6 +31,7 @@
 #include "code-stubs.h"
 #include "factory.h"
 #include "macro-assembler.h"
+#include "oprofile-agent.h"

 namespace v8 {
 namespace internal {
@@ -63,6 +64,13 @@ void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) {
   // Add unresolved entries in the code to the fixup list.
   Bootstrapper::AddFixup(code, masm);

+#ifdef ENABLE_OPROFILE_AGENT
+  // Register the generated stub with the OPROFILE agent.
+  OProfileAgent::CreateNativeCodeRegion(GetName(),
+                                        code->instruction_start(),
+                                        code->instruction_size());
+#endif
+
   LOG(CodeCreateEvent(Logger::STUB_TAG, code, GetName()));
   Counters::total_stubs_code_size.Increment(code->instruction_size());



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to