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

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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 ASSERT((id >= 0) && (id < GCStats::kDataEntries)); 224 ASSERT((id >= 0) && (id < GCStats::kDataEntries));
225 stats_.data_[id] = value; 225 stats_.data_[id] = value;
226 } 226 }
227 227
228 bool gc_in_progress() const { return gc_in_progress_; } 228 bool gc_in_progress() const { return gc_in_progress_; }
229 229
230 static bool IsAllocatableInNewSpace(intptr_t size) { 230 static bool IsAllocatableInNewSpace(intptr_t size) {
231 return size <= kNewAllocatableSize; 231 return size <= kNewAllocatableSize;
232 } 232 }
233 233
234 void set_object_id_ring_table(RawObject** object_id_ring_table,
Ivan Posva 2013/07/10 01:10:13 How about set_object_id_table and object_id_table(
Cutch 2013/07/10 17:23:10 Done.
235 intptr_t object_id_ring_table_size) {
236 ASSERT(!gc_in_progress_);
237 object_id_ring_table_ = object_id_ring_table;
238 object_id_ring_table_size_ = object_id_ring_table_size;
239 }
240 RawObject** get_object_id_ring_table() {
Ivan Posva 2013/07/10 01:10:13 Why does this return the naked internals of the Ob
Cutch 2013/07/10 17:23:10 I've killed this and now the marker and scavenger
241 return object_id_ring_table_;
242 }
243 intptr_t get_object_id_ring_table_size() {
244 return object_id_ring_table_size_;
245 }
246
234 private: 247 private:
235 class GCStats : public ValueObject { 248 class GCStats : public ValueObject {
236 public: 249 public:
237 GCStats() {} 250 GCStats() {}
238 intptr_t num_; 251 intptr_t num_;
239 Heap::Space space_; 252 Heap::Space space_;
240 Heap::GCReason reason_; 253 Heap::GCReason reason_;
241 254
242 class Data : public ValueObject { 255 class Data : public ValueObject {
243 public: 256 public:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 299
287 // GC stats collection. 300 // GC stats collection.
288 GCStats stats_; 301 GCStats stats_;
289 302
290 // This heap is in read-only mode: No allocation is allowed. 303 // This heap is in read-only mode: No allocation is allowed.
291 bool read_only_; 304 bool read_only_;
292 305
293 // GC on the heap is in progress. 306 // GC on the heap is in progress.
294 bool gc_in_progress_; 307 bool gc_in_progress_;
295 308
309 // Ring of objects who have a vm service id assigned to them.
310 RawObject** object_id_ring_table_;
311 intptr_t object_id_ring_table_size_;
312
296 friend class GCTestHelper; 313 friend class GCTestHelper;
297 DISALLOW_COPY_AND_ASSIGN(Heap); 314 DISALLOW_COPY_AND_ASSIGN(Heap);
298 }; 315 };
299 316
300 317
301 #if defined(DEBUG) 318 #if defined(DEBUG)
302 class NoGCScope : public StackResource { 319 class NoGCScope : public StackResource {
303 public: 320 public:
304 NoGCScope(); 321 NoGCScope();
305 ~NoGCScope(); 322 ~NoGCScope();
(...skipping 15 matching lines...) Expand all
321 NoHeapGrowthControlScope(); 338 NoHeapGrowthControlScope();
322 ~NoHeapGrowthControlScope(); 339 ~NoHeapGrowthControlScope();
323 private: 340 private:
324 bool current_growth_controller_state_; 341 bool current_growth_controller_state_;
325 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); 342 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
326 }; 343 };
327 344
328 } // namespace dart 345 } // namespace dart
329 346
330 #endif // VM_HEAP_H_ 347 #endif // VM_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698