| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 void SetOverflowed() { overflowed_ = true; } | 210 void SetOverflowed() { overflowed_ = true; } |
| 211 | 211 |
| 212 // Push the (marked) object on the marking stack if there is room, | 212 // Push the (marked) object on the marking stack if there is room, |
| 213 // otherwise mark the object as overflowed and wait for a rescan of the | 213 // otherwise mark the object as overflowed and wait for a rescan of the |
| 214 // heap. | 214 // heap. |
| 215 inline void PushBlack(HeapObject* object) { | 215 inline void PushBlack(HeapObject* object) { |
| 216 ASSERT(object->IsHeapObject()); | 216 ASSERT(object->IsHeapObject()); |
| 217 if (IsFull()) { | 217 if (IsFull()) { |
| 218 Marking::BlackToGrey(object); | 218 Marking::BlackToGrey(object); |
| 219 MemoryChunk::IncrementLiveBytes(object->address(), -object->Size()); |
| 219 SetOverflowed(); | 220 SetOverflowed(); |
| 220 } else { | 221 } else { |
| 221 array_[top_] = object; | 222 array_[top_] = object; |
| 222 top_ = ((top_ + 1) & mask_); | 223 top_ = ((top_ + 1) & mask_); |
| 223 } | 224 } |
| 224 } | 225 } |
| 225 | 226 |
| 226 inline void PushGrey(HeapObject* object) { | 227 inline void PushGrey(HeapObject* object) { |
| 227 ASSERT(object->IsHeapObject()); | 228 ASSERT(object->IsHeapObject()); |
| 228 if (IsFull()) { | 229 if (IsFull()) { |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 784 |
| 784 friend class Heap; | 785 friend class Heap; |
| 785 }; | 786 }; |
| 786 | 787 |
| 787 | 788 |
| 788 const char* AllocationSpaceName(AllocationSpace space); | 789 const char* AllocationSpaceName(AllocationSpace space); |
| 789 | 790 |
| 790 } } // namespace v8::internal | 791 } } // namespace v8::internal |
| 791 | 792 |
| 792 #endif // V8_MARK_COMPACT_H_ | 793 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |