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

Unified Diff: src/runtime-profiler.h

Issue 8700008: New approach to Crankshaft decision-making (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix function self-optimization; address first comment Created 9 years 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/runtime-profiler.h
diff --git a/src/runtime-profiler.h b/src/runtime-profiler.h
index 15c209713e93b42aa34ed24539865092afbe66d4..4aebee6e7484cbf0f1c529720fe9dbf26e3e4743 100644
--- a/src/runtime-profiler.h
+++ b/src/runtime-profiler.h
@@ -58,8 +58,13 @@ class RuntimeProfiler {
void Reset();
void TearDown();
- Object** SamplerWindowAddress();
- int SamplerWindowSize();
+ void NotifyICChanged() {
+ any_ic_changed_ = true;
+ }
+ void NotifyCodeGenerated(int generated_code_size) {
+ code_generated_ = true;
+ total_code_generated_ += generated_code_size;
+ }
// Rate limiting support.
@@ -88,16 +93,10 @@ class RuntimeProfiler {
// turned off.
static void StopRuntimeProfilerThreadBeforeShutdown(Thread* thread);
- void UpdateSamplesAfterScavenge();
- void RemoveDeadSamples();
- void UpdateSamplesAfterCompact(ObjectVisitor* visitor);
-
private:
- static const int kSamplerWindowSize = 16;
-
static void HandleWakeUp(Isolate* isolate);
- void Optimize(JSFunction* function);
+ void Optimize(JSFunction* function, int reason);
void AttemptOnStackReplacement(JSFunction* function);
@@ -105,19 +104,11 @@ class RuntimeProfiler {
void ClearSampleBufferNewSpaceEntries();
- int LookupSample(JSFunction* function);
-
- void AddSample(JSFunction* function, int weight);
-
Isolate* isolate_;
- int sampler_threshold_;
- int sampler_threshold_size_factor_;
- int sampler_ticks_until_threshold_adjustment_;
-
- Object* sampler_window_[kSamplerWindowSize];
- int sampler_window_position_;
- int sampler_window_weight_[kSamplerWindowSize];
+ bool any_ic_changed_;
+ bool code_generated_;
+ int total_code_generated_;
// Possible state values:
// -1 => the profiler thread is waiting on the semaphore

Powered by Google App Engine
This is Rietveld 408576698