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

Side by Side Diff: runtime/vm/profiler.h

Issue 1211633002: Introduce mechanism to record an allocation of a class (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698