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

Side by Side Diff: src/compiler.cc

Issue 12706020: Isolatify CPU profiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 9 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/codegen.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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, 1127 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
1128 CompilationInfo* info, 1128 CompilationInfo* info,
1129 Handle<SharedFunctionInfo> shared) { 1129 Handle<SharedFunctionInfo> shared) {
1130 // SharedFunctionInfo is passed separately, because if CompilationInfo 1130 // SharedFunctionInfo is passed separately, because if CompilationInfo
1131 // was created using Script object, it will not have it. 1131 // was created using Script object, it will not have it.
1132 1132
1133 // Log the code generation. If source information is available include 1133 // Log the code generation. If source information is available include
1134 // script name and line number. Check explicitly whether logging is 1134 // script name and line number. Check explicitly whether logging is
1135 // enabled as finding the line number is not free. 1135 // enabled as finding the line number is not free.
1136 if (info->isolate()->logger()->is_logging_code_events() || 1136 if (info->isolate()->logger()->is_logging_code_events() ||
1137 CpuProfiler::is_profiling(info->isolate())) { 1137 info->isolate()->cpu_profiler()->is_profiling()) {
1138 Handle<Script> script = info->script(); 1138 Handle<Script> script = info->script();
1139 Handle<Code> code = info->code(); 1139 Handle<Code> code = info->code();
1140 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile)) 1140 if (*code == info->isolate()->builtins()->builtin(Builtins::kLazyCompile))
1141 return; 1141 return;
1142 if (script->name()->IsString()) { 1142 if (script->name()->IsString()) {
1143 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; 1143 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1;
1144 USE(line_num); 1144 USE(line_num);
1145 PROFILE(info->isolate(), 1145 PROFILE(info->isolate(),
1146 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), 1146 CodeCreateEvent(Logger::ToNativeByScript(tag, *script),
1147 *code, 1147 *code,
1148 *shared, 1148 *shared,
1149 String::cast(script->name()), 1149 String::cast(script->name()),
1150 line_num)); 1150 line_num));
1151 } else { 1151 } else {
1152 PROFILE(info->isolate(), 1152 PROFILE(info->isolate(),
1153 CodeCreateEvent(Logger::ToNativeByScript(tag, *script), 1153 CodeCreateEvent(Logger::ToNativeByScript(tag, *script),
1154 *code, 1154 *code,
1155 *shared, 1155 *shared,
1156 shared->DebugName())); 1156 shared->DebugName()));
1157 } 1157 }
1158 } 1158 }
1159 1159
1160 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 1160 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
1161 Handle<Script>(info->script()), 1161 Handle<Script>(info->script()),
1162 Handle<Code>(info->code()), 1162 Handle<Code>(info->code()),
1163 info)); 1163 info));
1164 } 1164 }
1165 1165
1166 } } // namespace v8::internal 1166 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698