| OLD | NEW |
| 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/atomic-utils.h" | 9 #include "src/atomic-utils.h" |
| 10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // Even if the mutator writes to them they will be kept black and a white | 316 // Even if the mutator writes to them they will be kept black and a white |
| 317 // to grey transition is performed in the value. | 317 // to grey transition is performed in the value. |
| 318 HAS_PROGRESS_BAR, | 318 HAS_PROGRESS_BAR, |
| 319 | 319 |
| 320 // This flag is intended to be used for testing. Works only when both | 320 // This flag is intended to be used for testing. Works only when both |
| 321 // FLAG_stress_compaction and FLAG_manual_evacuation_candidates_selection | 321 // FLAG_stress_compaction and FLAG_manual_evacuation_candidates_selection |
| 322 // are set. It forces the page to become an evacuation candidate at next | 322 // are set. It forces the page to become an evacuation candidate at next |
| 323 // candidates selection cycle. | 323 // candidates selection cycle. |
| 324 FORCE_EVACUATION_CANDIDATE_FOR_TESTING, | 324 FORCE_EVACUATION_CANDIDATE_FOR_TESTING, |
| 325 | 325 |
| 326 // This flag is inteded to be used for testing. |
| 327 NEVER_ALLOCATE_ON_PAGE, |
| 328 |
| 326 // The memory chunk is already logically freed, however the actual freeing | 329 // The memory chunk is already logically freed, however the actual freeing |
| 327 // still has to be performed. | 330 // still has to be performed. |
| 328 PRE_FREED, | 331 PRE_FREED, |
| 329 | 332 |
| 330 // |COMPACTION_WAS_ABORTED|: Indicates that the compaction in this page | 333 // |COMPACTION_WAS_ABORTED|: Indicates that the compaction in this page |
| 331 // has been aborted and needs special handling by the sweeper. | 334 // has been aborted and needs special handling by the sweeper. |
| 332 COMPACTION_WAS_ABORTED, | 335 COMPACTION_WAS_ABORTED, |
| 333 | 336 |
| 334 // Last flag, keep at bottom. | 337 // Last flag, keep at bottom. |
| 335 NUM_MEMORY_CHUNK_FLAGS | 338 NUM_MEMORY_CHUNK_FLAGS |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 678 |
| 676 bool NeverEvacuate() { return IsFlagSet(NEVER_EVACUATE); } | 679 bool NeverEvacuate() { return IsFlagSet(NEVER_EVACUATE); } |
| 677 | 680 |
| 678 void MarkNeverEvacuate() { SetFlag(NEVER_EVACUATE); } | 681 void MarkNeverEvacuate() { SetFlag(NEVER_EVACUATE); } |
| 679 | 682 |
| 680 bool IsEvacuationCandidate() { | 683 bool IsEvacuationCandidate() { |
| 681 DCHECK(!(IsFlagSet(NEVER_EVACUATE) && IsFlagSet(EVACUATION_CANDIDATE))); | 684 DCHECK(!(IsFlagSet(NEVER_EVACUATE) && IsFlagSet(EVACUATION_CANDIDATE))); |
| 682 return IsFlagSet(EVACUATION_CANDIDATE); | 685 return IsFlagSet(EVACUATION_CANDIDATE); |
| 683 } | 686 } |
| 684 | 687 |
| 688 bool CanAllocate() { |
| 689 return !IsEvacuationCandidate() && !IsFlagSet(NEVER_ALLOCATE_ON_PAGE); |
| 690 } |
| 691 |
| 685 bool ShouldSkipEvacuationSlotRecording() { | 692 bool ShouldSkipEvacuationSlotRecording() { |
| 686 return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0; | 693 return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0; |
| 687 } | 694 } |
| 688 | 695 |
| 689 inline SkipList* skip_list() { return skip_list_; } | 696 inline SkipList* skip_list() { return skip_list_; } |
| 690 | 697 |
| 691 inline void set_skip_list(SkipList* skip_list) { skip_list_ = skip_list; } | 698 inline void set_skip_list(SkipList* skip_list) { skip_list_ = skip_list; } |
| 692 | 699 |
| 693 inline SlotsBuffer* slots_buffer() { return slots_buffer_; } | 700 inline SlotsBuffer* slots_buffer() { return slots_buffer_; } |
| 694 | 701 |
| (...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3148 count = 0; | 3155 count = 0; |
| 3149 } | 3156 } |
| 3150 // Must be small, since an iteration is used for lookup. | 3157 // Must be small, since an iteration is used for lookup. |
| 3151 static const int kMaxComments = 64; | 3158 static const int kMaxComments = 64; |
| 3152 }; | 3159 }; |
| 3153 #endif | 3160 #endif |
| 3154 } // namespace internal | 3161 } // namespace internal |
| 3155 } // namespace v8 | 3162 } // namespace v8 |
| 3156 | 3163 |
| 3157 #endif // V8_HEAP_SPACES_H_ | 3164 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |