| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_PROFILER_H_ | 5 #ifndef VM_PROFILER_H_ |
| 6 #define VM_PROFILER_H_ | 6 #define VM_PROFILER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/bitfield.h" | 9 #include "vm/bitfield.h" |
| 10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 bool shared_buffer = true); | 37 bool shared_buffer = true); |
| 38 static void ShutdownProfilingForIsolate(Isolate* isolate); | 38 static void ShutdownProfilingForIsolate(Isolate* isolate); |
| 39 | 39 |
| 40 static void BeginExecution(Isolate* isolate); | 40 static void BeginExecution(Isolate* isolate); |
| 41 static void EndExecution(Isolate* isolate); | 41 static void EndExecution(Isolate* isolate); |
| 42 | 42 |
| 43 static SampleBuffer* sample_buffer() { | 43 static SampleBuffer* sample_buffer() { |
| 44 return sample_buffer_; | 44 return sample_buffer_; |
| 45 } | 45 } |
| 46 | 46 |
| 47 static void RecordAllocation(Isolate* isolate, intptr_t cid); |
| 48 |
| 47 private: | 49 private: |
| 48 static bool initialized_; | 50 static bool initialized_; |
| 49 static Monitor* monitor_; | 51 static Monitor* monitor_; |
| 50 | 52 |
| 51 static void RecordSampleInterruptCallback(const InterruptedThreadState& state, | 53 static void RecordSampleInterruptCallback(const InterruptedThreadState& state, |
| 52 void* data); | 54 void* data); |
| 53 | 55 |
| 54 static SampleBuffer* sample_buffer_; | 56 static SampleBuffer* sample_buffer_; |
| 55 }; | 57 }; |
| 56 | 58 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 303 |
| 302 intptr_t allocation_cid() const { | 304 intptr_t allocation_cid() const { |
| 303 ASSERT(is_allocation_sample()); | 305 ASSERT(is_allocation_sample()); |
| 304 return metadata_; | 306 return metadata_; |
| 305 } | 307 } |
| 306 | 308 |
| 307 void set_metadata(intptr_t metadata) { | 309 void set_metadata(intptr_t metadata) { |
| 308 metadata_ = metadata; | 310 metadata_ = metadata; |
| 309 } | 311 } |
| 310 | 312 |
| 313 void SetAllocationCid(intptr_t cid) { |
| 314 set_is_allocation_sample(true); |
| 315 set_metadata(cid); |
| 316 } |
| 317 |
| 311 static void InitOnce(); | 318 static void InitOnce(); |
| 312 | 319 |
| 313 static intptr_t instance_size() { | 320 static intptr_t instance_size() { |
| 314 return instance_size_; | 321 return instance_size_; |
| 315 } | 322 } |
| 316 | 323 |
| 317 uword* GetPCArray() const; | 324 uword* GetPCArray() const; |
| 318 | 325 |
| 319 static const int kStackBufferSizeInWords = 2; | 326 static const int kStackBufferSizeInWords = 2; |
| 320 uword* GetStackBuffer() { | 327 uword* GetStackBuffer() { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 534 |
| 528 private: | 535 private: |
| 529 ZoneGrowableArray<ProcessedSample*> samples_; | 536 ZoneGrowableArray<ProcessedSample*> samples_; |
| 530 | 537 |
| 531 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); | 538 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); |
| 532 }; | 539 }; |
| 533 | 540 |
| 534 } // namespace dart | 541 } // namespace dart |
| 535 | 542 |
| 536 #endif // VM_PROFILER_H_ | 543 #endif // VM_PROFILER_H_ |
| OLD | NEW |