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

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

Issue 1181943002: Assert no allocation during heap iteration; fix unsafe iteration in ObjectGraph. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: spelling fix Created 5 years, 6 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 | « no previous file | runtime/vm/object_graph.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Move external size from new to old space. Does not by itself trigger GC. 98 // Move external size from new to old space. Does not by itself trigger GC.
99 void PromoteExternal(intptr_t size); 99 void PromoteExternal(intptr_t size);
100 100
101 // Heap contains the specified address. 101 // Heap contains the specified address.
102 bool Contains(uword addr) const; 102 bool Contains(uword addr) const;
103 bool NewContains(uword addr) const; 103 bool NewContains(uword addr) const;
104 bool OldContains(uword addr) const; 104 bool OldContains(uword addr) const;
105 bool CodeContains(uword addr) const; 105 bool CodeContains(uword addr) const;
106 bool StubCodeContains(uword addr) const; 106 bool StubCodeContains(uword addr) const;
107 107
108 // Visit all pointers. 108 // Visit all pointers. Caller must ensure concurrent sweeper is not running,
109 // and the visitor must not allocate (see issue 21620).
109 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; 110 void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
110 111
111 // Visit all objects. 112 // Visit all objects, including FreeListElement "objects". Caller must ensure
113 // concurrent sweeper is not running, and the visitor must not allocate (see
114 // issue 21620).
112 void VisitObjects(ObjectVisitor* visitor) const; 115 void VisitObjects(ObjectVisitor* visitor) const;
113 116
114 // Find an object by visiting all pointers in the specified heap space, 117 // Find an object by visiting all pointers in the specified heap space,
115 // the 'visitor' is used to determine if an object is found or not. 118 // the 'visitor' is used to determine if an object is found or not.
116 // The 'visitor' function should be set up to return true if the 119 // The 'visitor' function should be set up to return true if the
117 // object is found, traversal through the heap space stops at that 120 // object is found, traversal through the heap space stops at that
118 // point. 121 // point.
119 // The 'visitor' function should return false if the object is not found, 122 // The 'visitor' function should return false if the object is not found,
120 // traversal through the heap space continues. 123 // traversal through the heap space continues.
121 // Returns null object if nothing is found. Must be called within a 124 // Returns null object if nothing is found. Must be called within a
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 NoHeapGrowthControlScope(); 347 NoHeapGrowthControlScope();
345 ~NoHeapGrowthControlScope(); 348 ~NoHeapGrowthControlScope();
346 private: 349 private:
347 bool current_growth_controller_state_; 350 bool current_growth_controller_state_;
348 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); 351 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
349 }; 352 };
350 353
351 } // namespace dart 354 } // namespace dart
352 355
353 #endif // VM_HEAP_H_ 356 #endif // VM_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698