| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 friend class RootMarkingVisitor; | 146 friend class RootMarkingVisitor; |
| 147 friend class MarkingVisitor; | 147 friend class MarkingVisitor; |
| 148 | 148 |
| 149 // Marking operations for objects reachable from roots. | 149 // Marking operations for objects reachable from roots. |
| 150 static void MarkLiveObjects(); | 150 static void MarkLiveObjects(); |
| 151 | 151 |
| 152 static void MarkUnmarkedObject(HeapObject* obj); | 152 static void MarkUnmarkedObject(HeapObject* obj); |
| 153 | 153 |
| 154 static inline void MarkObject(HeapObject* obj) { | 154 static inline void MarkObject(HeapObject* obj) { |
| 155 if (!obj->IsMarked()) MarkUnmarkedObject(obj); | 155 if (!obj->IsMarked()) MarkUnmarkedObject(obj); |
| 156 } |
| 157 |
| 158 static inline void SetMark(HeapObject* obj) { |
| 159 tracer_->increment_marked_count(); |
| 160 #ifdef DEBUG |
| 161 UpdateLiveObjectCount(obj); |
| 162 #endif |
| 163 obj->SetMark(); |
| 156 } | 164 } |
| 157 | 165 |
| 158 // Creates back pointers for all map transitions, stores them in | 166 // Creates back pointers for all map transitions, stores them in |
| 159 // the prototype field. The original prototype pointers are restored | 167 // the prototype field. The original prototype pointers are restored |
| 160 // in ClearNonLiveTransitions(). All JSObject maps | 168 // in ClearNonLiveTransitions(). All JSObject maps |
| 161 // connected by map transitions have the same prototype object, which | 169 // connected by map transitions have the same prototype object, which |
| 162 // is why we can use this field temporarily for back pointers. | 170 // is why we can use this field temporarily for back pointers. |
| 163 static void CreateBackPointers(); | 171 static void CreateBackPointers(); |
| 164 | 172 |
| 165 // Mark a Map and its DescriptorArray together, skipping transitions. | 173 // Mark a Map and its DescriptorArray together, skipping transitions. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 382 |
| 375 friend class UnmarkObjectVisitor; | 383 friend class UnmarkObjectVisitor; |
| 376 static void UnmarkObject(HeapObject* obj); | 384 static void UnmarkObject(HeapObject* obj); |
| 377 #endif | 385 #endif |
| 378 }; | 386 }; |
| 379 | 387 |
| 380 | 388 |
| 381 } } // namespace v8::internal | 389 } } // namespace v8::internal |
| 382 | 390 |
| 383 #endif // V8_MARK_COMPACT_H_ | 391 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |