Reviewers: Søren Gjesse,

Description:
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.

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

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


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index  
73d200226e3c6bb349c79ff2482070f2a299a6d5..8ab126accf32b5024d12aa819bc7f90d203cd70b
  
100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -380,10 +380,7 @@ bool Compiler::CompileLazy(Handle<SharedFunctionInfo>  
shared,
      Handle<String> 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,
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index  
9fbea14dbe33e5e007fe8e95c1d066ee5df2883b..66ada269dd2c896258086fd9dd2a594842c9aa9a
  
100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1026,10 +1026,9 @@ void Logger::LogCompiledFunctions() {
          Handle<String> 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,



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

Reply via email to