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

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

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.h
diff --git a/src/profiler/profile-generator.h b/src/profiler/profile-generator.h
index 079413a8cd59c184aff8636e177f3630d264f8f1..47a73f191a13ce8db0142c26bf9305f50e7b2c1b 100644
--- a/src/profiler/profile-generator.h
+++ b/src/profiler/profile-generator.h
@@ -156,6 +156,7 @@ class ProfileNode {
const std::vector<CpuProfileDeoptInfo>& deopt_infos() const {
return deopt_infos_;
}
+ Isolate* isolate() const;
void Print(int indent);
@@ -186,7 +187,7 @@ class ProfileNode {
class ProfileTree {
public:
- ProfileTree();
+ explicit ProfileTree(Isolate* isolate);
~ProfileTree();
ProfileNode* AddPathFromEnd(
@@ -200,6 +201,8 @@ class ProfileTree {
root_->Print(0);
}
+ Isolate* isolate() const { return isolate_; }
+
private:
template <typename Callback>
void TraverseDepthFirst(Callback* callback);
@@ -207,6 +210,7 @@ class ProfileTree {
CodeEntry root_entry_;
unsigned next_node_id_;
ProfileNode* root_;
+ Isolate* isolate_;
unsigned next_function_id_;
HashMap function_ids_;
@@ -217,7 +221,7 @@ class ProfileTree {
class CpuProfile {
public:
- CpuProfile(const char* title, bool record_samples);
+ CpuProfile(Isolate* isolate, const char* title, bool record_samples);
// Add pc -> ... -> main() call path to the profile.
void AddPath(base::TimeTicks timestamp, const Vector<CodeEntry*>& path,
@@ -339,6 +343,8 @@ class CpuProfilesCollection {
List<CodeEntry*> code_entries_;
List<CpuProfile*> finished_profiles_;
+ Isolate* isolate_;
+
// Accessed by VM thread and profile generator thread.
List<CpuProfile*> current_profiles_;
base::Semaphore current_profiles_semaphore_;

Powered by Google App Engine
This is Rietveld 408576698