blob: 1b7e60022e57674093ab5b87a1e53da542759b9a [file] [log] [blame]
ager@chromium.org9258b6b2008-09-11 09:11:10 +00001// Copyright 2006-2008 the V8 project authors. All rights reserved.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +00002// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28#ifndef V8_MARK_COMPACT_H_
29#define V8_MARK_COMPACT_H_
30
kasperl@chromium.org71affb52009-05-26 05:44:31 +000031namespace v8 {
32namespace internal {
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000033
34// Callback function, returns whether an object is alive. The heap size
35// of the object is returned in size. It optionally updates the offset
36// to the first live object in the page (only used for old and map objects).
37typedef bool (*IsAliveFunction)(HeapObject* obj, int* size, int* offset);
38
mads.s.ager31e71382008-08-13 09:32:07 +000039// Forward declarations.
40class RootMarkingVisitor;
kasper.lund7276f142008-07-30 08:49:36 +000041class MarkingVisitor;
42
mads.s.ager31e71382008-08-13 09:32:07 +000043
ager@chromium.orgddb913d2009-01-27 10:01:48 +000044// -------------------------------------------------------------------------
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000045// Mark-Compact collector
46//
47// All methods are static.
48
ager@chromium.orgddb913d2009-01-27 10:01:48 +000049class MarkCompactCollector: public AllStatic {
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000050 public:
51 // Type of functions to compute forwarding addresses of objects in
52 // compacted spaces. Given an object and its size, return a (non-failure)
53 // Object* that will be the object after forwarding. There is a separate
54 // allocation function for each (compactable) space based on the location
55 // of the object before compaction.
lrn@chromium.org303ada72010-10-27 09:33:13 +000056 typedef MaybeObject* (*AllocationFunction)(HeapObject* object,
57 int object_size);
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000058
59 // Type of functions to encode the forwarding address for an object.
60 // Given the object, its size, and the new (non-failure) object it will be
61 // forwarded to, encode the forwarding address. For paged spaces, the
62 // 'offset' input/output parameter contains the offset of the forwarded
63 // object from the forwarding address of the previous live object in the
64 // page as input, and is updated to contain the offset to be used for the
65 // next live object in the same page. For spaces using a different
66 // encoding (ie, contiguous spaces), the offset parameter is ignored.
67 typedef void (*EncodingFunction)(HeapObject* old_object,
68 int object_size,
69 Object* new_object,
70 int* offset);
71
72 // Type of functions to process non-live objects.
73 typedef void (*ProcessNonLiveFunction)(HeapObject* object);
74
sgjesse@chromium.orgc81c8942009-08-21 10:54:26 +000075 // Set the global force_compaction flag, it must be called before Prepare
76 // to take effect.
77 static void SetForceCompaction(bool value) {
78 force_compaction_ = value;
79 }
80
ager@chromium.orgea4f62e2010-08-16 16:28:43 +000081
82 static void Initialize();
83
kasperl@chromium.org061ef742009-02-27 12:16:20 +000084 // Prepares for GC by resetting relocation info in old and map spaces and
85 // choosing spaces to compact.
86 static void Prepare(GCTracer* tracer);
87
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000088 // Performs a global garbage collection.
kasperl@chromium.org061ef742009-02-27 12:16:20 +000089 static void CollectGarbage();
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +000090
91 // True if the last full GC performed heap compaction.
92 static bool HasCompacted() { return compacting_collection_; }
93
94 // True after the Prepare phase if the compaction is taking place.
fschneider@chromium.org0c20e672010-01-14 15:28:53 +000095 static bool IsCompacting() {
96#ifdef DEBUG
97 // For the purposes of asserts we don't want this to keep returning true
98 // after the collection is completed.
99 return state_ != IDLE && compacting_collection_;
100#else
101 return compacting_collection_;
102#endif
103 }
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000104
kasper.lund7276f142008-07-30 08:49:36 +0000105 // The count of the number of objects left marked at the end of the last
106 // completed full GC (expected to be zero).
107 static int previous_marked_count() { return previous_marked_count_; }
108
109 // During a full GC, there is a stack-allocated GCTracer that is used for
110 // bookkeeping information. Return a pointer to that tracer.
111 static GCTracer* tracer() { return tracer_; }
112
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000113#ifdef DEBUG
114 // Checks whether performing mark-compact collection.
115 static bool in_use() { return state_ > PREPARE_GC; }
ricow@chromium.orgd236f4d2010-09-01 06:52:08 +0000116 static bool are_map_pointers_encoded() { return state_ == UPDATE_POINTERS; }
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000117#endif
118
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +0000119 // Determine type of object and emit deletion log event.
120 static void ReportDeleteIfNeeded(HeapObject* obj);
121
erik.corry@gmail.com4a6c3272010-11-18 12:04:40 +0000122 // Returns size of a possibly marked object.
123 static int SizeOfMarkedObject(HeapObject* obj);
124
ricow@chromium.orgd236f4d2010-09-01 06:52:08 +0000125 // Distinguishable invalid map encodings (for single word and multiple words)
126 // that indicate free regions.
127 static const uint32_t kSingleFreeEncoding = 0;
128 static const uint32_t kMultiFreeEncoding = 1;
129
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000130 private:
131#ifdef DEBUG
132 enum CollectorState {
133 IDLE,
134 PREPARE_GC,
135 MARK_LIVE_OBJECTS,
136 SWEEP_SPACES,
137 ENCODE_FORWARDING_ADDRESSES,
138 UPDATE_POINTERS,
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000139 RELOCATE_OBJECTS
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000140 };
141
142 // The current stage of the collector.
143 static CollectorState state_;
144#endif
sgjesse@chromium.orgc81c8942009-08-21 10:54:26 +0000145
146 // Global flag that forces a compaction.
147 static bool force_compaction_;
148
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000149 // Global flag indicating whether spaces were compacted on the last GC.
150 static bool compacting_collection_;
151
ager@chromium.orga1645e22009-09-09 19:27:10 +0000152 // Global flag indicating whether spaces will be compacted on the next GC.
153 static bool compact_on_next_gc_;
154
kasper.lund7276f142008-07-30 08:49:36 +0000155 // The number of objects left marked at the end of the last completed full
156 // GC (expected to be zero).
157 static int previous_marked_count_;
158
159 // A pointer to the current stack-allocated GC tracer object during a full
160 // collection (NULL before and after).
161 static GCTracer* tracer_;
162
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000163 // Finishes GC, performs heap verification if enabled.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000164 static void Finish();
165
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000166 // -----------------------------------------------------------------------
167 // Phase 1: Marking live objects.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000168 //
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000169 // Before: The heap has been prepared for garbage collection by
170 // MarkCompactCollector::Prepare() and is otherwise in its
171 // normal state.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000172 //
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000173 // After: Live objects are marked and non-live objects are unmarked.
174
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000175
mads.s.ager31e71382008-08-13 09:32:07 +0000176 friend class RootMarkingVisitor;
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000177 friend class MarkingVisitor;
ager@chromium.orgea4f62e2010-08-16 16:28:43 +0000178 friend class StaticMarkingVisitor;
ricow@chromium.org0b9f8502010-08-18 07:45:01 +0000179 friend class CodeMarkingVisitor;
180 friend class SharedFunctionInfoMarkingVisitor;
181
182 static void PrepareForCodeFlushing();
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000183
184 // Marking operations for objects reachable from roots.
185 static void MarkLiveObjects();
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000186
187 static void MarkUnmarkedObject(HeapObject* obj);
188
189 static inline void MarkObject(HeapObject* obj) {
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000190 if (!obj->IsMarked()) MarkUnmarkedObject(obj);
191 }
192
193 static inline void SetMark(HeapObject* obj) {
194 tracer_->increment_marked_count();
195#ifdef DEBUG
ager@chromium.org9085a012009-05-11 19:22:57 +0000196 UpdateLiveObjectCount(obj);
ager@chromium.org3bf7b912008-11-17 09:09:45 +0000197#endif
198 obj->SetMark();
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000199 }
200
kasperl@chromium.org9bbf9682008-10-30 11:53:07 +0000201 // Creates back pointers for all map transitions, stores them in
202 // the prototype field. The original prototype pointers are restored
203 // in ClearNonLiveTransitions(). All JSObject maps
204 // connected by map transitions have the same prototype object, which
205 // is why we can use this field temporarily for back pointers.
206 static void CreateBackPointers();
207
208 // Mark a Map and its DescriptorArray together, skipping transitions.
209 static void MarkMapContents(Map* map);
210 static void MarkDescriptorArray(DescriptorArray* descriptors);
211
mads.s.ager31e71382008-08-13 09:32:07 +0000212 // Mark the heap roots and all objects reachable from them.
ager@chromium.org5ec48922009-05-05 07:25:34 +0000213 static void MarkRoots(RootMarkingVisitor* visitor);
214
215 // Mark the symbol table specially. References to symbols from the
216 // symbol table are weak.
217 static void MarkSymbolTable();
kasper.lund7276f142008-07-30 08:49:36 +0000218
219 // Mark objects in object groups that have at least one object in the
220 // group marked.
221 static void MarkObjectGroups();
222
223 // Mark all objects in an object group with at least one marked
224 // object, then all objects reachable from marked objects in object
225 // groups, and repeat.
ager@chromium.orgea4f62e2010-08-16 16:28:43 +0000226 static void ProcessObjectGroups();
kasper.lund7276f142008-07-30 08:49:36 +0000227
mads.s.ager31e71382008-08-13 09:32:07 +0000228 // Mark objects reachable (transitively) from objects in the marking stack
229 // or overflowed in the heap.
ager@chromium.orgea4f62e2010-08-16 16:28:43 +0000230 static void ProcessMarkingStack();
mads.s.ager31e71382008-08-13 09:32:07 +0000231
232 // Mark objects reachable (transitively) from objects in the marking
233 // stack. This function empties the marking stack, but may leave
234 // overflowed objects in the heap, in which case the marking stack's
235 // overflow flag will be set.
ager@chromium.orgea4f62e2010-08-16 16:28:43 +0000236 static void EmptyMarkingStack();
mads.s.ager31e71382008-08-13 09:32:07 +0000237
238 // Refill the marking stack with overflowed objects from the heap. This
239 // function either leaves the marking stack full or clears the overflow
240 // flag on the marking stack.
241 static void RefillMarkingStack();
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000242
ager@chromium.org9085a012009-05-11 19:22:57 +0000243 // Callback function for telling whether the object *p is an unmarked
244 // heap object.
245 static bool IsUnmarkedHeapObject(Object** p);
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000246
247#ifdef DEBUG
ager@chromium.org9085a012009-05-11 19:22:57 +0000248 static void UpdateLiveObjectCount(HeapObject* obj);
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000249#endif
250
251 // We sweep the large object space in the same way whether we are
252 // compacting or not, because the large object space is never compacted.
253 static void SweepLargeObjectSpace();
254
kasperl@chromium.org9bbf9682008-10-30 11:53:07 +0000255 // Test whether a (possibly marked) object is a Map.
256 static inline bool SafeIsMap(HeapObject* object);
257
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000258 // Map transitions from a live map to a dead map must be killed.
kasperl@chromium.org9bbf9682008-10-30 11:53:07 +0000259 // We replace them with a null descriptor, with the same key.
260 static void ClearNonLiveTransitions();
261
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000262 // -----------------------------------------------------------------------
263 // Phase 2: Sweeping to clear mark bits and free non-live objects for
264 // a non-compacting collection, or else computing and encoding
265 // forwarding addresses for a compacting collection.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000266 //
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000267 // Before: Live objects are marked and non-live objects are unmarked.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000268 //
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000269 // After: (Non-compacting collection.) Live objects are unmarked,
270 // non-live regions have been added to their space's free
271 // list.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000272 //
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000273 // After: (Compacting collection.) The forwarding address of live
274 // objects in the paged spaces is encoded in their map word
275 // along with their (non-forwarded) map pointer.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000276 //
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000277 // The forwarding address of live objects in the new space is
278 // written to their map word's offset in the inactive
279 // semispace.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000280 //
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000281 // Bookkeeping data is written to the page header of
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000282 // eached paged-space page that contains live objects after
283 // compaction:
284 //
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000285 // The allocation watermark field is used to track the
286 // relocation top address, the address of the first word
287 // after the end of the last live object in the page after
288 // compaction.
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000289 //
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000290 // The Page::mc_page_index field contains the zero-based index of the
291 // page in its space. This word is only used for map space pages, in
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000292 // order to encode the map addresses in 21 bits to free 11
293 // bits per map word for the forwarding address.
294 //
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000295 // The Page::mc_first_forwarded field contains the (nonencoded)
296 // forwarding address of the first live object in the page.
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000297 //
298 // In both the new space and the paged spaces, a linked list
299 // of live regions is constructructed (linked through
300 // pointers in the non-live region immediately following each
301 // live region) to speed further passes of the collector.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000302
303 // Encodes forwarding addresses of objects in compactable parts of the
304 // heap.
305 static void EncodeForwardingAddresses();
306
307 // Encodes the forwarding addresses of objects in new space.
308 static void EncodeForwardingAddressesInNewSpace();
309
310 // Function template to encode the forwarding addresses of objects in
311 // paged spaces, parameterized by allocation and non-live processing
312 // functions.
313 template<AllocationFunction Alloc, ProcessNonLiveFunction ProcessNonLive>
314 static void EncodeForwardingAddressesInPagedSpace(PagedSpace* space);
315
316 // Iterates live objects in a space, passes live objects
317 // to a callback function which returns the heap size of the object.
318 // Returns the number of live objects iterated.
319 static int IterateLiveObjects(NewSpace* space, HeapObjectCallback size_f);
320 static int IterateLiveObjects(PagedSpace* space, HeapObjectCallback size_f);
321
322 // Iterates the live objects between a range of addresses, returning the
323 // number of live objects.
324 static int IterateLiveObjectsInRange(Address start, Address end,
325 HeapObjectCallback size_func);
326
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000327 // If we are not compacting the heap, we simply sweep the spaces except
328 // for the large object space, clearing mark bits and adding unmarked
329 // regions to each space's free list.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000330 static void SweepSpaces();
331
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000332 // -----------------------------------------------------------------------
333 // Phase 3: Updating pointers in live objects.
334 //
335 // Before: Same as after phase 2 (compacting collection).
336 //
337 // After: All pointers in live objects, including encoded map
338 // pointers, are updated to point to their target's new
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000339 // location.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000340
341 friend class UpdatingVisitor; // helper for updating visited objects
342
343 // Updates pointers in all spaces.
344 static void UpdatePointers();
345
346 // Updates pointers in an object in new space.
347 // Returns the heap size of the object.
348 static int UpdatePointersInNewObject(HeapObject* obj);
349
350 // Updates pointers in an object in old spaces.
351 // Returns the heap size of the object.
352 static int UpdatePointersInOldObject(HeapObject* obj);
353
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000354 // Calculates the forwarding address of an object in an old space.
355 static Address GetForwardingAddressInOldSpace(HeapObject* obj);
356
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000357 // -----------------------------------------------------------------------
358 // Phase 4: Relocating objects.
359 //
360 // Before: Pointers to live objects are updated to point to their
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000361 // target's new location.
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000362 //
ricow@chromium.org30ce4112010-05-31 10:38:25 +0000363 // After: Objects have been moved to their new addresses.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000364
365 // Relocates objects in all spaces.
366 static void RelocateObjects();
367
368 // Converts a code object's inline target to addresses, convention from
369 // address to target happens in the marking phase.
370 static int ConvertCodeICTargetToAddress(HeapObject* obj);
371
372 // Relocate a map object.
373 static int RelocateMapObject(HeapObject* obj);
374
375 // Relocates an old object.
ager@chromium.org9258b6b2008-09-11 09:11:10 +0000376 static int RelocateOldPointerObject(HeapObject* obj);
377 static int RelocateOldDataObject(HeapObject* obj);
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000378
kasperl@chromium.orgdefbd102009-07-13 14:04:26 +0000379 // Relocate a property cell object.
380 static int RelocateCellObject(HeapObject* obj);
381
ager@chromium.org9258b6b2008-09-11 09:11:10 +0000382 // Helper function.
kasperl@chromium.orgdefbd102009-07-13 14:04:26 +0000383 static inline int RelocateOldNonCodeObject(HeapObject* obj,
384 PagedSpace* space);
ager@chromium.org9258b6b2008-09-11 09:11:10 +0000385
386 // Relocates an object in the code space.
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000387 static int RelocateCodeObject(HeapObject* obj);
388
389 // Copy a new object.
390 static int RelocateNewObject(HeapObject* obj);
391
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000392#ifdef DEBUG
ager@chromium.orgddb913d2009-01-27 10:01:48 +0000393 // -----------------------------------------------------------------------
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000394 // Debugging variables, functions and classes
395 // Counters used for debugging the marking phase of mark-compact or
396 // mark-sweep collection.
397
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000398 // Size of live objects in Heap::to_space_.
399 static int live_young_objects_size_;
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000400
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000401 // Size of live objects in Heap::old_pointer_space_.
402 static int live_old_pointer_objects_size_;
ager@chromium.org9258b6b2008-09-11 09:11:10 +0000403
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000404 // Size of live objects in Heap::old_data_space_.
405 static int live_old_data_objects_size_;
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000406
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000407 // Size of live objects in Heap::code_space_.
408 static int live_code_objects_size_;
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000409
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000410 // Size of live objects in Heap::map_space_.
411 static int live_map_objects_size_;
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000412
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000413 // Size of live objects in Heap::cell_space_.
414 static int live_cell_objects_size_;
kasperl@chromium.orgdefbd102009-07-13 14:04:26 +0000415
whesse@chromium.orgb6e43bb2010-04-14 09:36:28 +0000416 // Size of live objects in Heap::lo_space_.
417 static int live_lo_objects_size_;
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000418
419 // Number of live bytes in this collection.
420 static int live_bytes_;
421
christian.plesner.hansen43d26ec2008-07-03 15:10:15 +0000422 friend class MarkObjectVisitor;
423 static void VisitObject(HeapObject* obj);
424
425 friend class UnmarkObjectVisitor;
426 static void UnmarkObject(HeapObject* obj);
427#endif
428};
429
430
431} } // namespace v8::internal
432
433#endif // V8_MARK_COMPACT_H_