Chromium Code Reviews

Unified Diff: src/log.cc

Issue 16035027: DevTools: CPUProfiler: provide url for scripts that have sourceURL property. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: dinamicaly compiled code also covered Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 610a63b37a271e4aec95d4c2a572a72a9e63b4d4..656b308324a4c9d33930143d4ac176d764888379 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1728,10 +1728,18 @@ void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared,
Handle<String> func_name(shared->DebugName());
if (shared->script()->IsScript()) {
Handle<Script> script(Script::cast(shared->script()));
+ Handle<String> script_name;
if (script->name()->IsString()) {
- Handle<String> script_name(String::cast(script->name()));
+ script_name = Handle<String>(String::cast(script->name()));
+ } else {
+ Handle<Object> name = GetScriptNameOrSourceURL(script);
+ if (!name.is_null() && name->IsString()) {
+ script_name = Handle<String>::cast(name);
+ }
+ }
+ if (!script_name.is_null()) {
int line_num = GetScriptLineNumber(script, shared->start_position());
- if (line_num > 0) {
+ if (line_num >= 0) {
yurys 2013/06/11 14:40:38 Can you change this to line_num != -1 ?
PROFILE(isolate_,
CodeCreateEvent(
Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
« src/compiler.cc ('K') | « src/handles.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine