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

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

Issue 18259014: Object ID Ring with tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ASSERT((id >= 0) && (id < GCStats::kDataEntries)); 189 ASSERT((id >= 0) && (id < GCStats::kDataEntries));
190 stats_.data_[id] = value; 190 stats_.data_[id] = value;
191 } 191 }
192 192
193 bool gc_in_progress() const { return gc_in_progress_; } 193 bool gc_in_progress() const { return gc_in_progress_; }
194 194
195 static bool IsAllocatableInNewSpace(intptr_t size) { 195 static bool IsAllocatableInNewSpace(intptr_t size) {
196 return size <= kNewAllocatableSize; 196 return size <= kNewAllocatableSize;
197 } 197 }
198 198
199 void set_object_id_ring_table(RawObject** object_id_ring_table,
200 intptr_t object_id_ring_table_size) {
201 ASSERT(!gc_in_progress_);
202 object_id_ring_table_ = object_id_ring_table;
203 object_id_ring_table_size_ = object_id_ring_table_size;
204 }
205 RawObject** get_object_id_ring_table() {
206 return object_id_ring_table_;
207 }
208 intptr_t get_object_id_ring_table_size() {
209 return object_id_ring_table_size_;
210 }
211
199 private: 212 private:
200 class GCStats : public ValueObject { 213 class GCStats : public ValueObject {
201 public: 214 public:
202 GCStats() {} 215 GCStats() {}
203 intptr_t num_; 216 intptr_t num_;
204 Heap::Space space_; 217 Heap::Space space_;
205 Heap::GCReason reason_; 218 Heap::GCReason reason_;
206 219
207 class Data : public ValueObject { 220 class Data : public ValueObject {
208 public: 221 public:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 261
249 // GC stats collection. 262 // GC stats collection.
250 GCStats stats_; 263 GCStats stats_;
251 264
252 // This heap is in read-only mode: No allocation is allowed. 265 // This heap is in read-only mode: No allocation is allowed.
253 bool read_only_; 266 bool read_only_;
254 267
255 // GC on the heap is in progress. 268 // GC on the heap is in progress.
256 bool gc_in_progress_; 269 bool gc_in_progress_;
257 270
271 // Ring of objects who have a vm service id assigned to them.
272 RawObject** object_id_ring_table_;
273 intptr_t object_id_ring_table_size_;
274
258 friend class GCTestHelper; 275 friend class GCTestHelper;
259 DISALLOW_COPY_AND_ASSIGN(Heap); 276 DISALLOW_COPY_AND_ASSIGN(Heap);
260 }; 277 };
261 278
262 279
263 #if defined(DEBUG) 280 #if defined(DEBUG)
264 class NoGCScope : public StackResource { 281 class NoGCScope : public StackResource {
265 public: 282 public:
266 NoGCScope(); 283 NoGCScope();
267 ~NoGCScope(); 284 ~NoGCScope();
(...skipping 15 matching lines...) Expand all
283 NoHeapGrowthControlScope(); 300 NoHeapGrowthControlScope();
284 ~NoHeapGrowthControlScope(); 301 ~NoHeapGrowthControlScope();
285 private: 302 private:
286 bool current_growth_controller_state_; 303 bool current_growth_controller_state_;
287 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); 304 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
288 }; 305 };
289 306
290 } // namespace dart 307 } // namespace dart
291 308
292 #endif // VM_HEAP_H_ 309 #endif // VM_HEAP_H_
OLDNEW
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/heap.cc » ('j') | runtime/vm/object_id_ring.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698