From 44936ad32d2c2c028296c36f5b4914f0379c3113 Mon Sep 17 00:00:00 2001 From: "mikhail.naganov@gmail.com" Date: Mon, 22 Jun 2009 07:22:09 +0000 Subject: [PATCH] Eliminate double offsetting of line numbers in profiler. I didn't noticed that in r1481 GetScriptLineNumber was changed to perform line numbers offsetting by itself. Review URL: http://codereview.chromium.org/131102 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler.cc | 5 +---- src/log.cc | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 73d200226..8ab126acc 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -380,10 +380,7 @@ bool Compiler::CompileLazy(Handle shared, Handle func_name(name->length() > 0 ? *name : shared->inferred_name()); if (script->name()->IsString()) { - int line_num = GetScriptLineNumber(script, start_position); - if (line_num > 0) { - line_num += script->line_offset()->value() + 1; - } + int line_num = GetScriptLineNumber(script, start_position) + 1; LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG, *code, *func_name, String::cast(script->name()), line_num)); OProfileAgent::CreateNativeCodeRegion(*func_name, diff --git a/src/log.cc b/src/log.cc index 9fbea14db..66ada269d 100644 --- a/src/log.cc +++ b/src/log.cc @@ -1026,10 +1026,9 @@ void Logger::LogCompiledFunctions() { Handle script_name(String::cast(script->name())); int line_num = GetScriptLineNumber(script, shared->start_position()); if (line_num > 0) { - line_num += script->line_offset()->value() + 1; LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG, shared->code(), *func_name, - *script_name, line_num)); + *script_name, line_num + 1)); } else { // Can't distinguish enum and script here, so always use Script. LOG(CodeCreateEvent(Logger::SCRIPT_TAG, -- 2.34.1