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

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

Issue 2566383002: ObjectGraph: Establish a HeapIterationScope *before* making the heap writable, least the sweeper in… (Closed)
Patch Set: . Created 4 years 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 | « no previous file | runtime/vm/heap.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) 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 RUNTIME_VM_HEAP_H_ 5 #ifndef RUNTIME_VM_HEAP_H_
6 #define RUNTIME_VM_HEAP_H_ 6 #define RUNTIME_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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 // This heap is in read-only mode: No allocation is allowed. 343 // This heap is in read-only mode: No allocation is allowed.
344 bool read_only_; 344 bool read_only_;
345 345
346 // GC on the heap is in progress. 346 // GC on the heap is in progress.
347 Monitor gc_in_progress_monitor_; 347 Monitor gc_in_progress_monitor_;
348 bool gc_new_space_in_progress_; 348 bool gc_new_space_in_progress_;
349 bool gc_old_space_in_progress_; 349 bool gc_old_space_in_progress_;
350 350
351 friend class Become; // VisitObjectPointers 351 friend class Become; // VisitObjectPointers
352 friend class Precompiler; // VisitObjects 352 friend class Precompiler; // VisitObjects
353 friend class ObjectGraph; // VisitObjects
354 friend class Unmarker; // VisitObjects
353 friend class ServiceEvent; 355 friend class ServiceEvent;
354 friend class PageSpace; // VerifyGC 356 friend class PageSpace; // VerifyGC
355 friend class IsolateReloadContext; // VisitObjects 357 friend class IsolateReloadContext; // VisitObjects
356 358
357 DISALLOW_COPY_AND_ASSIGN(Heap); 359 DISALLOW_COPY_AND_ASSIGN(Heap);
358 }; 360 };
359 361
360 362
361 class HeapIterationScope : public StackResource { 363 class HeapIterationScope : public StackResource {
362 public: 364 public:
363 HeapIterationScope(); 365 explicit HeapIterationScope(bool writable = false);
364 ~HeapIterationScope(); 366 ~HeapIterationScope();
365 367
366 private: 368 private:
367 NoSafepointScope no_safepoint_scope_; 369 NoSafepointScope no_safepoint_scope_;
368 PageSpace* old_space_; 370 PageSpace* old_space_;
371 bool writable_;
369 372
370 DISALLOW_COPY_AND_ASSIGN(HeapIterationScope); 373 DISALLOW_COPY_AND_ASSIGN(HeapIterationScope);
371 }; 374 };
372 375
373 376
374 class NoHeapGrowthControlScope : public StackResource { 377 class NoHeapGrowthControlScope : public StackResource {
375 public: 378 public:
376 NoHeapGrowthControlScope(); 379 NoHeapGrowthControlScope();
377 ~NoHeapGrowthControlScope(); 380 ~NoHeapGrowthControlScope();
378 381
379 private: 382 private:
380 bool current_growth_controller_state_; 383 bool current_growth_controller_state_;
381 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); 384 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
382 }; 385 };
383 386
384 387
385 // Note: During this scope, the code pages are non-executable. 388 // Note: During this scope, the code pages are non-executable.
386 class WritableVMIsolateScope : StackResource { 389 class WritableVMIsolateScope : StackResource {
387 public: 390 public:
388 explicit WritableVMIsolateScope(Thread* thread); 391 explicit WritableVMIsolateScope(Thread* thread);
389 ~WritableVMIsolateScope(); 392 ~WritableVMIsolateScope();
390 }; 393 };
391 394
392 } // namespace dart 395 } // namespace dart
393 396
394 #endif // RUNTIME_VM_HEAP_H_ 397 #endif // RUNTIME_VM_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698