| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // Type of functions to process non-live objects. | 172 // Type of functions to process non-live objects. |
| 173 typedef void (*ProcessNonLiveFunction)(HeapObject* object); | 173 typedef void (*ProcessNonLiveFunction)(HeapObject* object); |
| 174 | 174 |
| 175 // Set the global force_compaction flag, it must be called before Prepare | 175 // Set the global force_compaction flag, it must be called before Prepare |
| 176 // to take effect. | 176 // to take effect. |
| 177 static void SetFlags(int flags) { | 177 static void SetFlags(int flags) { |
| 178 force_compaction_ = ((flags & Heap::kForceCompactionMask) != 0); | 178 force_compaction_ = ((flags & Heap::kForceCompactionMask) != 0); |
| 179 sweep_precisely_ = ((flags & Heap::kMakeHeapIterableMask) != 0); | 179 sweep_precisely_ = ((flags & Heap::kMakeHeapIterableMask) != 0); |
| 180 } | 180 } |
| 181 | 181 |
| 182 static bool PreciseSweepingRequired() { return sweep_precisely_; } |
| 182 | 183 |
| 183 static void Initialize(); | 184 static void Initialize(); |
| 184 | 185 |
| 185 // Prepares for GC by resetting relocation info in old and map spaces and | 186 // Prepares for GC by resetting relocation info in old and map spaces and |
| 186 // choosing spaces to compact. | 187 // choosing spaces to compact. |
| 187 static void Prepare(GCTracer* tracer); | 188 static void Prepare(GCTracer* tracer); |
| 188 | 189 |
| 189 // Performs a global garbage collection. | 190 // Performs a global garbage collection. |
| 190 static void CollectGarbage(); | 191 static void CollectGarbage(); |
| 191 | 192 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 438 |
| 438 friend class UnmarkObjectVisitor; | 439 friend class UnmarkObjectVisitor; |
| 439 static void UnmarkObject(HeapObject* obj); | 440 static void UnmarkObject(HeapObject* obj); |
| 440 #endif | 441 #endif |
| 441 }; | 442 }; |
| 442 | 443 |
| 443 | 444 |
| 444 } } // namespace v8::internal | 445 } } // namespace v8::internal |
| 445 | 446 |
| 446 #endif // V8_MARK_COMPACT_H_ | 447 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |