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

Side by Side Diff: src/mark-compact.h

Issue 7302003: Support slots recording for compaction during incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: fix presubmit, remove last debug check Created 9 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
« no previous file with comments | « src/incremental-marking-inl.h ('k') | src/mark-compact.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 class SlotsBuffer { 259 class SlotsBuffer {
260 public: 260 public:
261 typedef Object** ObjectSlot; 261 typedef Object** ObjectSlot;
262 262
263 SlotsBuffer(); 263 SlotsBuffer();
264 ~SlotsBuffer(); 264 ~SlotsBuffer();
265 265
266 void Clear(); 266 void Clear();
267 void Add(ObjectSlot slot); 267 void Add(ObjectSlot slot);
268 void Iterate(ObjectVisitor* visitor); 268 void Update();
269 void Report(); 269 void Report();
270 270
271 private: 271 private:
272 static const int kBufferSize = 1024; 272 static const int kBufferSize = 1024;
273 273
274 List<ObjectSlot*> buffers_; 274 List<ObjectSlot*> buffers_;
275 ObjectSlot* buffer_; 275 ObjectSlot* buffer_;
276 276
277 int idx_; 277 int idx_;
278 int buffer_idx_; 278 int buffer_idx_;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 void AddEvacuationCandidate(Page* p); 327 void AddEvacuationCandidate(Page* p);
328 328
329 // Prepares for GC by resetting relocation info in old and map spaces and 329 // Prepares for GC by resetting relocation info in old and map spaces and
330 // choosing spaces to compact. 330 // choosing spaces to compact.
331 void Prepare(GCTracer* tracer); 331 void Prepare(GCTracer* tracer);
332 332
333 // Performs a global garbage collection. 333 // Performs a global garbage collection.
334 void CollectGarbage(); 334 void CollectGarbage();
335 335
336 bool StartCompaction();
337
336 // During a full GC, there is a stack-allocated GCTracer that is used for 338 // During a full GC, there is a stack-allocated GCTracer that is used for
337 // bookkeeping information. Return a pointer to that tracer. 339 // bookkeeping information. Return a pointer to that tracer.
338 GCTracer* tracer() { return tracer_; } 340 GCTracer* tracer() { return tracer_; }
339 341
340 #ifdef DEBUG 342 #ifdef DEBUG
341 // Checks whether performing mark-compact collection. 343 // Checks whether performing mark-compact collection.
342 bool in_use() { return state_ > PREPARE_GC; } 344 bool in_use() { return state_ > PREPARE_GC; }
343 bool are_map_pointers_encoded() { return state_ == UPDATE_POINTERS; } 345 bool are_map_pointers_encoded() { return state_ == UPDATE_POINTERS; }
344 #endif 346 #endif
345 347
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 }; 411 };
410 412
411 // The current stage of the collector. 413 // The current stage of the collector.
412 CollectorState state_; 414 CollectorState state_;
413 #endif 415 #endif
414 416
415 // Global flag that forces sweeping to be precise, so we can traverse the 417 // Global flag that forces sweeping to be precise, so we can traverse the
416 // heap. 418 // heap.
417 bool sweep_precisely_; 419 bool sweep_precisely_;
418 420
421 // True if we are collecting slots to perform evacuation from evacuation
422 // candidates.
423 bool compacting_;
424
419 // A pointer to the current stack-allocated GC tracer object during a full 425 // A pointer to the current stack-allocated GC tracer object during a full
420 // collection (NULL before and after). 426 // collection (NULL before and after).
421 GCTracer* tracer_; 427 GCTracer* tracer_;
422 428
423 SlotsBuffer slots_buffer_; 429 SlotsBuffer slots_buffer_;
424 430
425 // Finishes GC, performs heap verification if enabled. 431 // Finishes GC, performs heap verification if enabled.
426 void Finish(); 432 void Finish();
427 433
428 // ----------------------------------------------------------------------- 434 // -----------------------------------------------------------------------
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 599
594 List<Page*> evacuation_candidates_; 600 List<Page*> evacuation_candidates_;
595 601
596 friend class Heap; 602 friend class Heap;
597 }; 603 };
598 604
599 605
600 } } // namespace v8::internal 606 } } // namespace v8::internal
601 607
602 #endif // V8_MARK_COMPACT_H_ 608 #endif // V8_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/incremental-marking-inl.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698