Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index c6b911feecc8e0d48972e9a57fd046daf84e1421..e8781c7b30bb629aeb0f386803926a7b959744a6 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); |
|
vsevik
2013/06/11 14:26:01
Can you just do GetScriptNameOrSourceURL here?
Wha
|
| + 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(), |