Chromium Code Reviews| 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_ = | |
| 960 Bitmap::IndexToCell( | |
| 961 Bitmap::CellAlignIndex( | |
| 962 chunk->AddressToMarkbitIndex(chunk->area_end()))); | |
| 963 cell_base_ = chunk->area_start(); | |
| 964 cell_index_ = Bitmap::IndexToCell( | |
| 965 Bitmap::CellAlignIndex( | |
|
titzer
2013/07/15 13:42:06
Indentation
Hannes Payer (out of office)
2013/07/16 12:13:00
Done.
| |
| 966 chunk->AddressToMarkbitIndex(cell_base_))); | |
| 967 cells_ = chunk->markbits()->cells(); | |
| 968 } | |
| 969 | |
| 970 inline bool Done() { return cell_index_ == last_cell_index_; } | |
| 971 | |
| 972 inline bool HasNext() { return cell_index_ < last_cell_index_ - 1; } | |
| 973 | |
| 974 inline MarkBit::CellType* CurrentCell() { | |
| 975 ASSERT(cell_index_ == | |
|
titzer
2013/07/15 13:42:06
Can
fit
on
fewer
lines
Hannes Payer (out of office)
2013/07/16 12:13:00
Done.
| |
| 976 Bitmap::IndexToCell( | |
| 977 Bitmap::CellAlignIndex( | |
| 978 chunk_->AddressToMarkbitIndex(cell_base_)))); | |
| 979 return &cells_[cell_index_]; | |
| 980 } | |
| 981 | |
| 982 inline Address CurrentCellBase() { | |
| 983 ASSERT(cell_index_ == | |
| 984 Bitmap::IndexToCell( | |
| 985 Bitmap::CellAlignIndex( | |
| 986 chunk_->AddressToMarkbitIndex(cell_base_)))); | |
| 987 return cell_base_; | |
| 988 } | |
| 989 | |
| 990 inline void Advance() { | |
| 991 cell_index_++; | |
| 992 cell_base_ += 32 * kPointerSize; | |
| 993 } | |
| 994 | |
| 995 private: | |
| 996 MemoryChunk* chunk_; | |
| 997 MarkBit::CellType* cells_; | |
| 998 unsigned int last_cell_index_; | |
| 999 unsigned int cell_index_; | |
| 1000 Address cell_base_; | |
| 1001 }; | |
| 1002 | |
| 1003 | |
| 955 class SequentialSweepingScope BASE_EMBEDDED { | 1004 class SequentialSweepingScope BASE_EMBEDDED { |
| 956 public: | 1005 public: |
| 957 explicit SequentialSweepingScope(MarkCompactCollector *collector) : | 1006 explicit SequentialSweepingScope(MarkCompactCollector *collector) : |
| 958 collector_(collector) { | 1007 collector_(collector) { |
| 959 collector_->set_sequential_sweeping(true); | 1008 collector_->set_sequential_sweeping(true); |
| 960 } | 1009 } |
| 961 | 1010 |
| 962 ~SequentialSweepingScope() { | 1011 ~SequentialSweepingScope() { |
| 963 collector_->set_sequential_sweeping(false); | 1012 collector_->set_sequential_sweeping(false); |
| 964 } | 1013 } |
| 965 | 1014 |
| 966 private: | 1015 private: |
| 967 MarkCompactCollector* collector_; | 1016 MarkCompactCollector* collector_; |
| 968 }; | 1017 }; |
| 969 | 1018 |
| 970 | 1019 |
| 971 const char* AllocationSpaceName(AllocationSpace space); | 1020 const char* AllocationSpaceName(AllocationSpace space); |
| 972 | 1021 |
| 973 } } // namespace v8::internal | 1022 } } // namespace v8::internal |
| 974 | 1023 |
| 975 #endif // V8_MARK_COMPACT_H_ | 1024 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |