Version 3.18.4
Added a preliminary API for ES6 ArrayBuffers
Replaced qsort with std::sort. (Chromium issue 2639)
Performance and stability improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@14456 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/counters.cc b/src/counters.cc
index 7c8265e..fa192ba 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -45,57 +45,38 @@
}
-// Start the timer.
-void StatsCounterTimer::Start() {
- if (!counter_.Enabled())
- return;
- stop_time_ = 0;
- start_time_ = OS::Ticks();
-}
-
-// Stop the timer and record the results.
-void StatsCounterTimer::Stop() {
- if (!counter_.Enabled())
- return;
- stop_time_ = OS::Ticks();
-
- // Compute the delta between start and stop, in milliseconds.
- int milliseconds = static_cast<int>(stop_time_ - start_time_) / 1000;
- counter_.Increment(milliseconds);
-}
-
void Histogram::AddSample(int sample) {
if (Enabled()) {
- Isolate::Current()->stats_table()->AddHistogramSample(histogram_, sample);
+ isolate()->stats_table()->AddHistogramSample(histogram_, sample);
}
}
void* Histogram::CreateHistogram() const {
- return Isolate::Current()->stats_table()->
+ return isolate()->stats_table()->
CreateHistogram(name_, min_, max_, num_buckets_);
}
// Start the timer.
void HistogramTimer::Start() {
- if (histogram_.Enabled()) {
+ if (Enabled()) {
stop_time_ = 0;
start_time_ = OS::Ticks();
}
if (FLAG_log_internal_timer_events) {
- LOG(Isolate::Current(), TimerEvent(Logger::START, histogram_.name_));
+ LOG(isolate(), TimerEvent(Logger::START, name()));
}
}
// Stop the timer and record the results.
void HistogramTimer::Stop() {
- if (histogram_.Enabled()) {
+ if (Enabled()) {
stop_time_ = OS::Ticks();
// Compute the delta between start and stop, in milliseconds.
int milliseconds = static_cast<int>(stop_time_ - start_time_) / 1000;
- histogram_.AddSample(milliseconds);
+ AddSample(milliseconds);
}
if (FLAG_log_internal_timer_events) {
- LOG(Isolate::Current(), TimerEvent(Logger::END, histogram_.name_));
+ LOG(isolate(), TimerEvent(Logger::END, name()));
}
}