Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: src/heap/mark-compact.cc

Issue 885553005: Collect phantom callback data only once during gc. For scavenges, just consider the young handles r… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@weak-allocation-sites
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 DCHECK(heap_->incremental_marking()->IsStopped()); 302 DCHECK(heap_->incremental_marking()->IsStopped());
303 303
304 if (FLAG_collect_maps) ClearNonLiveReferences(); 304 if (FLAG_collect_maps) ClearNonLiveReferences();
305 305
306 ProcessAndClearWeakCells(); 306 ProcessAndClearWeakCells();
307 307
308 ClearWeakCollections(); 308 ClearWeakCollections();
309 309
310 heap_->set_encountered_weak_cells(Smi::FromInt(0)); 310 heap_->set_encountered_weak_cells(Smi::FromInt(0));
311 311
312 isolate()->global_handles()->CollectPhantomCallbackData();
313
314 #ifdef VERIFY_HEAP 312 #ifdef VERIFY_HEAP
315 if (FLAG_verify_heap) { 313 if (FLAG_verify_heap) {
316 VerifyMarking(heap_); 314 VerifyMarking(heap_);
317 } 315 }
318 #endif 316 #endif
319 317
320 SweepSpaces(); 318 SweepSpaces();
321 319
322 #ifdef VERIFY_HEAP 320 #ifdef VERIFY_HEAP
323 if (heap()->weak_embedded_objects_verification_enabled()) { 321 if (heap()->weak_embedded_objects_verification_enabled()) {
(...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3541 table->Rehash(heap_->isolate()->factory()->undefined_value()); 3539 table->Rehash(heap_->isolate()->factory()->undefined_value());
3542 } 3540 }
3543 3541
3544 // Update pointers from external string table. 3542 // Update pointers from external string table.
3545 heap_->UpdateReferencesInExternalStringTable( 3543 heap_->UpdateReferencesInExternalStringTable(
3546 &UpdateReferenceInExternalStringTableEntry); 3544 &UpdateReferenceInExternalStringTableEntry);
3547 3545
3548 EvacuationWeakObjectRetainer evacuation_object_retainer; 3546 EvacuationWeakObjectRetainer evacuation_object_retainer;
3549 heap()->ProcessAllWeakReferences(&evacuation_object_retainer); 3547 heap()->ProcessAllWeakReferences(&evacuation_object_retainer);
3550 3548
3549 // Collects callback info for handles that are pending (about to be
3550 // collected) and either phantom or internal-fields. Releases the global
3551 // handles. See also PostGarbageCollectionProcessing.
3552 isolate()->global_handles()->CollectAllPhantomCallbackData();
3553
3551 // Visit invalidated code (we ignored all slots on it) and clear mark-bits 3554 // Visit invalidated code (we ignored all slots on it) and clear mark-bits
3552 // under it. 3555 // under it.
3553 ProcessInvalidatedCode(&updating_visitor); 3556 ProcessInvalidatedCode(&updating_visitor);
3554 3557
3555 heap_->isolate()->inner_pointer_to_code_cache()->Flush(); 3558 heap_->isolate()->inner_pointer_to_code_cache()->Flush();
3556 3559
3557 slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_); 3560 slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_);
3558 DCHECK(migration_slots_buffer_ == NULL); 3561 DCHECK(migration_slots_buffer_ == NULL);
3559 } 3562 }
3560 3563
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
4403 SlotsBuffer* buffer = *buffer_address; 4406 SlotsBuffer* buffer = *buffer_address;
4404 while (buffer != NULL) { 4407 while (buffer != NULL) {
4405 SlotsBuffer* next_buffer = buffer->next(); 4408 SlotsBuffer* next_buffer = buffer->next();
4406 DeallocateBuffer(buffer); 4409 DeallocateBuffer(buffer);
4407 buffer = next_buffer; 4410 buffer = next_buffer;
4408 } 4411 }
4409 *buffer_address = NULL; 4412 *buffer_address = NULL;
4410 } 4413 }
4411 } 4414 }
4412 } // namespace v8::internal 4415 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698