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

Unified Diff: runtime/vm/profiler.h

Issue 151143003: Improve CodeRegionTable build time by 30x (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.h
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 1e7c52701b54003e91c3bb518bbc986a9ce0becb..b663b03fcc89dbb0e6ae1ac66fa7ce938cb720a7 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -41,21 +41,11 @@ class Profiler : public AllStatic {
return sample_buffer_;
}
+
siva 2014/02/12 00:58:52 We usually have only one blank line before 'privat
private:
static bool initialized_;
static Monitor* monitor_;
- static intptr_t ProcessSamples(Isolate* isolate,
- ProfilerCodeRegionTable* code_region_table,
- SampleBuffer* sample_buffer);
-
- static intptr_t ProcessSample(Isolate* isolate,
- ProfilerCodeRegionTable* code_region_table,
- Sample* sample);
-
- static void RecordTickInterruptCallback(const InterruptedThreadState& state,
- void* data);
-
static void RecordSampleInterruptCallback(const InterruptedThreadState& state,
void* data);
@@ -126,6 +116,33 @@ class Sample {
};
+class SampleVisitor {
+ public:
+ explicit SampleVisitor(Isolate* isolate);
+ virtual ~SampleVisitor() {}
+
+ virtual void VisitSample(Sample* sample) = 0;
+
+ intptr_t visited() const {
+ return visited_;
+ }
+
+ void IncrementVisited() {
+ visited_++;
+ }
+
+ Isolate* isolate() const {
+ return isolate_;
+ }
+
+ private:
+ Isolate* isolate_;
+ intptr_t visited_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SampleVisitor);
+};
+
+
// Ring buffer of samples.
class SampleBuffer {
public:
@@ -139,6 +156,8 @@ class SampleBuffer {
void CopySample(intptr_t i, Sample* sample) const;
Sample* At(intptr_t idx) const;
+ void VisitSamples(SampleVisitor* visitor);
+
private:
Sample* samples_;
intptr_t capacity_;
@@ -148,35 +167,6 @@ class SampleBuffer {
};
-class ProfilerSampleStackWalker : public ValueObject {
- public:
- ProfilerSampleStackWalker(Sample* sample,
- uintptr_t stack_lower,
- uintptr_t stack_upper,
- uintptr_t pc,
- uintptr_t fp,
- uintptr_t sp);
-
- int walk();
-
- private:
- uword* CallerPC(uword* fp);
- uword* CallerFP(uword* fp);
-
- bool ValidInstructionPointer(uword* pc);
-
- bool ValidFramePointer(uword* fp);
-
- Sample* sample_;
- const uintptr_t stack_lower_;
- const uintptr_t stack_upper_;
- const uintptr_t original_pc_;
- const uintptr_t original_fp_;
- const uintptr_t original_sp_;
- uintptr_t lower_bound_;
-};
-
-
} // namespace dart
#endif // VM_PROFILER_H_
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698