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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 while (work_to_do) { | 1274 while (work_to_do) { |
1275 MarkObjectGroups(); | 1275 MarkObjectGroups(); |
1276 work_to_do = !marking_stack.is_empty(); | 1276 work_to_do = !marking_stack.is_empty(); |
1277 ProcessMarkingStack(); | 1277 ProcessMarkingStack(); |
1278 } | 1278 } |
1279 } | 1279 } |
1280 | 1280 |
1281 | 1281 |
1282 void MarkCompactCollector::MarkLiveObjects() { | 1282 void MarkCompactCollector::MarkLiveObjects() { |
1283 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK); | 1283 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK); |
| 1284 // The recursive GC marker detects when it is nearing stack overflow, |
| 1285 // and switches to a different marking system. JS interrupts interfere |
| 1286 // with the C stack limit check. |
| 1287 PostponeInterruptsScope postpone; |
| 1288 |
1284 #ifdef DEBUG | 1289 #ifdef DEBUG |
1285 ASSERT(state_ == PREPARE_GC); | 1290 ASSERT(state_ == PREPARE_GC); |
1286 state_ = MARK_LIVE_OBJECTS; | 1291 state_ = MARK_LIVE_OBJECTS; |
1287 #endif | 1292 #endif |
1288 // The to space contains live objects, the from space is used as a marking | 1293 // The to space contains live objects, the from space is used as a marking |
1289 // stack. | 1294 // stack. |
1290 marking_stack.Initialize(Heap::new_space()->FromSpaceLow(), | 1295 marking_stack.Initialize(Heap::new_space()->FromSpaceLow(), |
1291 Heap::new_space()->FromSpaceHigh()); | 1296 Heap::new_space()->FromSpaceHigh()); |
1292 | 1297 |
1293 ASSERT(!marking_stack.overflowed()); | 1298 ASSERT(!marking_stack.overflowed()); |
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2918 } | 2923 } |
2919 | 2924 |
2920 | 2925 |
2921 void MarkCompactCollector::Initialize() { | 2926 void MarkCompactCollector::Initialize() { |
2922 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 2927 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
2923 StaticMarkingVisitor::Initialize(); | 2928 StaticMarkingVisitor::Initialize(); |
2924 } | 2929 } |
2925 | 2930 |
2926 | 2931 |
2927 } } // namespace v8::internal | 2932 } } // namespace v8::internal |
OLD | NEW |