Commit 97482a43 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

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
parent 667176d9
......@@ -306,8 +306,8 @@ Handle<JSFunction> CodeGenerator::BuildBoilerplate(FunctionLiteral* node) {
#ifdef ENABLE_OPROFILE_AGENT
OProfileAgent::CreateNativeCodeRegion(*node->name(),
code->address(),
code->ExecutableSize());
code->instruction_start(),
code->instruction_size());
#endif
}
......
......@@ -181,13 +181,15 @@ static Handle<JSFunction> 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<SharedFunctionInfo> 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment