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

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: completely reworked 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
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index bdb4ec427ed8df5236c940f3a24d97f7aba999ea..1974c86167ae5a799f80b833de41e7631ae55cf4 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -257,9 +257,12 @@ 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());
+ }
+ 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);
@@ -282,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') | test/cctest/test-profile-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698