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

Side by Side Diff: src/heap/spaces.h

Issue 905773004: Mark pages created during bootstrapping as never-evacuate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: like this? Created 5 years, 10 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 | « src/heap/mark-compact.cc ('k') | src/heap/spaces.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_SPACES_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/base/atomicops.h" 9 #include "src/base/atomicops.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 ABOUT_TO_BE_FREED, 366 ABOUT_TO_BE_FREED,
367 POINTERS_TO_HERE_ARE_INTERESTING, 367 POINTERS_TO_HERE_ARE_INTERESTING,
368 POINTERS_FROM_HERE_ARE_INTERESTING, 368 POINTERS_FROM_HERE_ARE_INTERESTING,
369 SCAN_ON_SCAVENGE, 369 SCAN_ON_SCAVENGE,
370 IN_FROM_SPACE, // Mutually exclusive with IN_TO_SPACE. 370 IN_FROM_SPACE, // Mutually exclusive with IN_TO_SPACE.
371 IN_TO_SPACE, // All pages in new space has one of these two set. 371 IN_TO_SPACE, // All pages in new space has one of these two set.
372 NEW_SPACE_BELOW_AGE_MARK, 372 NEW_SPACE_BELOW_AGE_MARK,
373 CONTAINS_ONLY_DATA, 373 CONTAINS_ONLY_DATA,
374 EVACUATION_CANDIDATE, 374 EVACUATION_CANDIDATE,
375 RESCAN_ON_EVACUATION, 375 RESCAN_ON_EVACUATION,
376 NEVER_EVACUATE, // May contain immortal immutables.
376 377
377 // WAS_SWEPT indicates that marking bits have been cleared by the sweeper, 378 // WAS_SWEPT indicates that marking bits have been cleared by the sweeper,
378 // otherwise marking bits are still intact. 379 // otherwise marking bits are still intact.
379 WAS_SWEPT, 380 WAS_SWEPT,
380 381
381 // Large objects can have a progress bar in their page header. These object 382 // Large objects can have a progress bar in their page header. These object
382 // are scanned in increments and will be kept black while being scanned. 383 // are scanned in increments and will be kept black while being scanned.
383 // Even if the mutator writes to them they will be kept black and a white 384 // Even if the mutator writes to them they will be kept black and a white
384 // to grey transition is performed in the value. 385 // to grey transition is performed in the value.
385 HAS_PROGRESS_BAR, 386 HAS_PROGRESS_BAR,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 return this->address() + (index << kPointerSizeLog2); 598 return this->address() + (index << kPointerSizeLog2);
598 } 599 }
599 600
600 void InsertAfter(MemoryChunk* other); 601 void InsertAfter(MemoryChunk* other);
601 void Unlink(); 602 void Unlink();
602 603
603 inline Heap* heap() const { return heap_; } 604 inline Heap* heap() const { return heap_; }
604 605
605 static const int kFlagsOffset = kPointerSize; 606 static const int kFlagsOffset = kPointerSize;
606 607
607 bool IsEvacuationCandidate() { return IsFlagSet(EVACUATION_CANDIDATE); } 608 bool NeverEvacuate() { return IsFlagSet(NEVER_EVACUATE); }
609
610 void MarkNeverEvacuate() { SetFlag(NEVER_EVACUATE); }
611
612 bool IsEvacuationCandidate() {
613 DCHECK(!(IsFlagSet(NEVER_EVACUATE) && IsFlagSet(EVACUATION_CANDIDATE)));
614 return IsFlagSet(EVACUATION_CANDIDATE);
615 }
608 616
609 bool ShouldSkipEvacuationSlotRecording() { 617 bool ShouldSkipEvacuationSlotRecording() {
610 return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0; 618 return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0;
611 } 619 }
612 620
613 inline SkipList* skip_list() { return skip_list_; } 621 inline SkipList* skip_list() { return skip_list_; }
614 622
615 inline void set_skip_list(SkipList* skip_list) { skip_list_ = skip_list; } 623 inline void set_skip_list(SkipList* skip_list) { skip_list_ = skip_list; }
616 624
617 inline SlotsBuffer* slots_buffer() { return slots_buffer_; } 625 inline SlotsBuffer* slots_buffer() { return slots_buffer_; }
618 626
619 inline SlotsBuffer** slots_buffer_address() { return &slots_buffer_; } 627 inline SlotsBuffer** slots_buffer_address() { return &slots_buffer_; }
620 628
621 void MarkEvacuationCandidate() { 629 void MarkEvacuationCandidate() {
630 DCHECK(!IsFlagSet(NEVER_EVACUATE));
622 DCHECK(slots_buffer_ == NULL); 631 DCHECK(slots_buffer_ == NULL);
623 SetFlag(EVACUATION_CANDIDATE); 632 SetFlag(EVACUATION_CANDIDATE);
624 } 633 }
625 634
626 void ClearEvacuationCandidate() { 635 void ClearEvacuationCandidate() {
627 DCHECK(slots_buffer_ == NULL); 636 DCHECK(slots_buffer_ == NULL);
628 ClearFlag(EVACUATION_CANDIDATE); 637 ClearFlag(EVACUATION_CANDIDATE);
629 } 638 }
630 639
631 Address area_start() { return area_start_; } 640 Address area_start() { return area_start_; }
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 count = 0; 2885 count = 0;
2877 } 2886 }
2878 // Must be small, since an iteration is used for lookup. 2887 // Must be small, since an iteration is used for lookup.
2879 static const int kMaxComments = 64; 2888 static const int kMaxComments = 64;
2880 }; 2889 };
2881 #endif 2890 #endif
2882 } 2891 }
2883 } // namespace v8::internal 2892 } // namespace v8::internal
2884 2893
2885 #endif // V8_HEAP_SPACES_H_ 2894 #endif // V8_HEAP_SPACES_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698