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

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: debug build was fixed 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
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, 248 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
249 Code* code, 249 Code* code,
250 SharedFunctionInfo* shared, 250 SharedFunctionInfo* shared,
251 CompilationInfo* info, 251 CompilationInfo* info,
252 Name* name) { 252 Name* name) {
253 if (FilterOutCodeCreateEvent(tag)) return; 253 if (FilterOutCodeCreateEvent(tag)) return;
254 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); 254 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
255 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 255 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
256 rec->start = code->address(); 256 rec->start = code->address();
257 rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name)); 257 rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name));
258 rec->entry->set_no_frame_ranges(info ? 258 if (info) {
259 info->ReleaseNoFrameRanges() : 259 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
260 NULL); 260 }
261 if (shared->script()->IsScript()) {
262 ASSERT(Script::cast(shared->script()));
263 Script* script = Script::cast(shared->script());
264 rec->entry->set_script_id(script->id()->value());
265 }
261 rec->size = code->ExecutableSize(); 266 rec->size = code->ExecutableSize();
262 rec->shared = shared->address(); 267 rec->shared = shared->address();
263 processor_->Enqueue(evt_rec); 268 processor_->Enqueue(evt_rec);
264 } 269 }
265 270
266 271
267 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, 272 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
268 Code* code, 273 Code* code,
269 SharedFunctionInfo* shared, 274 SharedFunctionInfo* shared,
270 CompilationInfo* info, 275 CompilationInfo* info,
271 String* source, int line) { 276 String* source, int line) {
272 if (FilterOutCodeCreateEvent(tag)) return; 277 if (FilterOutCodeCreateEvent(tag)) return;
273 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); 278 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION);
274 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 279 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
275 rec->start = code->address(); 280 rec->start = code->address();
276 rec->entry = profiles_->NewCodeEntry( 281 rec->entry = profiles_->NewCodeEntry(
277 tag, 282 tag,
278 profiles_->GetFunctionName(shared->DebugName()), 283 profiles_->GetFunctionName(shared->DebugName()),
279 TokenEnumerator::kNoSecurityToken, 284 TokenEnumerator::kNoSecurityToken,
280 CodeEntry::kEmptyNamePrefix, 285 CodeEntry::kEmptyNamePrefix,
281 profiles_->GetName(source), 286 profiles_->GetName(source),
282 line); 287 line);
283 rec->entry->set_no_frame_ranges(info ? 288 if (info) {
284 info->ReleaseNoFrameRanges() : 289 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
285 NULL); 290 }
291 ASSERT(Script::cast(shared->script()));
292 Script* script = Script::cast(shared->script());
293 rec->entry->set_script_id(script->id()->value());
286 rec->size = code->ExecutableSize(); 294 rec->size = code->ExecutableSize();
287 rec->shared = shared->address(); 295 rec->shared = shared->address();
288 processor_->Enqueue(evt_rec); 296 processor_->Enqueue(evt_rec);
289 } 297 }
290 298
291 299
292 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, 300 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
293 Code* code, 301 Code* code,
294 int args_count) { 302 int args_count) {
295 if (FilterOutCodeCreateEvent(tag)) return; 303 if (FilterOutCodeCreateEvent(tag)) return;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; 523 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_;
516 Builtins::Name id = static_cast<Builtins::Name>(i); 524 Builtins::Name id = static_cast<Builtins::Name>(i);
517 rec->start = builtins->builtin(id)->address(); 525 rec->start = builtins->builtin(id)->address();
518 rec->builtin_id = id; 526 rec->builtin_id = id;
519 processor_->Enqueue(evt_rec); 527 processor_->Enqueue(evt_rec);
520 } 528 }
521 } 529 }
522 530
523 531
524 } } // namespace v8::internal 532 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698