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

Unified Diff: src/sampler.h

Issue 148503002: A64: Synchronize with r15545. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/runtime-profiler.cc ('k') | src/sampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sampler.h
diff --git a/src/sampler.h b/src/sampler.h
index 1d9ac8723bf0487ab6cd37ac4dc2af7b4d3c41c7..a47a3635dda99bddc5646f02da561cc8a2d44d1c 100644
--- a/src/sampler.h
+++ b/src/sampler.h
@@ -29,6 +29,7 @@
#define V8_SAMPLER_H_
#include "atomicops.h"
+#include "frames.h"
#include "v8globals.h"
namespace v8 {
@@ -43,21 +44,25 @@ class Isolate;
// (if used for profiling) the program counter and stack pointer for
// the thread that created it.
+struct RegisterState {
+ RegisterState() : pc(NULL), sp(NULL), fp(NULL) {}
+ Address pc; // Instruction pointer.
+ Address sp; // Stack pointer.
+ Address fp; // Frame pointer.
+};
+
// TickSample captures the information collected for each sample.
struct TickSample {
TickSample()
: state(OTHER),
pc(NULL),
- sp(NULL),
- fp(NULL),
external_callback(NULL),
frames_count(0),
- has_external_callback(false) {}
- void Trace(Isolate* isolate);
+ has_external_callback(false),
+ top_frame_type(StackFrame::NONE) {}
+ void Init(Isolate* isolate, const RegisterState& state);
StateTag state; // The state of the VM.
Address pc; // Instruction pointer.
- Address sp; // Stack pointer.
- Address fp; // Frame pointer.
union {
Address tos; // Top stack value (*sp).
Address external_callback;
@@ -66,6 +71,7 @@ struct TickSample {
Address stack[kMaxFramesCount]; // Call stack.
int frames_count : 8; // Number of captured frames.
bool has_external_callback : 1;
+ StackFrame::Type top_frame_type : 4;
};
class Sampler {
@@ -82,11 +88,7 @@ class Sampler {
int interval() const { return interval_; }
// Performs stack sampling.
- void SampleStack(TickSample* sample);
-
- // This method is called for each sampling period with the current
- // program counter.
- virtual void Tick(TickSample* sample) = 0;
+ void SampleStack(const RegisterState& regs);
// Start and stop sampler.
void Start();
@@ -107,6 +109,11 @@ class Sampler {
class PlatformData;
PlatformData* platform_data() const { return data_; }
+ protected:
+ // This method is called for each sampling period with the current
+ // program counter.
+ virtual void Tick(TickSample* sample) = 0;
+
private:
void SetActive(bool value) { NoBarrier_Store(&active_, value); }
« no previous file with comments | « src/runtime-profiler.cc ('k') | src/sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698