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

Unified Diff: src/isolate.h

Issue 59373003: AllocationProfiler: introduce allocation_profiler flag in V8 api. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 9aa14ee02594edec2bc7f0935374d922043fbed7..a18cb05cfcb6b79fb8139345c06fbc656b43fdbe 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -1132,6 +1132,19 @@ class Isolate {
function_entry_hook_ = function_entry_hook;
}
+ bool enable_allocation_profiler() {
+ ASSERT(!IsInitialized() || !initialized_from_snapshot());
+ // Fallback for release version.
+ if (IsInitialized() && initialized_from_snapshot())
+ return false;
+ allocation_profiler_ = true;
+ return true;
+ }
+
+ bool is_allocation_profiler_enabled() const {
+ return allocation_profiler_ || FLAG_enable_allocation_profiler;
+ }
+
void* stress_deopt_count_address() { return &stress_deopt_count_; }
inline RandomNumberGenerator* random_number_generator();
@@ -1373,6 +1386,7 @@ class Isolate {
// Counts deopt points if deopt_every_n_times is enabled.
unsigned int stress_deopt_count_;
+ bool allocation_profiler_;
friend class ExecutionAccess;
friend class HandleScopeImplementer;

Powered by Google App Engine
This is Rietveld 408576698