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

Unified Diff: src/compiler.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: debugger context Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/cpu-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 7b0b92152931dc3da1e9036cc585b631de054c5c..5de9d960c79e9c96cdc3959f4d6a6a9e859283cf 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1181,7 +1181,16 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
Handle<Code> code = info->code();
if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile))
return;
+ Handle<String> script_name;
if (script->name()->IsString()) {
+ 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()) + 1;
USE(line_num);
PROFILE(info->isolate(),
@@ -1189,7 +1198,7 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
*code,
*shared,
info,
- String::cast(script->name()),
+ String::cast(*script_name),
line_num));
} else {
PROFILE(info->isolate(),
« no previous file with comments | « src/api.cc ('k') | src/cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698