Reviewers: Michail Naganov,

Description:
Fix disassembly output from oprofile.

Only send the inscructions part of a code object to oprofile when
reporting dynamically generated code. Before the code object header was
also reported to oprofile as code which caused strange disassembly
output when using opannotate.

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

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/codegen.cc
   M     src/compiler.cc


Index: src/compiler.cc
===================================================================
--- src/compiler.cc     (revision 2171)
+++ src/compiler.cc     (working copy)
@@ -181,13 +181,15 @@
            String::cast(script->name())->ToCString(DISALLOW_NULLS);
        LOG(CodeCreateEvent(is_eval ? Logger::EVAL_TAG : Logger::SCRIPT_TAG,
                            *code, *data));
-      OProfileAgent::CreateNativeCodeRegion(*data, code->address(),
-                                            code->ExecutableSize());
+      OProfileAgent::CreateNativeCodeRegion(*data,
+                                            code->instruction_start(),
+                                            code->instruction_size());
      } else {
        LOG(CodeCreateEvent(is_eval ? Logger::EVAL_TAG : Logger::SCRIPT_TAG,
                            *code, ""));
        OProfileAgent::CreateNativeCodeRegion(is_eval ? "Eval" : "Script",
-          code->address(), code->ExecutableSize());
+                                            code->instruction_start(),
+                                            code->instruction_size());
      }
    }
  #endif
@@ -386,12 +388,14 @@
                            String::cast(script->name()), line_num));
        OProfileAgent::CreateNativeCodeRegion(*func_name,
                                              String::cast(script->name()),
-                                            line_num, code->address(),
-                                            code->ExecutableSize());
+                                            line_num,
+                                            code->instruction_start(),
+                                            code->instruction_size());
      } else {
        LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG, *code, *func_name));
-      OProfileAgent::CreateNativeCodeRegion(*func_name, code->address(),
-                                            code->ExecutableSize());
+      OProfileAgent::CreateNativeCodeRegion(*func_name,
+                                            code->instruction_start(),
+                                            code->instruction_size());
      }
    }
  #endif
Index: src/codegen.cc
===================================================================
--- src/codegen.cc      (revision 2171)
+++ src/codegen.cc      (working copy)
@@ -306,8 +306,8 @@

  #ifdef ENABLE_OPROFILE_AGENT
      OProfileAgent::CreateNativeCodeRegion(*node->name(),
-                                          code->address(),
-                                          code->ExecutableSize());
+                                          code->instruction_start(),
+                                          code->instruction_size());
  #endif
    }




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

Reply via email to