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

Unified Diff: src/log.cc

Issue 27267: Experimental: periodic merge from the bleeding edge branch to the code... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 11 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/log.h ('k') | src/macro-assembler-arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
===================================================================
--- src/log.cc (revision 1380)
+++ src/log.cc (working copy)
@@ -134,6 +134,24 @@
//
+// StackTracer implementation
+//
+void StackTracer::Trace(TickSample* sample) {
+ // Assuming that stack grows from lower addresses
+ if (sample->state != GC
+ && (sample->sp < sample->fp && sample->fp < low_stack_bound_)) {
+ sample->InitStack(1);
+ sample->stack[0] = Memory::Address_at(
+ (Address)(sample->fp + StandardFrameConstants::kCallerPCOffset));
+ } else {
+ // GC runs or FP seems to be in some intermediate state,
+ // better discard this sample
+ sample->InitStack(0);
+ }
+}
+
+
+//
// Ticker used to provide ticks to the profiler and the sliding state
// window.
//
@@ -141,12 +159,12 @@
public:
explicit Ticker(int interval, unsigned int low_stack_bound):
Sampler(interval, FLAG_prof), window_(NULL), profiler_(NULL),
- low_stack_bound_(low_stack_bound) {}
+ stack_tracer_(low_stack_bound) {}
~Ticker() { if (IsActive()) Stop(); }
void Tick(TickSample* sample) {
- if (IsProfiling()) SampleStack(sample);
+ if (IsProfiling()) stack_tracer_.Trace(sample);
if (profiler_) profiler_->Insert(sample);
if (window_) window_->AddState(sample->state);
}
@@ -172,21 +190,9 @@
}
private:
- void SampleStack(TickSample* sample) {
- // Assuming that stack grows from lower addresses
- if (sample->sp < sample->fp && sample->fp < low_stack_bound_) {
- sample->InitStack(1);
- sample->stack[0] = Memory::Address_at(
- (Address)(sample->fp + StandardFrameConstants::kCallerPCOffset));
- } else {
- // FP seems to be in some intermediate state, better discard this sample
- sample->InitStack(0);
- }
- }
-
SlidingStateWindow* window_;
Profiler* profiler_;
- unsigned int low_stack_bound_;
+ StackTracer stack_tracer_;
};
« no previous file with comments | « src/log.h ('k') | src/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698