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

Side by Side Diff: src/cpu-profiler.cc

Issue 17642009: CPUProfiler: propagate scriptId to the front-end (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: completely reworked Created 7 years, 5 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
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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, 250 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
251 Code* code, 251 Code* code,
252 SharedFunctionInfo* shared, 252 SharedFunctionInfo* shared,
253 CompilationInfo* info, 253 CompilationInfo* info,
254 Name* name) { 254 Name* name) {
255 if (FilterOutCodeCreateEvent(tag)) return; 255 if (FilterOutCodeCreateEvent(tag)) return;
256 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); 256 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
257 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 257 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
258 rec->start = code->address(); 258 rec->start = code->address();
259 rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name)); 259 rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name));
260 rec->entry->set_no_frame_ranges(info ? 260 if (info) {
261 info->ReleaseNoFrameRanges() : 261 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
262 NULL); 262 }
263 ASSERT(Script::cast(shared->script()));
264 Script* script = Script::cast(shared->script());
265 rec->entry->set_script_id(script->id()->value());
263 rec->size = code->ExecutableSize(); 266 rec->size = code->ExecutableSize();
264 rec->shared = shared->address(); 267 rec->shared = shared->address();
265 processor_->Enqueue(evt_rec); 268 processor_->Enqueue(evt_rec);
266 } 269 }
267 270
268 271
269 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, 272 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
270 Code* code, 273 Code* code,
271 SharedFunctionInfo* shared, 274 SharedFunctionInfo* shared,
272 CompilationInfo* info, 275 CompilationInfo* info,
273 String* source, int line) { 276 String* source, int line) {
274 if (FilterOutCodeCreateEvent(tag)) return; 277 if (FilterOutCodeCreateEvent(tag)) return;
275 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); 278 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
276 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 279 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
277 rec->start = code->address(); 280 rec->start = code->address();
278 rec->entry = profiles_->NewCodeEntry( 281 rec->entry = profiles_->NewCodeEntry(
279 tag, 282 tag,
280 profiles_->GetFunctionName(shared->DebugName()), 283 profiles_->GetFunctionName(shared->DebugName()),
281 TokenEnumerator::kNoSecurityToken, 284 TokenEnumerator::kNoSecurityToken,
282 CodeEntry::kEmptyNamePrefix, 285 CodeEntry::kEmptyNamePrefix,
283 profiles_->GetName(source), 286 profiles_->GetName(source),
284 line); 287 line);
285 rec->entry->set_no_frame_ranges(info ? 288 if (info) {
286 info->ReleaseNoFrameRanges() : 289 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
287 NULL); 290 }
291 ASSERT(Script::cast(shared->script()));
292 Script* script = Script::cast(shared->script());
293 rec->entry->set_script_id(script->id()->value());
288 rec->size = code->ExecutableSize(); 294 rec->size = code->ExecutableSize();
289 rec->shared = shared->address(); 295 rec->shared = shared->address();
290 processor_->Enqueue(evt_rec); 296 processor_->Enqueue(evt_rec);
291 } 297 }
292 298
293 299
294 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, 300 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
295 Code* code, 301 Code* code,
296 int args_count) { 302 int args_count) {
297 if (FilterOutCodeCreateEvent(tag)) return; 303 if (FilterOutCodeCreateEvent(tag)) return;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 processor_->Join(); 507 processor_->Join();
502 delete processor_; 508 delete processor_;
503 delete generator_; 509 delete generator_;
504 processor_ = NULL; 510 processor_ = NULL;
505 generator_ = NULL; 511 generator_ = NULL;
506 logger->logging_nesting_ = saved_logging_nesting_; 512 logger->logging_nesting_ = saved_logging_nesting_;
507 } 513 }
508 514
509 515
510 } } // namespace v8::internal 516 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.h » ('j') | test/cctest/test-profile-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698