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

Unified Diff: src/runtime-profiler.h

Issue 6580038: [Isolates] Merge from bleeding_edge, revisions 5934-6100. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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/runtime.js ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.h
===================================================================
--- src/runtime-profiler.h (revision 6904)
+++ src/runtime-profiler.h (working copy)
@@ -40,6 +40,13 @@
class PendingListNode;
class Semaphore;
+
+enum SamplerState {
+ IN_NON_JS_STATE = 0,
+ IN_JS_STATE = 1
+};
+
+
class RuntimeProfiler {
public:
explicit RuntimeProfiler(Isolate* isolate);
@@ -89,6 +96,7 @@
private:
static const int kSamplerWindowSize = 16;
+ static const int kStateWindowSize = 128;
static void HandleWakeUp(Isolate* isolate);
@@ -104,11 +112,19 @@
void AddSample(JSFunction* function, int weight);
+#ifdef ENABLE_LOGGING_AND_PROFILING
+ void UpdateStateRatio(SamplerState current_state);
+#endif
+
Isolate* isolate_;
int sampler_threshold_;
int sampler_threshold_size_factor_;
+ int sampler_ticks_until_threshold_adjustment_;
+ // The ratio of ticks spent in JS code in percent.
+ Atomic32 js_ratio_;
+
// The JSFunctions in the sampler window are not GC safe. Old-space
// pointers are not cleared during mark-sweep collection and therefore
// the window might contain stale pointers. The window is updated on
@@ -121,6 +137,10 @@
// Support for pending 'optimize soon' requests.
PendingListNode* optimize_soon_list_;
+ SamplerState state_window_[kStateWindowSize];
+ int state_window_position_;
+ int state_counts_[2];
+
// Possible state values:
// -1 => the profiler thread is waiting on the semaphore
// 0 or positive => the number of isolates running JavaScript code.
« no previous file with comments | « src/runtime.js ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698