From 97482a43bfba56fe2034c75651e765fc64dcdde5 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Mon, 15 Jun 2009 16:33:28 +0000 Subject: [PATCH] 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. Review URL: http://codereview.chromium.org/125126 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/codegen.cc | 4 ++-- src/compiler.cc | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/codegen.cc b/src/codegen.cc index cb3b24f74..e359c348a 100644 --- a/src/codegen.cc +++ b/src/codegen.cc @@ -306,8 +306,8 @@ Handle CodeGenerator::BuildBoilerplate(FunctionLiteral* node) { #ifdef ENABLE_OPROFILE_AGENT OProfileAgent::CreateNativeCodeRegion(*node->name(), - code->address(), - code->ExecutableSize()); + code->instruction_start(), + code->instruction_size()); #endif } diff --git a/src/compiler.cc b/src/compiler.cc index 483a5244d..73d200226 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -181,13 +181,15 @@ static Handle MakeFunction(bool is_global, 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 @@ bool Compiler::CompileLazy(Handle shared, 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 -- 2.34.1