| 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" |
| 11 #include "vm/globals.h" | 11 #include "vm/globals.h" |
| 12 #include "vm/pages.h" | 12 #include "vm/pages.h" |
| 13 #include "vm/scavenger.h" | 13 #include "vm/scavenger.h" |
| 14 #include "vm/spaces.h" | 14 #include "vm/spaces.h" |
| 15 #include "vm/verifier.h" | 15 #include "vm/verifier.h" |
| 16 #include "vm/weak_table.h" | 16 #include "vm/weak_table.h" |
| 17 | 17 |
| 18 namespace dart { | 18 namespace dart { |
| 19 | 19 |
| 20 // Forward declarations. | 20 // Forward declarations. |
| 21 class Isolate; | 21 class Isolate; |
| 22 class ObjectPointerVisitor; | 22 class ObjectPointerVisitor; |
| 23 class ObjectSet; | 23 class ObjectSet; |
| 24 class ServiceEvent; |
| 24 class VirtualMemory; | 25 class VirtualMemory; |
| 25 | 26 |
| 26 DECLARE_FLAG(bool, verbose_gc); | 27 DECLARE_FLAG(bool, verbose_gc); |
| 27 DECLARE_FLAG(bool, verify_before_gc); | 28 DECLARE_FLAG(bool, verify_before_gc); |
| 28 DECLARE_FLAG(bool, verify_after_gc); | 29 DECLARE_FLAG(bool, verify_after_gc); |
| 29 DECLARE_FLAG(bool, gc_at_alloc); | 30 DECLARE_FLAG(bool, gc_at_alloc); |
| 30 | 31 |
| 31 class Heap { | 32 class Heap { |
| 32 public: | 33 public: |
| 33 enum Space { | 34 enum Space { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 GCStats stats_; | 306 GCStats stats_; |
| 306 | 307 |
| 307 // This heap is in read-only mode: No allocation is allowed. | 308 // This heap is in read-only mode: No allocation is allowed. |
| 308 bool read_only_; | 309 bool read_only_; |
| 309 | 310 |
| 310 // GC on the heap is in progress. | 311 // GC on the heap is in progress. |
| 311 bool gc_in_progress_; | 312 bool gc_in_progress_; |
| 312 | 313 |
| 313 int pretenure_policy_; | 314 int pretenure_policy_; |
| 314 | 315 |
| 315 friend class GCEvent; | 316 friend class ServiceEvent; |
| 316 friend class GCTestHelper; | 317 friend class GCTestHelper; |
| 317 DISALLOW_COPY_AND_ASSIGN(Heap); | 318 DISALLOW_COPY_AND_ASSIGN(Heap); |
| 318 }; | 319 }; |
| 319 | 320 |
| 320 | 321 |
| 321 class GCEvent { | |
| 322 public: | |
| 323 explicit GCEvent(const Heap::GCStats& stats) | |
| 324 : stats_(stats) {} | |
| 325 void PrintJSON(JSONStream* js) const; | |
| 326 private: | |
| 327 const Heap::GCStats& stats_; | |
| 328 }; | |
| 329 | |
| 330 | |
| 331 // Within a NoSafepointScope, the thread must not reach any safepoint. Used | 322 // Within a NoSafepointScope, the thread must not reach any safepoint. Used |
| 332 // around code that manipulates raw object pointers directly without handles. | 323 // around code that manipulates raw object pointers directly without handles. |
| 333 #if defined(DEBUG) | 324 #if defined(DEBUG) |
| 334 class NoSafepointScope : public StackResource { | 325 class NoSafepointScope : public StackResource { |
| 335 public: | 326 public: |
| 336 NoSafepointScope(); | 327 NoSafepointScope(); |
| 337 ~NoSafepointScope(); | 328 ~NoSafepointScope(); |
| 338 private: | 329 private: |
| 339 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope); | 330 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope); |
| 340 }; | 331 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 353 NoHeapGrowthControlScope(); | 344 NoHeapGrowthControlScope(); |
| 354 ~NoHeapGrowthControlScope(); | 345 ~NoHeapGrowthControlScope(); |
| 355 private: | 346 private: |
| 356 bool current_growth_controller_state_; | 347 bool current_growth_controller_state_; |
| 357 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 348 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 358 }; | 349 }; |
| 359 | 350 |
| 360 } // namespace dart | 351 } // namespace dart |
| 361 | 352 |
| 362 #endif // VM_HEAP_H_ | 353 #endif // VM_HEAP_H_ |
| OLD | NEW |