OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/heap/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 Page* p = it.next(); | 341 Page* p = it.next(); |
342 SetOldSpacePageFlags(p, false, false); | 342 SetOldSpacePageFlags(p, false, false); |
343 } | 343 } |
344 } | 344 } |
345 | 345 |
346 | 346 |
347 void IncrementalMarking::DeactivateIncrementalWriteBarrierForSpace( | 347 void IncrementalMarking::DeactivateIncrementalWriteBarrierForSpace( |
348 NewSpace* space) { | 348 NewSpace* space) { |
349 NewSpacePageIterator it(space); | 349 NewSpacePageIterator it(space); |
350 while (it.has_next()) { | 350 while (it.has_next()) { |
351 NewSpacePage* p = it.next(); | 351 Page* p = it.next(); |
352 SetNewSpacePageFlags(p, false); | 352 SetNewSpacePageFlags(p, false); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 | 356 |
357 void IncrementalMarking::DeactivateIncrementalWriteBarrier() { | 357 void IncrementalMarking::DeactivateIncrementalWriteBarrier() { |
358 DeactivateIncrementalWriteBarrierForSpace(heap_->old_space()); | 358 DeactivateIncrementalWriteBarrierForSpace(heap_->old_space()); |
359 DeactivateIncrementalWriteBarrierForSpace(heap_->map_space()); | 359 DeactivateIncrementalWriteBarrierForSpace(heap_->map_space()); |
360 DeactivateIncrementalWriteBarrierForSpace(heap_->code_space()); | 360 DeactivateIncrementalWriteBarrierForSpace(heap_->code_space()); |
361 DeactivateIncrementalWriteBarrierForSpace(heap_->new_space()); | 361 DeactivateIncrementalWriteBarrierForSpace(heap_->new_space()); |
362 | 362 |
363 LargePage* lop = heap_->lo_space()->first_page(); | 363 LargePage* lop = heap_->lo_space()->first_page(); |
364 while (lop->is_valid()) { | 364 while (LargePage::IsValid(lop)) { |
365 SetOldSpacePageFlags(lop, false, false); | 365 SetOldSpacePageFlags(lop, false, false); |
366 lop = lop->next_page(); | 366 lop = lop->next_page(); |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 void IncrementalMarking::ActivateIncrementalWriteBarrier(PagedSpace* space) { | 371 void IncrementalMarking::ActivateIncrementalWriteBarrier(PagedSpace* space) { |
372 PageIterator it(space); | 372 PageIterator it(space); |
373 while (it.has_next()) { | 373 while (it.has_next()) { |
374 Page* p = it.next(); | 374 Page* p = it.next(); |
375 SetOldSpacePageFlags(p, true, is_compacting_); | 375 SetOldSpacePageFlags(p, true, is_compacting_); |
376 } | 376 } |
377 } | 377 } |
378 | 378 |
379 | 379 |
380 void IncrementalMarking::ActivateIncrementalWriteBarrier(NewSpace* space) { | 380 void IncrementalMarking::ActivateIncrementalWriteBarrier(NewSpace* space) { |
381 NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd()); | 381 NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd()); |
382 while (it.has_next()) { | 382 while (it.has_next()) { |
383 NewSpacePage* p = it.next(); | 383 Page* p = it.next(); |
384 SetNewSpacePageFlags(p, true); | 384 SetNewSpacePageFlags(p, true); |
385 } | 385 } |
386 } | 386 } |
387 | 387 |
388 | 388 |
389 void IncrementalMarking::ActivateIncrementalWriteBarrier() { | 389 void IncrementalMarking::ActivateIncrementalWriteBarrier() { |
390 ActivateIncrementalWriteBarrier(heap_->old_space()); | 390 ActivateIncrementalWriteBarrier(heap_->old_space()); |
391 ActivateIncrementalWriteBarrier(heap_->map_space()); | 391 ActivateIncrementalWriteBarrier(heap_->map_space()); |
392 ActivateIncrementalWriteBarrier(heap_->code_space()); | 392 ActivateIncrementalWriteBarrier(heap_->code_space()); |
393 ActivateIncrementalWriteBarrier(heap_->new_space()); | 393 ActivateIncrementalWriteBarrier(heap_->new_space()); |
394 | 394 |
395 LargePage* lop = heap_->lo_space()->first_page(); | 395 LargePage* lop = heap_->lo_space()->first_page(); |
396 while (lop->is_valid()) { | 396 while (LargePage::IsValid(lop)) { |
397 SetOldSpacePageFlags(lop, true, is_compacting_); | 397 SetOldSpacePageFlags(lop, true, is_compacting_); |
398 lop = lop->next_page(); | 398 lop = lop->next_page(); |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 | 402 |
403 bool IncrementalMarking::ShouldActivateEvenWithoutIdleNotification() { | 403 bool IncrementalMarking::ShouldActivateEvenWithoutIdleNotification() { |
404 #ifndef DEBUG | 404 #ifndef DEBUG |
405 static const intptr_t kActivationThreshold = 8 * MB; | 405 static const intptr_t kActivationThreshold = 8 * MB; |
406 #else | 406 #else |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1240 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1241 idle_marking_delay_counter_++; | 1241 idle_marking_delay_counter_++; |
1242 } | 1242 } |
1243 | 1243 |
1244 | 1244 |
1245 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1245 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1246 idle_marking_delay_counter_ = 0; | 1246 idle_marking_delay_counter_ = 0; |
1247 } | 1247 } |
1248 } // namespace internal | 1248 } // namespace internal |
1249 } // namespace v8 | 1249 } // namespace v8 |
OLD | NEW |