| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 void SetOverflowed() { overflowed_ = true; } | 192 void SetOverflowed() { overflowed_ = true; } |
| 193 | 193 |
| 194 // Push the (marked) object on the marking stack if there is room, | 194 // Push the (marked) object on the marking stack if there is room, |
| 195 // otherwise mark the object as overflowed and wait for a rescan of the | 195 // otherwise mark the object as overflowed and wait for a rescan of the |
| 196 // heap. | 196 // heap. |
| 197 inline void PushBlack(HeapObject* object) { | 197 inline void PushBlack(HeapObject* object) { |
| 198 ASSERT(object->IsHeapObject()); | 198 ASSERT(object->IsHeapObject()); |
| 199 if (IsFull()) { | 199 if (IsFull()) { |
| 200 Marking::BlackToGrey(object); | 200 Marking::BlackToGrey(object); |
| 201 MemoryChunk::IncrementLiveBytes(object->address(), -object->Size()); | 201 MemoryChunk::IncrementLiveBytesFromGC(object->address(), -object->Size()); |
| 202 SetOverflowed(); | 202 SetOverflowed(); |
| 203 } else { | 203 } else { |
| 204 array_[top_] = object; | 204 array_[top_] = object; |
| 205 top_ = ((top_ + 1) & mask_); | 205 top_ = ((top_ + 1) & mask_); |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 inline void PushGrey(HeapObject* object) { | 209 inline void PushGrey(HeapObject* object) { |
| 210 ASSERT(object->IsHeapObject()); | 210 ASSERT(object->IsHeapObject()); |
| 211 if (IsFull()) { | 211 if (IsFull()) { |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 | 745 |
| 746 friend class Heap; | 746 friend class Heap; |
| 747 }; | 747 }; |
| 748 | 748 |
| 749 | 749 |
| 750 const char* AllocationSpaceName(AllocationSpace space); | 750 const char* AllocationSpaceName(AllocationSpace space); |
| 751 | 751 |
| 752 } } // namespace v8::internal | 752 } } // namespace v8::internal |
| 753 | 753 |
| 754 #endif // V8_MARK_COMPACT_H_ | 754 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |