| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 // Log the code generation. If source information is available include | 1198 // Log the code generation. If source information is available include |
| 1199 // script name and line number. Check explicitly whether logging is | 1199 // script name and line number. Check explicitly whether logging is |
| 1200 // enabled as finding the line number is not free. | 1200 // enabled as finding the line number is not free. |
| 1201 if (info->isolate()->logger()->is_logging_code_events() || | 1201 if (info->isolate()->logger()->is_logging_code_events() || |
| 1202 info->isolate()->cpu_profiler()->is_profiling()) { | 1202 info->isolate()->cpu_profiler()->is_profiling()) { |
| 1203 Handle<Script> script = info->script(); | 1203 Handle<Script> script = info->script(); |
| 1204 Handle<Code> code = info->code(); | 1204 Handle<Code> code = info->code(); |
| 1205 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) | 1205 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) |
| 1206 return; | 1206 return; |
| 1207 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; | 1207 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; |
| 1208 int column_num = |
| 1209 GetScriptColumnNumber(script, shared->start_position()) + 1; |
| 1208 USE(line_num); | 1210 USE(line_num); |
| 1209 if (script->name()->IsString()) { | 1211 if (script->name()->IsString()) { |
| 1210 PROFILE(info->isolate(), | 1212 PROFILE(info->isolate(), |
| 1211 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 1213 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
| 1212 *code, | 1214 *code, |
| 1213 *shared, | 1215 *shared, |
| 1214 info, | 1216 info, |
| 1215 String::cast(script->name()), | 1217 String::cast(script->name()), |
| 1216 line_num)); | 1218 line_num, |
| 1219 column_num)); |
| 1217 } else { | 1220 } else { |
| 1218 PROFILE(info->isolate(), | 1221 PROFILE(info->isolate(), |
| 1219 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 1222 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
| 1220 *code, | 1223 *code, |
| 1221 *shared, | 1224 *shared, |
| 1222 info, | 1225 info, |
| 1223 info->isolate()->heap()->empty_string(), | 1226 info->isolate()->heap()->empty_string(), |
| 1224 line_num)); | 1227 line_num, |
| 1228 column_num)); |
| 1225 } | 1229 } |
| 1226 } | 1230 } |
| 1227 | 1231 |
| 1228 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1232 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1229 Handle<Script>(info->script()), | 1233 Handle<Script>(info->script()), |
| 1230 Handle<Code>(info->code()), | 1234 Handle<Code>(info->code()), |
| 1231 info)); | 1235 info)); |
| 1232 } | 1236 } |
| 1233 | 1237 |
| 1234 | 1238 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1255 // Trace if the appropriate trace flag is set and the phase name's first | 1259 // Trace if the appropriate trace flag is set and the phase name's first |
| 1256 // character is in the FLAG_trace_phase command line parameter. | 1260 // character is in the FLAG_trace_phase command line parameter. |
| 1257 bool tracing_on = info()->IsStub() ? | 1261 bool tracing_on = info()->IsStub() ? |
| 1258 FLAG_trace_hydrogen_stubs : | 1262 FLAG_trace_hydrogen_stubs : |
| 1259 FLAG_trace_hydrogen; | 1263 FLAG_trace_hydrogen; |
| 1260 return (tracing_on && | 1264 return (tracing_on && |
| 1261 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1265 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1262 } | 1266 } |
| 1263 | 1267 |
| 1264 } } // namespace v8::internal | 1268 } } // namespace v8::internal |
| OLD | NEW |