| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/heap/incremental-marking.h" | 7 #include "src/heap/incremental-marking.h" |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 bool is_compacting) { | 295 bool is_compacting) { |
| 296 if (is_marking) { | 296 if (is_marking) { |
| 297 chunk->SetFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); | 297 chunk->SetFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); |
| 298 chunk->SetFlag(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); | 298 chunk->SetFlag(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); |
| 299 | 299 |
| 300 // It's difficult to filter out slots recorded for large objects. | 300 // It's difficult to filter out slots recorded for large objects. |
| 301 if (chunk->owner()->identity() == LO_SPACE && | 301 if (chunk->owner()->identity() == LO_SPACE && |
| 302 chunk->size() > static_cast<size_t>(Page::kPageSize) && is_compacting) { | 302 chunk->size() > static_cast<size_t>(Page::kPageSize) && is_compacting) { |
| 303 chunk->SetFlag(MemoryChunk::RESCAN_ON_EVACUATION); | 303 chunk->SetFlag(MemoryChunk::RESCAN_ON_EVACUATION); |
| 304 } | 304 } |
| 305 } else if (chunk->owner()->identity() == CELL_SPACE || |
| 306 chunk->scan_on_scavenge()) { |
| 307 chunk->ClearFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); |
| 308 chunk->ClearFlag(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); |
| 305 } else { | 309 } else { |
| 306 chunk->ClearFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); | 310 chunk->ClearFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); |
| 307 chunk->SetFlag(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); | 311 chunk->SetFlag(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING); |
| 308 } | 312 } |
| 309 } | 313 } |
| 310 | 314 |
| 311 | 315 |
| 312 void IncrementalMarking::SetNewSpacePageFlags(NewSpacePage* chunk, | 316 void IncrementalMarking::SetNewSpacePageFlags(NewSpacePage* chunk, |
| 313 bool is_marking) { | 317 bool is_marking) { |
| 314 chunk->SetFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); | 318 chunk->SetFlag(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 336 NewSpacePageIterator it(space); | 340 NewSpacePageIterator it(space); |
| 337 while (it.has_next()) { | 341 while (it.has_next()) { |
| 338 NewSpacePage* p = it.next(); | 342 NewSpacePage* p = it.next(); |
| 339 SetNewSpacePageFlags(p, false); | 343 SetNewSpacePageFlags(p, false); |
| 340 } | 344 } |
| 341 } | 345 } |
| 342 | 346 |
| 343 | 347 |
| 344 void IncrementalMarking::DeactivateIncrementalWriteBarrier() { | 348 void IncrementalMarking::DeactivateIncrementalWriteBarrier() { |
| 345 DeactivateIncrementalWriteBarrierForSpace(heap_->old_space()); | 349 DeactivateIncrementalWriteBarrierForSpace(heap_->old_space()); |
| 350 DeactivateIncrementalWriteBarrierForSpace(heap_->cell_space()); |
| 346 DeactivateIncrementalWriteBarrierForSpace(heap_->map_space()); | 351 DeactivateIncrementalWriteBarrierForSpace(heap_->map_space()); |
| 347 DeactivateIncrementalWriteBarrierForSpace(heap_->code_space()); | 352 DeactivateIncrementalWriteBarrierForSpace(heap_->code_space()); |
| 348 DeactivateIncrementalWriteBarrierForSpace(heap_->new_space()); | 353 DeactivateIncrementalWriteBarrierForSpace(heap_->new_space()); |
| 349 | 354 |
| 350 LargePage* lop = heap_->lo_space()->first_page(); | 355 LargePage* lop = heap_->lo_space()->first_page(); |
| 351 while (lop->is_valid()) { | 356 while (lop->is_valid()) { |
| 352 SetOldSpacePageFlags(lop, false, false); | 357 SetOldSpacePageFlags(lop, false, false); |
| 353 lop = lop->next_page(); | 358 lop = lop->next_page(); |
| 354 } | 359 } |
| 355 } | 360 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 368 NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd()); | 373 NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd()); |
| 369 while (it.has_next()) { | 374 while (it.has_next()) { |
| 370 NewSpacePage* p = it.next(); | 375 NewSpacePage* p = it.next(); |
| 371 SetNewSpacePageFlags(p, true); | 376 SetNewSpacePageFlags(p, true); |
| 372 } | 377 } |
| 373 } | 378 } |
| 374 | 379 |
| 375 | 380 |
| 376 void IncrementalMarking::ActivateIncrementalWriteBarrier() { | 381 void IncrementalMarking::ActivateIncrementalWriteBarrier() { |
| 377 ActivateIncrementalWriteBarrier(heap_->old_space()); | 382 ActivateIncrementalWriteBarrier(heap_->old_space()); |
| 383 ActivateIncrementalWriteBarrier(heap_->cell_space()); |
| 378 ActivateIncrementalWriteBarrier(heap_->map_space()); | 384 ActivateIncrementalWriteBarrier(heap_->map_space()); |
| 379 ActivateIncrementalWriteBarrier(heap_->code_space()); | 385 ActivateIncrementalWriteBarrier(heap_->code_space()); |
| 380 ActivateIncrementalWriteBarrier(heap_->new_space()); | 386 ActivateIncrementalWriteBarrier(heap_->new_space()); |
| 381 | 387 |
| 382 LargePage* lop = heap_->lo_space()->first_page(); | 388 LargePage* lop = heap_->lo_space()->first_page(); |
| 383 while (lop->is_valid()) { | 389 while (lop->is_valid()) { |
| 384 SetOldSpacePageFlags(lop, true, is_compacting_); | 390 SetOldSpacePageFlags(lop, true, is_compacting_); |
| 385 lop = lop->next_page(); | 391 lop = lop->next_page(); |
| 386 } | 392 } |
| 387 } | 393 } |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1011 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
| 1006 idle_marking_delay_counter_++; | 1012 idle_marking_delay_counter_++; |
| 1007 } | 1013 } |
| 1008 | 1014 |
| 1009 | 1015 |
| 1010 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1016 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1011 idle_marking_delay_counter_ = 0; | 1017 idle_marking_delay_counter_ = 0; |
| 1012 } | 1018 } |
| 1013 } | 1019 } |
| 1014 } // namespace v8::internal | 1020 } // namespace v8::internal |
| OLD | NEW |