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

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

Issue 973553005: Fix memory leak in CPU Profile page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « runtime/observatory/lib/src/elements/cpu_profile.html ('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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 bool missing_frame_inserted() const { 293 bool missing_frame_inserted() const {
294 return MissingFrameInsertedBit::decode(state_); 294 return MissingFrameInsertedBit::decode(state_);
295 } 295 }
296 296
297 void set_missing_frame_inserted(bool missing_frame_inserted) { 297 void set_missing_frame_inserted(bool missing_frame_inserted) {
298 state_ = MissingFrameInsertedBit::update(missing_frame_inserted, state_); 298 state_ = MissingFrameInsertedBit::update(missing_frame_inserted, state_);
299 } 299 }
300 300
301 bool truncated_trace() const {
302 return TruncatedTraceBit::decode(state_);
303 }
304
305 void set_truncated_trace(bool truncated_trace) {
306 state_ = TruncatedTraceBit::update(truncated_trace, state_);
307 }
308
301 static void InitOnce(); 309 static void InitOnce();
302 310
303 static intptr_t instance_size() { 311 static intptr_t instance_size() {
304 return instance_size_; 312 return instance_size_;
305 } 313 }
306 314
307 uword* GetPCArray() const; 315 uword* GetPCArray() const;
308 316
309 static const int kStackBufferSizeInWords = 2; 317 static const int kStackBufferSizeInWords = 2;
310 uword* GetStackBuffer() { 318 uword* GetStackBuffer() {
311 return &stack_buffer_[0]; 319 return &stack_buffer_[0];
312 } 320 }
313 321
314 private: 322 private:
315 static intptr_t instance_size_; 323 static intptr_t instance_size_;
316 static intptr_t pcs_length_; 324 static intptr_t pcs_length_;
317 enum StateBits { 325 enum StateBits {
318 kProcessedBit = 0, 326 kProcessedBit = 0,
319 kLeafFrameIsDartBit = 1, 327 kLeafFrameIsDartBit = 1,
320 kIgnoreBit = 2, 328 kIgnoreBit = 2,
321 kExitFrameBit = 3, 329 kExitFrameBit = 3,
322 kMissingFrameInsertedBit = 4, 330 kMissingFrameInsertedBit = 4,
331 kTruncatedTrace = 5,
323 }; 332 };
324 class ProcessedBit : public BitField<bool, kProcessedBit, 1> {}; 333 class ProcessedBit : public BitField<bool, kProcessedBit, 1> {};
325 class LeafFrameIsDart : public BitField<bool, kLeafFrameIsDartBit, 1> {}; 334 class LeafFrameIsDart : public BitField<bool, kLeafFrameIsDartBit, 1> {};
326 class IgnoreBit : public BitField<bool, kIgnoreBit, 1> {}; 335 class IgnoreBit : public BitField<bool, kIgnoreBit, 1> {};
327 class ExitFrameBit : public BitField<bool, kExitFrameBit, 1> {}; 336 class ExitFrameBit : public BitField<bool, kExitFrameBit, 1> {};
328 class MissingFrameInsertedBit 337 class MissingFrameInsertedBit
329 : public BitField<bool, kMissingFrameInsertedBit, 1> {}; 338 : public BitField<bool, kMissingFrameInsertedBit, 1> {};
339 class TruncatedTraceBit : public BitField<bool, kTruncatedTrace, 1> {};
340
330 int64_t timestamp_; 341 int64_t timestamp_;
331 ThreadId tid_; 342 ThreadId tid_;
332 Isolate* isolate_; 343 Isolate* isolate_;
333 uword pc_marker_; 344 uword pc_marker_;
334 uword stack_buffer_[kStackBufferSizeInWords]; 345 uword stack_buffer_[kStackBufferSizeInWords];
335 uword vm_tag_; 346 uword vm_tag_;
336 uword user_tag_; 347 uword user_tag_;
337 uword sp_; 348 uword sp_;
338 uword fp_; 349 uword fp_;
339 uword lr_; 350 uword lr_;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 intptr_t capacity_; 409 intptr_t capacity_;
399 uintptr_t cursor_; 410 uintptr_t cursor_;
400 411
401 DISALLOW_COPY_AND_ASSIGN(SampleBuffer); 412 DISALLOW_COPY_AND_ASSIGN(SampleBuffer);
402 }; 413 };
403 414
404 415
405 } // namespace dart 416 } // namespace dart
406 417
407 #endif // VM_PROFILER_H_ 418 #endif // VM_PROFILER_H_
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/cpu_profile.html ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698