OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 MarkBit mark = Marking::MarkBitFrom(obj); | 1286 MarkBit mark = Marking::MarkBitFrom(obj); |
1287 heap->mark_compact_collector()->SetMark(obj, mark); | 1287 heap->mark_compact_collector()->SetMark(obj, mark); |
1288 // Mark the map pointer and the body. | 1288 // Mark the map pointer and the body. |
1289 MarkBit map_mark = Marking::MarkBitFrom(map); | 1289 MarkBit map_mark = Marking::MarkBitFrom(map); |
1290 heap->mark_compact_collector()->MarkObject(map, map_mark); | 1290 heap->mark_compact_collector()->MarkObject(map, map_mark); |
1291 IterateBody(map, obj); | 1291 IterateBody(map, obj); |
1292 } | 1292 } |
1293 | 1293 |
1294 // Visit all unmarked objects pointed to by [start, end). | 1294 // Visit all unmarked objects pointed to by [start, end). |
1295 // Returns false if the operation fails (lack of stack space). | 1295 // Returns false if the operation fails (lack of stack space). |
1296 static inline bool VisitUnmarkedObjects(Heap* heap, | 1296 INLINE(static bool VisitUnmarkedObjects(Heap* heap, |
1297 Object** start, | 1297 Object** start, |
1298 Object** end) { | 1298 Object** end)) { |
1299 // Return false is we are close to the stack limit. | 1299 // Return false is we are close to the stack limit. |
1300 StackLimitCheck check(heap->isolate()); | 1300 StackLimitCheck check(heap->isolate()); |
1301 if (check.HasOverflowed()) return false; | 1301 if (check.HasOverflowed()) return false; |
1302 | 1302 |
1303 MarkCompactCollector* collector = heap->mark_compact_collector(); | 1303 MarkCompactCollector* collector = heap->mark_compact_collector(); |
1304 // Visit the unmarked objects. | 1304 // Visit the unmarked objects. |
1305 for (Object** p = start; p < end; p++) { | 1305 for (Object** p = start; p < end; p++) { |
1306 Object* o = *p; | 1306 Object* o = *p; |
1307 if (!o->IsHeapObject()) continue; | 1307 if (!o->IsHeapObject()) continue; |
1308 collector->RecordSlot(start, p, o); | 1308 collector->RecordSlot(start, p, o); |
(...skipping 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4116 while (buffer != NULL) { | 4116 while (buffer != NULL) { |
4117 SlotsBuffer* next_buffer = buffer->next(); | 4117 SlotsBuffer* next_buffer = buffer->next(); |
4118 DeallocateBuffer(buffer); | 4118 DeallocateBuffer(buffer); |
4119 buffer = next_buffer; | 4119 buffer = next_buffer; |
4120 } | 4120 } |
4121 *buffer_address = NULL; | 4121 *buffer_address = NULL; |
4122 } | 4122 } |
4123 | 4123 |
4124 | 4124 |
4125 } } // namespace v8::internal | 4125 } } // namespace v8::internal |
OLD | NEW |