Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: src/log.cc

Issue 131102: Eliminate double offsetting of line numbers in profiler. (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 Handle<SharedFunctionInfo> shared = sfis[i]; 1019 Handle<SharedFunctionInfo> shared = sfis[i];
1020 Handle<String> name(String::cast(shared->name())); 1020 Handle<String> name(String::cast(shared->name()));
1021 Handle<String> func_name(name->length() > 0 ? 1021 Handle<String> func_name(name->length() > 0 ?
1022 *name : shared->inferred_name()); 1022 *name : shared->inferred_name());
1023 if (shared->script()->IsScript()) { 1023 if (shared->script()->IsScript()) {
1024 Handle<Script> script(Script::cast(shared->script())); 1024 Handle<Script> script(Script::cast(shared->script()));
1025 if (script->name()->IsString()) { 1025 if (script->name()->IsString()) {
1026 Handle<String> script_name(String::cast(script->name())); 1026 Handle<String> script_name(String::cast(script->name()));
1027 int line_num = GetScriptLineNumber(script, shared->start_position()); 1027 int line_num = GetScriptLineNumber(script, shared->start_position());
1028 if (line_num > 0) { 1028 if (line_num > 0) {
1029 line_num += script->line_offset()->value() + 1;
1030 LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG, 1029 LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG,
1031 shared->code(), *func_name, 1030 shared->code(), *func_name,
1032 *script_name, line_num)); 1031 *script_name, line_num + 1));
1033 } else { 1032 } else {
1034 // Can't distinguish enum and script here, so always use Script. 1033 // Can't distinguish enum and script here, so always use Script.
1035 LOG(CodeCreateEvent(Logger::SCRIPT_TAG, 1034 LOG(CodeCreateEvent(Logger::SCRIPT_TAG,
1036 shared->code(), *script_name)); 1035 shared->code(), *script_name));
1037 } 1036 }
1038 continue; 1037 continue;
1039 } 1038 }
1040 } 1039 }
1041 // If no script or script has no name. 1040 // If no script or script has no name.
1042 LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG, shared->code(), *func_name)); 1041 LOG(CodeCreateEvent(Logger::LAZY_COMPILE_TAG, shared->code(), *func_name));
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 } else if (previous_->state_ == EXTERNAL) { 1270 } else if (previous_->state_ == EXTERNAL) {
1272 // We are leaving V8. 1271 // We are leaving V8.
1273 Heap::Protect(); 1272 Heap::Protect();
1274 } 1273 }
1275 } 1274 }
1276 #endif 1275 #endif
1277 } 1276 }
1278 #endif 1277 #endif
1279 1278
1280 } } // namespace v8::internal 1279 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698