| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_HEAP_H_ | 5 #ifndef VM_HEAP_H_ |
| 6 #define VM_HEAP_H_ | 6 #define VM_HEAP_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 // GC stats collection. | 318 // GC stats collection. |
| 319 GCStats stats_; | 319 GCStats stats_; |
| 320 | 320 |
| 321 // This heap is in read-only mode: No allocation is allowed. | 321 // This heap is in read-only mode: No allocation is allowed. |
| 322 bool read_only_; | 322 bool read_only_; |
| 323 | 323 |
| 324 // GC on the heap is in progress. | 324 // GC on the heap is in progress. |
| 325 bool gc_in_progress_; | 325 bool gc_in_progress_; |
| 326 | 326 |
| 327 friend class GCEvent; |
| 327 friend class GCTestHelper; | 328 friend class GCTestHelper; |
| 328 DISALLOW_COPY_AND_ASSIGN(Heap); | 329 DISALLOW_COPY_AND_ASSIGN(Heap); |
| 329 }; | 330 }; |
| 330 | 331 |
| 331 | 332 |
| 333 class GCEvent { |
| 334 public: |
| 335 explicit GCEvent(const Heap::GCStats& stats) |
| 336 : stats_(stats) {} |
| 337 void PrintJSON(JSONStream* js) const; |
| 338 private: |
| 339 const Heap::GCStats& stats_; |
| 340 }; |
| 341 |
| 342 |
| 332 #if defined(DEBUG) | 343 #if defined(DEBUG) |
| 333 class NoGCScope : public StackResource { | 344 class NoGCScope : public StackResource { |
| 334 public: | 345 public: |
| 335 NoGCScope(); | 346 NoGCScope(); |
| 336 ~NoGCScope(); | 347 ~NoGCScope(); |
| 337 private: | 348 private: |
| 338 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 349 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
| 339 }; | 350 }; |
| 340 #else // defined(DEBUG) | 351 #else // defined(DEBUG) |
| 341 class NoGCScope : public ValueObject { | 352 class NoGCScope : public ValueObject { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 352 NoHeapGrowthControlScope(); | 363 NoHeapGrowthControlScope(); |
| 353 ~NoHeapGrowthControlScope(); | 364 ~NoHeapGrowthControlScope(); |
| 354 private: | 365 private: |
| 355 bool current_growth_controller_state_; | 366 bool current_growth_controller_state_; |
| 356 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 367 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 357 }; | 368 }; |
| 358 | 369 |
| 359 } // namespace dart | 370 } // namespace dart |
| 360 | 371 |
| 361 #endif // VM_HEAP_H_ | 372 #endif // VM_HEAP_H_ |
| OLD | NEW |