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

Unified Diff: src/profiler/profile-generator.cc

Issue 1474353002: Remove easy to remove calls to Isolate::Current() from api.cc (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update Created 5 years, 1 month 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/profiler/profile-generator.cc
diff --git a/src/profiler/profile-generator.cc b/src/profiler/profile-generator.cc
index d964add5f20e4e3985f9c2281b95b8bf5eaf6d50..8d2d614adf8b34bb0e896fc0b33b602cf11d26f9 100644
--- a/src/profiler/profile-generator.cc
+++ b/src/profiler/profile-generator.cc
@@ -249,10 +249,11 @@ class DeleteNodesCallback {
};
-ProfileTree::ProfileTree()
+ProfileTree::ProfileTree(Isolate* isolate)
: root_entry_(Logger::FUNCTION_TAG, "(root)"),
next_node_id_(1),
root_(new ProfileNode(this, &root_entry_)),
+ isolate_(isolate),
next_function_id_(1),
function_ids_(ProfileNode::CodeEntriesMatch) {}
@@ -347,11 +348,11 @@ void ProfileTree::TraverseDepthFirst(Callback* callback) {
}
-CpuProfile::CpuProfile(const char* title, bool record_samples)
+CpuProfile::CpuProfile(Isolate* isolate, const char* title, bool record_samples)
: title_(title),
record_samples_(record_samples),
- start_time_(base::TimeTicks::HighResolutionNow()) {
-}
+ start_time_(base::TimeTicks::HighResolutionNow()),
+ top_down_(isolate) {}
void CpuProfile::AddPath(base::TimeTicks timestamp,
@@ -440,8 +441,8 @@ void CodeMap::Print() {
CpuProfilesCollection::CpuProfilesCollection(Heap* heap)
: function_and_resource_names_(heap),
- current_profiles_semaphore_(1) {
-}
+ isolate_(heap->isolate()),
+ current_profiles_semaphore_(1) {}
static void DeleteCodeEntry(CodeEntry** entry_ptr) {
@@ -476,7 +477,7 @@ bool CpuProfilesCollection::StartProfiling(const char* title,
return true;
}
}
- current_profiles_.Add(new CpuProfile(title, record_samples));
+ current_profiles_.Add(new CpuProfile(isolate_, title, record_samples));
current_profiles_semaphore_.Signal();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698