OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MARK_COMPACT_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_H_ |
6 #define V8_HEAP_MARK_COMPACT_H_ | 6 #define V8_HEAP_MARK_COMPACT_H_ |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 | 10 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 : idx_(0), chain_length_(1), next_(next_buffer) { | 259 : idx_(0), chain_length_(1), next_(next_buffer) { |
260 if (next_ != NULL) { | 260 if (next_ != NULL) { |
261 chain_length_ = next_->chain_length_ + 1; | 261 chain_length_ = next_->chain_length_ + 1; |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 ~SlotsBuffer() {} | 265 ~SlotsBuffer() {} |
266 | 266 |
267 void Add(ObjectSlot slot) { | 267 void Add(ObjectSlot slot) { |
268 DCHECK(0 <= idx_ && idx_ < kNumberOfElements); | 268 DCHECK(0 <= idx_ && idx_ < kNumberOfElements); |
| 269 #ifdef DEBUG |
| 270 if (slot >= reinterpret_cast<ObjectSlot>(NUMBER_OF_SLOT_TYPES)) { |
| 271 DCHECK_NOT_NULL(*slot); |
| 272 } |
| 273 #endif |
269 slots_[idx_++] = slot; | 274 slots_[idx_++] = slot; |
270 } | 275 } |
271 | 276 |
272 enum SlotType { | 277 enum SlotType { |
273 EMBEDDED_OBJECT_SLOT, | 278 EMBEDDED_OBJECT_SLOT, |
274 RELOCATED_CODE_OBJECT, | 279 RELOCATED_CODE_OBJECT, |
275 CODE_TARGET_SLOT, | 280 CODE_TARGET_SLOT, |
276 CODE_ENTRY_SLOT, | 281 CODE_ENTRY_SLOT, |
277 DEBUG_TARGET_SLOT, | 282 DEBUG_TARGET_SLOT, |
278 JS_RETURN_SLOT, | 283 JS_RETURN_SLOT, |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 private: | 961 private: |
957 MarkCompactCollector* collector_; | 962 MarkCompactCollector* collector_; |
958 }; | 963 }; |
959 | 964 |
960 | 965 |
961 const char* AllocationSpaceName(AllocationSpace space); | 966 const char* AllocationSpaceName(AllocationSpace space); |
962 } | 967 } |
963 } // namespace v8::internal | 968 } // namespace v8::internal |
964 | 969 |
965 #endif // V8_HEAP_MARK_COMPACT_H_ | 970 #endif // V8_HEAP_MARK_COMPACT_H_ |
OLD | NEW |