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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 | 996 |
997 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 997 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
998 CompilationInfo* info, | 998 CompilationInfo* info, |
999 Handle<SharedFunctionInfo> shared) { | 999 Handle<SharedFunctionInfo> shared) { |
1000 // SharedFunctionInfo is passed separately, because if CompilationInfo | 1000 // SharedFunctionInfo is passed separately, because if CompilationInfo |
1001 // was created using Script object, it will not have it. | 1001 // was created using Script object, it will not have it. |
1002 | 1002 |
1003 // Log the code generation. If source information is available include | 1003 // Log the code generation. If source information is available include |
1004 // script name and line number. Check explicitly whether logging is | 1004 // script name and line number. Check explicitly whether logging is |
1005 // enabled as finding the line number is not free. | 1005 // enabled as finding the line number is not free. |
1006 if (info->isolate()->logger()->is_logging_code_events() || | 1006 if (info->isolate()->logger()->is_logging() || |
1007 CpuProfiler::is_profiling(info->isolate())) { | 1007 CpuProfiler::is_profiling(info->isolate())) { |
1008 Handle<Script> script = info->script(); | 1008 Handle<Script> script = info->script(); |
1009 Handle<Code> code = info->code(); | 1009 Handle<Code> code = info->code(); |
1010 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) | 1010 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) |
1011 return; | 1011 return; |
1012 if (script->name()->IsString()) { | 1012 if (script->name()->IsString()) { |
1013 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; | 1013 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; |
1014 USE(line_num); | 1014 USE(line_num); |
1015 PROFILE(info->isolate(), | 1015 PROFILE(info->isolate(), |
1016 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 1016 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
(...skipping 10 matching lines...) Expand all Loading... |
1027 } | 1027 } |
1028 } | 1028 } |
1029 | 1029 |
1030 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1030 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
1031 Handle<Script>(info->script()), | 1031 Handle<Script>(info->script()), |
1032 Handle<Code>(info->code()), | 1032 Handle<Code>(info->code()), |
1033 info)); | 1033 info)); |
1034 } | 1034 } |
1035 | 1035 |
1036 } } // namespace v8::internal | 1036 } } // namespace v8::internal |
OLD | NEW |