| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void TransferMark(Address old_start, Address new_start); | 122 void TransferMark(Address old_start, Address new_start); |
| 123 | 123 |
| 124 #ifdef DEBUG | 124 #ifdef DEBUG |
| 125 enum ObjectColor { | 125 enum ObjectColor { |
| 126 BLACK_OBJECT, | 126 BLACK_OBJECT, |
| 127 WHITE_OBJECT, | 127 WHITE_OBJECT, |
| 128 GREY_OBJECT, | 128 GREY_OBJECT, |
| 129 IMPOSSIBLE_COLOR | 129 IMPOSSIBLE_COLOR |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 static const char* ColorName(ObjectColor color) { |
| 133 switch (color) { |
| 134 case BLACK_OBJECT: return "black"; |
| 135 case WHITE_OBJECT: return "white"; |
| 136 case GREY_OBJECT: return "grey"; |
| 137 case IMPOSSIBLE_COLOR: return "impossible"; |
| 138 } |
| 139 return "error"; |
| 140 } |
| 141 |
| 132 static ObjectColor Color(HeapObject* obj) { | 142 static ObjectColor Color(HeapObject* obj) { |
| 133 return Color(Marking::MarkBitFrom(obj)); | 143 return Color(Marking::MarkBitFrom(obj)); |
| 134 } | 144 } |
| 135 | 145 |
| 136 static ObjectColor Color(MarkBit mark_bit) { | 146 static ObjectColor Color(MarkBit mark_bit) { |
| 137 if (IsBlack(mark_bit)) return BLACK_OBJECT; | 147 if (IsBlack(mark_bit)) return BLACK_OBJECT; |
| 138 if (IsWhite(mark_bit)) return WHITE_OBJECT; | 148 if (IsWhite(mark_bit)) return WHITE_OBJECT; |
| 139 if (IsGrey(mark_bit)) return GREY_OBJECT; | 149 if (IsGrey(mark_bit)) return GREY_OBJECT; |
| 140 UNREACHABLE(); | 150 UNREACHABLE(); |
| 141 return IMPOSSIBLE_COLOR; | 151 return IMPOSSIBLE_COLOR; |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 MarkingDeque marking_deque_; | 563 MarkingDeque marking_deque_; |
| 554 CodeFlusher* code_flusher_; | 564 CodeFlusher* code_flusher_; |
| 555 | 565 |
| 556 friend class Heap; | 566 friend class Heap; |
| 557 }; | 567 }; |
| 558 | 568 |
| 559 | 569 |
| 560 } } // namespace v8::internal | 570 } } // namespace v8::internal |
| 561 | 571 |
| 562 #endif // V8_MARK_COMPACT_H_ | 572 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |