Chromium Code Reviews| Index: runtime/vm/profiler.h |
| diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h |
| index 03d632efc7c5498fe6552e05f7329dee2f5ef7f2..a963427a6761cf19a8e90dc86518134222a41c6b 100644 |
| --- a/runtime/vm/profiler.h |
| +++ b/runtime/vm/profiler.h |
| @@ -159,9 +159,7 @@ class Sample { |
| } |
| vm_tag_ = VMTag::kInvalidTagId; |
| user_tag_ = UserTags::kDefaultUserTag; |
| - sp_ = 0; |
| lr_ = 0; |
|
rmacnak
2015/06/22 22:23:19
metadata = 0
Cutch
2015/06/23 13:47:13
Done.
|
| - fp_ = 0; |
| state_ = 0; |
| uword* pcs = GetPCArray(); |
| for (intptr_t i = 0; i < pcs_length_; i++) { |
| @@ -218,22 +216,6 @@ class Sample { |
| pc_marker_ = pc_marker; |
| } |
| - uword sp() const { |
| - return sp_; |
| - } |
| - |
| - void set_sp(uword sp) { |
| - sp_ = sp; |
| - } |
| - |
| - uword fp() const { |
| - return fp_; |
| - } |
| - |
| - void set_fp(uword fp) { |
| - fp_ = fp; |
| - } |
| - |
| uword lr() const { |
| return lr_; |
| } |
| @@ -306,6 +288,23 @@ class Sample { |
| state_ = TruncatedTraceBit::update(truncated_trace, state_); |
| } |
| + bool is_allocation_sample() const { |
| + return ClassAllocationSampleBit::decode(state_); |
| + } |
| + |
| + void set_is_allocation_sample(bool allocation_sample) { |
| + state_ = ClassAllocationSampleBit::update(allocation_sample, state_); |
| + } |
| + |
| + intptr_t allocation_cid() const { |
| + ASSERT(is_allocation_sample()); |
| + return metadata_; |
| + } |
| + |
| + void set_metadata(intptr_t metadata) { |
| + metadata_ = metadata; |
| + } |
| + |
| static void InitOnce(); |
| static intptr_t instance_size() { |
| @@ -329,6 +328,7 @@ class Sample { |
| kExitFrameBit = 3, |
| kMissingFrameInsertedBit = 4, |
| kTruncatedTrace = 5, |
| + kClassAllocationSample = 6, |
| }; |
| class ProcessedBit : public BitField<bool, kProcessedBit, 1> {}; |
| class LeafFrameIsDart : public BitField<bool, kLeafFrameIsDartBit, 1> {}; |
| @@ -337,6 +337,8 @@ class Sample { |
| class MissingFrameInsertedBit |
| : public BitField<bool, kMissingFrameInsertedBit, 1> {}; |
| class TruncatedTraceBit : public BitField<bool, kTruncatedTrace, 1> {}; |
| + class ClassAllocationSampleBit |
| + : public BitField<bool, kClassAllocationSample, 1> {}; |
| int64_t timestamp_; |
| ThreadId tid_; |
| @@ -345,8 +347,7 @@ class Sample { |
| uword stack_buffer_[kStackBufferSizeInWords]; |
| uword vm_tag_; |
| uword user_tag_; |
| - uword sp_; |
| - uword fp_; |
| + uword metadata_; |
| uword lr_; |
| uword state_; |