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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index 270da8fc9774ec88484d4ec1c19260baaef9985b..be64dd77ac93c041e919799b901aaf2709cb1556 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -255,9 +255,14 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = code->address();
rec->entry = profiles_->NewCodeEntry(tag, profiles_->GetFunctionName(name));
- rec->entry->set_no_frame_ranges(info ?
- info->ReleaseNoFrameRanges() :
- NULL);
+ if (info) {
+ rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
+ }
+ if (shared->script()->IsScript()) {
+ ASSERT(Script::cast(shared->script()));
+ Script* script = Script::cast(shared->script());
+ rec->entry->set_script_id(script->id()->value());
+ }
rec->size = code->ExecutableSize();
rec->shared = shared->address();
processor_->Enqueue(evt_rec);
@@ -280,9 +285,12 @@ void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
CodeEntry::kEmptyNamePrefix,
profiles_->GetName(source),
line);
- rec->entry->set_no_frame_ranges(info ?
- info->ReleaseNoFrameRanges() :
- NULL);
+ if (info) {
+ rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
+ }
+ ASSERT(Script::cast(shared->script()));
+ Script* script = Script::cast(shared->script());
+ rec->entry->set_script_id(script->id()->value());
rec->size = code->ExecutableSize();
rec->shared = shared->address();
processor_->Enqueue(evt_rec);
« 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