Chromium Code Reviews| Index: runtime/vm/profiler.cc |
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
| index f41a017276cb8eaf37bc46dfa69f6201606ab5d1..a80809cb43754027b476c64ea464ac6b8f7bb65f 100644 |
| --- a/runtime/vm/profiler.cc |
| +++ b/runtime/vm/profiler.cc |
| @@ -874,15 +874,13 @@ Sample* SampleBuffer::ReserveSample() { |
| // |
| class ProfilerSampleStackWalker : public ValueObject { |
| public: |
| - ProfilerSampleStackWalker(Heap* heap, |
| - Sample* sample, |
| + ProfilerSampleStackWalker(Sample* sample, |
| uword stack_lower, |
| uword stack_upper, |
| uword pc, |
| uword fp, |
| uword sp) |
| - : heap_(heap), |
| - sample_(sample), |
| + : sample_(sample), |
| stack_upper_(stack_upper), |
| original_pc_(pc), |
| original_fp_(fp), |
| @@ -891,6 +889,12 @@ class ProfilerSampleStackWalker : public ValueObject { |
| ASSERT(sample_ != NULL); |
| } |
| +#if defined(DEBUG_STACK_WALK) |
|
siva
2014/02/27 18:30:48
I missed this in the last round, normally we don't
|
| + void set_heap(Heap* heap) { |
| + heap_ = heap; |
| + } |
| +#endif |
| + |
| int walk() { |
| const intptr_t kMaxStep = 0x1000; // 4K. |
| const bool kWalkStack = true; // Walk the stack. |
| @@ -980,7 +984,9 @@ class ProfilerSampleStackWalker : public ValueObject { |
| return r; |
| } |
| +#if defined(DEBUG_STACK_WALK) |
| Heap* heap_; |
| +#endif |
| Sample* sample_; |
| const uword stack_upper_; |
| const uword original_pc_; |
| @@ -1013,9 +1019,11 @@ void Profiler::RecordSampleInterruptCallback( |
| stack_lower = 0; |
| stack_upper = 0; |
| } |
| - ProfilerSampleStackWalker stackWalker(isolate->heap(), sample, stack_lower, |
| - stack_upper, state.pc, state.fp, |
| - state.sp); |
| + ProfilerSampleStackWalker stackWalker(sample, stack_lower, stack_upper, |
| + state.pc, state.fp, state.sp); |
| +#if defined(DEBUG_STACK_WALK) |
| + stackWalker.set_heap(isolate->heap()); |
| +#endif |
| stackWalker.walk(); |
| } |