OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 CodeFlusher* code_flusher_; | 945 CodeFlusher* code_flusher_; |
946 Object* encountered_weak_maps_; | 946 Object* encountered_weak_maps_; |
947 | 947 |
948 List<Page*> evacuation_candidates_; | 948 List<Page*> evacuation_candidates_; |
949 List<Code*> invalidated_code_; | 949 List<Code*> invalidated_code_; |
950 | 950 |
951 friend class Heap; | 951 friend class Heap; |
952 }; | 952 }; |
953 | 953 |
954 | 954 |
| 955 class MarkBitCellIterator BASE_EMBEDDED { |
| 956 public: |
| 957 explicit MarkBitCellIterator(MemoryChunk* chunk) |
| 958 : chunk_(chunk) { |
| 959 last_cell_index_ = Bitmap::IndexToCell( |
| 960 Bitmap::CellAlignIndex( |
| 961 chunk->AddressToMarkbitIndex(chunk->area_end()))); |
| 962 cell_base_ = chunk->area_start(); |
| 963 cell_index_ = Bitmap::IndexToCell( |
| 964 Bitmap::CellAlignIndex( |
| 965 chunk->AddressToMarkbitIndex(cell_base_))); |
| 966 cells_ = chunk->markbits()->cells(); |
| 967 } |
| 968 |
| 969 inline bool Done() { return cell_index_ == last_cell_index_; } |
| 970 |
| 971 inline bool HasNext() { return cell_index_ < last_cell_index_ - 1; } |
| 972 |
| 973 inline MarkBit::CellType* CurrentCell() { |
| 974 ASSERT(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
| 975 chunk_->AddressToMarkbitIndex(cell_base_)))); |
| 976 return &cells_[cell_index_]; |
| 977 } |
| 978 |
| 979 inline Address CurrentCellBase() { |
| 980 ASSERT(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex( |
| 981 chunk_->AddressToMarkbitIndex(cell_base_)))); |
| 982 return cell_base_; |
| 983 } |
| 984 |
| 985 inline void Advance() { |
| 986 cell_index_++; |
| 987 cell_base_ += 32 * kPointerSize; |
| 988 } |
| 989 |
| 990 private: |
| 991 MemoryChunk* chunk_; |
| 992 MarkBit::CellType* cells_; |
| 993 unsigned int last_cell_index_; |
| 994 unsigned int cell_index_; |
| 995 Address cell_base_; |
| 996 }; |
| 997 |
| 998 |
955 class SequentialSweepingScope BASE_EMBEDDED { | 999 class SequentialSweepingScope BASE_EMBEDDED { |
956 public: | 1000 public: |
957 explicit SequentialSweepingScope(MarkCompactCollector *collector) : | 1001 explicit SequentialSweepingScope(MarkCompactCollector *collector) : |
958 collector_(collector) { | 1002 collector_(collector) { |
959 collector_->set_sequential_sweeping(true); | 1003 collector_->set_sequential_sweeping(true); |
960 } | 1004 } |
961 | 1005 |
962 ~SequentialSweepingScope() { | 1006 ~SequentialSweepingScope() { |
963 collector_->set_sequential_sweeping(false); | 1007 collector_->set_sequential_sweeping(false); |
964 } | 1008 } |
965 | 1009 |
966 private: | 1010 private: |
967 MarkCompactCollector* collector_; | 1011 MarkCompactCollector* collector_; |
968 }; | 1012 }; |
969 | 1013 |
970 | 1014 |
971 const char* AllocationSpaceName(AllocationSpace space); | 1015 const char* AllocationSpaceName(AllocationSpace space); |
972 | 1016 |
973 } } // namespace v8::internal | 1017 } } // namespace v8::internal |
974 | 1018 |
975 #endif // V8_MARK_COMPACT_H_ | 1019 #endif // V8_MARK_COMPACT_H_ |
OLD | NEW |