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

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

Issue 1292063004: Add NoSafepointScope to ObjectPointerVisitor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move implementation. Created 5 years, 4 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/allocation.cc ('k') | 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 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 bool gc_in_progress_; 326 bool gc_in_progress_;
327 327
328 int pretenure_policy_; 328 int pretenure_policy_;
329 329
330 friend class ServiceEvent; 330 friend class ServiceEvent;
331 friend class PageSpace; // VerifyGC 331 friend class PageSpace; // VerifyGC
332 DISALLOW_COPY_AND_ASSIGN(Heap); 332 DISALLOW_COPY_AND_ASSIGN(Heap);
333 }; 333 };
334 334
335 335
336 // Within a NoSafepointScope, the thread must not reach any safepoint. Used
337 // around code that manipulates raw object pointers directly without handles.
338 #if defined(DEBUG)
339 class NoSafepointScope : public StackResource {
340 public:
341 NoSafepointScope();
342 ~NoSafepointScope();
343 private:
344 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
345 };
346 #else // defined(DEBUG)
347 class NoSafepointScope : public ValueObject {
348 public:
349 NoSafepointScope() {}
350 private:
351 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
352 };
353 #endif // defined(DEBUG)
354
355
356 class HeapIterationScope : public StackResource { 336 class HeapIterationScope : public StackResource {
357 public: 337 public:
358 HeapIterationScope(); 338 HeapIterationScope();
359 ~HeapIterationScope(); 339 ~HeapIterationScope();
360 private: 340 private:
361 NoSafepointScope no_safepoint_scope_; 341 NoSafepointScope no_safepoint_scope_;
362 PageSpace* old_space_; 342 PageSpace* old_space_;
363 343
364 DISALLOW_COPY_AND_ASSIGN(HeapIterationScope); 344 DISALLOW_COPY_AND_ASSIGN(HeapIterationScope);
365 }; 345 };
366 346
367 347
368 class NoHeapGrowthControlScope : public StackResource { 348 class NoHeapGrowthControlScope : public StackResource {
369 public: 349 public:
370 NoHeapGrowthControlScope(); 350 NoHeapGrowthControlScope();
371 ~NoHeapGrowthControlScope(); 351 ~NoHeapGrowthControlScope();
372 private: 352 private:
373 bool current_growth_controller_state_; 353 bool current_growth_controller_state_;
374 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); 354 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
375 }; 355 };
376 356
377 } // namespace dart 357 } // namespace dart
378 358
379 #endif // VM_HEAP_H_ 359 #endif // VM_HEAP_H_
OLDNEW
« no previous file with comments | « runtime/vm/allocation.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698