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

Side by Side Diff: src/spaces.h

Issue 6928010: Make the marking stack into a deque (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 7 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 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 334
335 void set_owner(Space* space) { 335 void set_owner(Space* space) {
336 ASSERT((reinterpret_cast<intptr_t>(space) & kFailureTagMask) == 0); 336 ASSERT((reinterpret_cast<intptr_t>(space) & kFailureTagMask) == 0);
337 owner_ = reinterpret_cast<Address>(space) + kFailureTag; 337 owner_ = reinterpret_cast<Address>(space) + kFailureTag;
338 ASSERT((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) == 338 ASSERT((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) ==
339 kFailureTag); 339 kFailureTag);
340 } 340 }
341 341
342 bool scan_on_scavenge() { return scan_on_scavenge_; } 342 bool scan_on_scavenge() { return scan_on_scavenge_; }
343 bool in_new_space() { return in_new_space_; }
Vyacheslav Egorov (Chromium) 2011/05/04 14:46:52 please revert these unrelated changes.
343 void initialize_scan_on_scavenge(bool scan) { scan_on_scavenge_ = scan; } 344 void initialize_scan_on_scavenge(bool scan) { scan_on_scavenge_ = scan; }
344 inline void set_scan_on_scavenge(bool scan); 345 inline void set_scan_on_scavenge(bool scan);
346 void set_in_new_space(bool in_new_space) { in_new_space_ = in_new_space; }
345 347
346 int store_buffer_counter() { return store_buffer_counter_; } 348 int store_buffer_counter() { return store_buffer_counter_; }
347 void set_store_buffer_counter(int counter) { 349 void set_store_buffer_counter(int counter) {
348 store_buffer_counter_ = counter; 350 store_buffer_counter_ = counter;
349 } 351 }
350 352
351 Address body() { return address() + kObjectStartOffset; } 353 Address body() { return address() + kObjectStartOffset; }
352 354
353 int body_size() { return size() - kObjectStartOffset; } 355 int body_size() { return size() - kObjectStartOffset; }
354 356
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 return this->address() + (index << kPointerSizeLog2); 444 return this->address() + (index << kPointerSizeLog2);
443 } 445 }
444 446
445 void InsertAfter(MemoryChunk* other); 447 void InsertAfter(MemoryChunk* other);
446 void Unlink(); 448 void Unlink();
447 449
448 inline Heap* heap() { return heap_; } 450 inline Heap* heap() { return heap_; }
449 451
450 static const int kFlagsOffset = kPointerSize * 3; 452 static const int kFlagsOffset = kPointerSize * 3;
451 static const int kScanOnScavengeOffset = kPointerSize * 6; 453 static const int kScanOnScavengeOffset = kPointerSize * 6;
454 static const int kInNewSpaceOffset = kPointerSize * 6 + 1;
452 455
453 protected: 456 protected:
454 MemoryChunk* next_chunk_; 457 MemoryChunk* next_chunk_;
455 MemoryChunk* prev_chunk_; 458 MemoryChunk* prev_chunk_;
456 size_t size_; 459 size_t size_;
457 intptr_t flags_; 460 intptr_t flags_;
458 // The identity of the owning space. This is tagged as a failure pointer, but 461 // The identity of the owning space. This is tagged as a failure pointer, but
459 // no failure can be in an object, so this can be distinguished from any entry 462 // no failure can be in an object, so this can be distinguished from any entry
460 // in a fixed array. 463 // in a fixed array.
461 Address owner_; 464 Address owner_;
462 Heap* heap_; 465 Heap* heap_;
463 // This flag indicates that the page is not being tracked by the store buffer. 466 // This flag indicates that the page is not being tracked by the store buffer.
464 // At any point where we have to iterate over pointers to new space, we must 467 // At any point where we have to iterate over pointers to new space, we must
465 // search this page for pointers to new space. 468 // search this page for pointers to new space.
466 bool scan_on_scavenge_; 469 byte scan_on_scavenge_;
470 byte in_new_space_;
467 // Used by the store buffer to keep track of which pages to mark scan-on- 471 // Used by the store buffer to keep track of which pages to mark scan-on-
468 // scavenge. 472 // scavenge.
469 int store_buffer_counter_; 473 int store_buffer_counter_;
470 474
471 static MemoryChunk* Initialize(Heap* heap, 475 static MemoryChunk* Initialize(Heap* heap,
472 Address base, 476 Address base,
473 size_t size, 477 size_t size,
474 Executability executable, 478 Executability executable,
475 Space* owner); 479 Space* owner);
476 480
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 } 2221 }
2218 // Must be small, since an iteration is used for lookup. 2222 // Must be small, since an iteration is used for lookup.
2219 static const int kMaxComments = 64; 2223 static const int kMaxComments = 64;
2220 }; 2224 };
2221 #endif 2225 #endif
2222 2226
2223 2227
2224 } } // namespace v8::internal 2228 } } // namespace v8::internal
2225 2229
2226 #endif // V8_SPACES_H_ 2230 #endif // V8_SPACES_H_
OLDNEW
« src/mark-compact.h ('K') | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698