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

Unified Diff: src/platform-linux.cc

Issue 8700008: New approach to Crankshaft decision-making (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix snapshot build and memory leaks 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
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index e72d095b0aded82a47a8e71a399544971336cc51..d5b03be441e4c0e00fcbc0688a903567503cee3a 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -1038,7 +1038,8 @@ class SignalSender : public Thread {
explicit SignalSender(int interval)
: Thread("SignalSender"),
vm_tgid_(getpid()),
- interval_(interval) {}
+ interval_(interval),
+ tick_count_(0) {}
static void InstallSignalHandler() {
struct sigaction sa;
@@ -1080,6 +1081,14 @@ class SignalSender : public Thread {
}
}
+ static void ResetInterval(int interval) {
+ ScopedLock lock(mutex_);
+ if (instance_ != NULL) {
+ instance_->interval_ = interval;
+ instance_->tick_count_ = 0;
+ }
+ }
+
// Implement Thread::Run().
virtual void Run() {
SamplerRegistry::State state;
@@ -1098,6 +1107,15 @@ class SignalSender : public Thread {
if (!cpu_profiling_enabled) {
if (rate_limiter_.SuspendIfNecessary()) continue;
}
+#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS)
+ // ARM and MIPS CPUs are typically slower than IA32/X64, so for them
+ // the tick interval is increased to let them perform a more significant
+ // amount of work between subsequent ticks.
+ if (tick_count_ == 5) {
danno 2011/12/07 13:21:52 Constants for these?
Jakob Kummerow 2011/12/12 10:02:38 Done.
+ interval_ = 5;
+ }
+ tick_count_++;
+#endif
if (cpu_profiling_enabled && runtime_profiler_enabled) {
if (!SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this)) {
return;
@@ -1165,7 +1183,8 @@ class SignalSender : public Thread {
}
const int vm_tgid_;
- const int interval_;
+ int interval_;
+ int tick_count_;
RuntimeProfilerRateLimiter rate_limiter_;
// Protects the process wide state below.
@@ -1213,5 +1232,9 @@ void Sampler::Stop() {
SetActive(false);
}
+void Sampler::ResetInterval(int interval) {
+ SignalSender::ResetInterval(interval);
+}
+
} } // namespace v8::internal
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698