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

Side by Side Diff: src/compiler.cc

Issue 10795074: Add a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix instruction address calculation on move events. Fix test use of map, fix compilation on Win64. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698