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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 | 1012 |
1013 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 1013 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
1014 CompilationInfo* info, | 1014 CompilationInfo* info, |
1015 Handle<SharedFunctionInfo> shared) { | 1015 Handle<SharedFunctionInfo> shared) { |
1016 // SharedFunctionInfo is passed separately, because if CompilationInfo | 1016 // SharedFunctionInfo is passed separately, because if CompilationInfo |
1017 // was created using Script object, it will not have it. | 1017 // was created using Script object, it will not have it. |
1018 | 1018 |
1019 // Log the code generation. If source information is available include | 1019 // Log the code generation. If source information is available include |
1020 // script name and line number. Check explicitly whether logging is | 1020 // script name and line number. Check explicitly whether logging is |
1021 // enabled as finding the line number is not free. | 1021 // enabled as finding the line number is not free. |
1022 if (info->isolate()->logger()->is_logging() || | 1022 if (info->isolate()->logger()->is_logging_code_events() || |
1023 CpuProfiler::is_profiling(info->isolate())) { | 1023 CpuProfiler::is_profiling(info->isolate())) { |
1024 Handle<Script> script = info->script(); | 1024 Handle<Script> script = info->script(); |
1025 Handle<Code> code = info->code(); | 1025 Handle<Code> code = info->code(); |
1026 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) | 1026 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) |
1027 return; | 1027 return; |
1028 if (script->name()->IsString()) { | 1028 if (script->name()->IsString()) { |
1029 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; | 1029 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; |
1030 USE(line_num); | 1030 USE(line_num); |
1031 PROFILE(info->isolate(), | 1031 PROFILE(info->isolate(), |
1032 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 1032 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
(...skipping 10 matching lines...) Expand all Loading... |
1043 } | 1043 } |
1044 } | 1044 } |
1045 | 1045 |
1046 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1046 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
1047 Handle<Script>(info->script()), | 1047 Handle<Script>(info->script()), |
1048 Handle<Code>(info->code()), | 1048 Handle<Code>(info->code()), |
1049 info)); | 1049 info)); |
1050 } | 1050 } |
1051 | 1051 |
1052 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
OLD | NEW |