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/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 338 |
339 MarkLiveObjects(); | 339 MarkLiveObjects(); |
340 | 340 |
341 DCHECK(heap_->incremental_marking()->IsStopped()); | 341 DCHECK(heap_->incremental_marking()->IsStopped()); |
342 | 342 |
343 // ClearNonLiveReferences can deoptimize code in dependent code arrays. | 343 // ClearNonLiveReferences can deoptimize code in dependent code arrays. |
344 // Process weak cells before so that weak cells in dependent code | 344 // Process weak cells before so that weak cells in dependent code |
345 // arrays are cleared or contain only live code objects. | 345 // arrays are cleared or contain only live code objects. |
346 ProcessAndClearWeakCells(); | 346 ProcessAndClearWeakCells(); |
347 | 347 |
348 if (FLAG_collect_maps) ClearNonLiveReferences(); | 348 ClearNonLiveReferences(); |
349 | 349 |
350 ClearWeakCollections(); | 350 ClearWeakCollections(); |
351 | 351 |
352 heap_->set_encountered_weak_cells(Smi::FromInt(0)); | 352 heap_->set_encountered_weak_cells(Smi::FromInt(0)); |
353 | 353 |
354 #ifdef VERIFY_HEAP | 354 #ifdef VERIFY_HEAP |
355 if (FLAG_verify_heap) { | 355 if (FLAG_verify_heap) { |
356 VerifyMarking(heap_); | 356 VerifyMarking(heap_); |
357 } | 357 } |
358 #endif | 358 #endif |
359 | 359 |
360 ClearInvalidStoreAndSlotsBufferEntries(); | 360 ClearInvalidStoreAndSlotsBufferEntries(); |
361 | 361 |
362 #ifdef VERIFY_HEAP | 362 #ifdef VERIFY_HEAP |
363 if (FLAG_verify_heap) { | 363 if (FLAG_verify_heap) { |
364 VerifyValidStoreAndSlotsBufferEntries(heap_); | 364 VerifyValidStoreAndSlotsBufferEntries(heap_); |
365 } | 365 } |
366 #endif | 366 #endif |
367 | 367 |
368 SweepSpaces(); | 368 SweepSpaces(); |
369 | 369 |
370 #ifdef VERIFY_HEAP | 370 #ifdef VERIFY_HEAP |
371 VerifyWeakEmbeddedObjectsInCode(); | 371 VerifyWeakEmbeddedObjectsInCode(); |
372 if (FLAG_collect_maps && FLAG_omit_map_checks_for_leaf_maps) { | 372 if (FLAG_omit_map_checks_for_leaf_maps) { |
373 VerifyOmittedMapChecks(); | 373 VerifyOmittedMapChecks(); |
374 } | 374 } |
375 #endif | 375 #endif |
376 | 376 |
377 Finish(); | 377 Finish(); |
378 | 378 |
379 if (marking_parity_ == EVEN_MARKING_PARITY) { | 379 if (marking_parity_ == EVEN_MARKING_PARITY) { |
380 marking_parity_ = ODD_MARKING_PARITY; | 380 marking_parity_ = ODD_MARKING_PARITY; |
381 } else { | 381 } else { |
382 DCHECK(marking_parity_ == ODD_MARKING_PARITY); | 382 DCHECK(marking_parity_ == ODD_MARKING_PARITY); |
(...skipping 4340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4723 SlotsBuffer* buffer = *buffer_address; | 4723 SlotsBuffer* buffer = *buffer_address; |
4724 while (buffer != NULL) { | 4724 while (buffer != NULL) { |
4725 SlotsBuffer* next_buffer = buffer->next(); | 4725 SlotsBuffer* next_buffer = buffer->next(); |
4726 DeallocateBuffer(buffer); | 4726 DeallocateBuffer(buffer); |
4727 buffer = next_buffer; | 4727 buffer = next_buffer; |
4728 } | 4728 } |
4729 *buffer_address = NULL; | 4729 *buffer_address = NULL; |
4730 } | 4730 } |
4731 } // namespace internal | 4731 } // namespace internal |
4732 } // namespace v8 | 4732 } // namespace v8 |
OLD | NEW |