| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 #ifdef DEBUG | 113 #ifdef DEBUG |
| 114 // Checks whether performing mark-compact collection. | 114 // Checks whether performing mark-compact collection. |
| 115 static bool in_use() { return state_ > PREPARE_GC; } | 115 static bool in_use() { return state_ > PREPARE_GC; } |
| 116 static bool are_map_pointers_encoded() { return state_ == UPDATE_POINTERS; } | 116 static bool are_map_pointers_encoded() { return state_ == UPDATE_POINTERS; } |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 // Determine type of object and emit deletion log event. | 119 // Determine type of object and emit deletion log event. |
| 120 static void ReportDeleteIfNeeded(HeapObject* obj); | 120 static void ReportDeleteIfNeeded(HeapObject* obj); |
| 121 | 121 |
| 122 // Returns size of a possibly marked object. |
| 123 static int SizeOfMarkedObject(HeapObject* obj); |
| 124 |
| 122 // Distinguishable invalid map encodings (for single word and multiple words) | 125 // Distinguishable invalid map encodings (for single word and multiple words) |
| 123 // that indicate free regions. | 126 // that indicate free regions. |
| 124 static const uint32_t kSingleFreeEncoding = 0; | 127 static const uint32_t kSingleFreeEncoding = 0; |
| 125 static const uint32_t kMultiFreeEncoding = 1; | 128 static const uint32_t kMultiFreeEncoding = 1; |
| 126 | 129 |
| 127 private: | 130 private: |
| 128 #ifdef DEBUG | 131 #ifdef DEBUG |
| 129 enum CollectorState { | 132 enum CollectorState { |
| 130 IDLE, | 133 IDLE, |
| 131 PREPARE_GC, | 134 PREPARE_GC, |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 424 |
| 422 friend class UnmarkObjectVisitor; | 425 friend class UnmarkObjectVisitor; |
| 423 static void UnmarkObject(HeapObject* obj); | 426 static void UnmarkObject(HeapObject* obj); |
| 424 #endif | 427 #endif |
| 425 }; | 428 }; |
| 426 | 429 |
| 427 | 430 |
| 428 } } // namespace v8::internal | 431 } } // namespace v8::internal |
| 429 | 432 |
| 430 #endif // V8_MARK_COMPACT_H_ | 433 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |