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

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

Issue 890613002: Introduce ProcessYoungWeakReferences and process weak list of allocation sites just during full GCs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 InternalizedStringTableCleaner internalized_visitor(heap()); 2269 InternalizedStringTableCleaner internalized_visitor(heap());
2270 string_table->IterateElements(&internalized_visitor); 2270 string_table->IterateElements(&internalized_visitor);
2271 string_table->ElementsRemoved(internalized_visitor.PointersRemoved()); 2271 string_table->ElementsRemoved(internalized_visitor.PointersRemoved());
2272 2272
2273 ExternalStringTableCleaner external_visitor(heap()); 2273 ExternalStringTableCleaner external_visitor(heap());
2274 heap()->external_string_table_.Iterate(&external_visitor); 2274 heap()->external_string_table_.Iterate(&external_visitor);
2275 heap()->external_string_table_.CleanUp(); 2275 heap()->external_string_table_.CleanUp();
2276 2276
2277 // Process the weak references. 2277 // Process the weak references.
2278 MarkCompactWeakObjectRetainer mark_compact_object_retainer; 2278 MarkCompactWeakObjectRetainer mark_compact_object_retainer;
2279 heap()->ProcessWeakReferences(&mark_compact_object_retainer); 2279 heap()->ProcessAllWeakReferences(&mark_compact_object_retainer);
2280 2280
2281 // Remove object groups after marking phase. 2281 // Remove object groups after marking phase.
2282 heap()->isolate()->global_handles()->RemoveObjectGroups(); 2282 heap()->isolate()->global_handles()->RemoveObjectGroups();
2283 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); 2283 heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
2284 2284
2285 // Flush code from collected candidates. 2285 // Flush code from collected candidates.
2286 if (is_code_flushing_enabled()) { 2286 if (is_code_flushing_enabled()) {
2287 code_flusher_->ProcessCandidates(); 2287 code_flusher_->ProcessCandidates();
2288 // If incremental marker does not support code flushing, we need to 2288 // If incremental marker does not support code flushing, we need to
2289 // disable it before incremental marking steps for next cycle. 2289 // disable it before incremental marking steps for next cycle.
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
3539 WeakHashTable::cast(heap_->weak_object_to_code_table()); 3539 WeakHashTable::cast(heap_->weak_object_to_code_table());
3540 table->Iterate(&updating_visitor); 3540 table->Iterate(&updating_visitor);
3541 table->Rehash(heap_->isolate()->factory()->undefined_value()); 3541 table->Rehash(heap_->isolate()->factory()->undefined_value());
3542 } 3542 }
3543 3543
3544 // Update pointers from external string table. 3544 // Update pointers from external string table.
3545 heap_->UpdateReferencesInExternalStringTable( 3545 heap_->UpdateReferencesInExternalStringTable(
3546 &UpdateReferenceInExternalStringTableEntry); 3546 &UpdateReferenceInExternalStringTableEntry);
3547 3547
3548 EvacuationWeakObjectRetainer evacuation_object_retainer; 3548 EvacuationWeakObjectRetainer evacuation_object_retainer;
3549 heap()->ProcessWeakReferences(&evacuation_object_retainer); 3549 heap()->ProcessAllWeakReferences(&evacuation_object_retainer);
3550 3550
3551 // Visit invalidated code (we ignored all slots on it) and clear mark-bits 3551 // Visit invalidated code (we ignored all slots on it) and clear mark-bits
3552 // under it. 3552 // under it.
3553 ProcessInvalidatedCode(&updating_visitor); 3553 ProcessInvalidatedCode(&updating_visitor);
3554 3554
3555 heap_->isolate()->inner_pointer_to_code_cache()->Flush(); 3555 heap_->isolate()->inner_pointer_to_code_cache()->Flush();
3556 3556
3557 slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_); 3557 slots_buffer_allocator_.DeallocateChain(&migration_slots_buffer_);
3558 DCHECK(migration_slots_buffer_ == NULL); 3558 DCHECK(migration_slots_buffer_ == NULL);
3559 } 3559 }
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
4403 SlotsBuffer* buffer = *buffer_address; 4403 SlotsBuffer* buffer = *buffer_address;
4404 while (buffer != NULL) { 4404 while (buffer != NULL) {
4405 SlotsBuffer* next_buffer = buffer->next(); 4405 SlotsBuffer* next_buffer = buffer->next();
4406 DeallocateBuffer(buffer); 4406 DeallocateBuffer(buffer);
4407 buffer = next_buffer; 4407 buffer = next_buffer;
4408 } 4408 }
4409 *buffer_address = NULL; 4409 *buffer_address = NULL;
4410 } 4410 }
4411 } 4411 }
4412 } // namespace v8::internal 4412 } // 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