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

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

Issue 273653006: Cleaned up the weak lists hanging off the heap a bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/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 "v8.h" 5 #include "v8.h"
6 6
7 #include "code-stubs.h" 7 #include "code-stubs.h"
8 #include "compilation-cache.h" 8 #include "compilation-cache.h"
9 #include "cpu-profiler.h" 9 #include "cpu-profiler.h"
10 #include "deoptimizer.h" 10 #include "deoptimizer.h"
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 } 2476 }
2477 } 2477 }
2478 2478
2479 if (FLAG_track_gc_object_stats) { 2479 if (FLAG_track_gc_object_stats) {
2480 heap()->CheckpointObjectStats(); 2480 heap()->CheckpointObjectStats();
2481 } 2481 }
2482 } 2482 }
2483 2483
2484 2484
2485 void MarkCompactCollector::ProcessMapCaches() { 2485 void MarkCompactCollector::ProcessMapCaches() {
2486 Object* raw_context = heap()->native_contexts_list_; 2486 Object* raw_context = heap()->native_contexts_list();
2487 while (raw_context != heap()->undefined_value()) { 2487 while (raw_context != heap()->undefined_value()) {
2488 Context* context = reinterpret_cast<Context*>(raw_context); 2488 Context* context = reinterpret_cast<Context*>(raw_context);
2489 if (IsMarked(context)) { 2489 if (IsMarked(context)) {
2490 HeapObject* raw_map_cache = 2490 HeapObject* raw_map_cache =
2491 HeapObject::cast(context->get(Context::MAP_CACHE_INDEX)); 2491 HeapObject::cast(context->get(Context::MAP_CACHE_INDEX));
2492 // A map cache may be reachable from the stack. In this case 2492 // A map cache may be reachable from the stack. In this case
2493 // it's already transitively marked and it's too late to clean 2493 // it's already transitively marked and it's too late to clean
2494 // up its parts. 2494 // up its parts.
2495 if (!IsMarked(raw_map_cache) && 2495 if (!IsMarked(raw_map_cache) &&
2496 raw_map_cache != heap()->undefined_value()) { 2496 raw_map_cache != heap()->undefined_value()) {
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3635 HeapObjectIterator js_global_property_cell_iterator( 3635 HeapObjectIterator js_global_property_cell_iterator(
3636 heap_->property_cell_space()); 3636 heap_->property_cell_space());
3637 for (HeapObject* cell = js_global_property_cell_iterator.Next(); 3637 for (HeapObject* cell = js_global_property_cell_iterator.Next();
3638 cell != NULL; 3638 cell != NULL;
3639 cell = js_global_property_cell_iterator.Next()) { 3639 cell = js_global_property_cell_iterator.Next()) {
3640 if (cell->IsPropertyCell()) { 3640 if (cell->IsPropertyCell()) {
3641 PropertyCell::BodyDescriptor::IterateBody(cell, &updating_visitor); 3641 PropertyCell::BodyDescriptor::IterateBody(cell, &updating_visitor);
3642 } 3642 }
3643 } 3643 }
3644 3644
3645 // Update the head of the native contexts list in the heap.
3646 updating_visitor.VisitPointer(heap_->native_contexts_list_address());
3647
3648 heap_->string_table()->Iterate(&updating_visitor); 3645 heap_->string_table()->Iterate(&updating_visitor);
3649 updating_visitor.VisitPointer(heap_->weak_object_to_code_table_address()); 3646 updating_visitor.VisitPointer(heap_->weak_object_to_code_table_address());
3650 if (heap_->weak_object_to_code_table()->IsHashTable()) { 3647 if (heap_->weak_object_to_code_table()->IsHashTable()) {
3651 WeakHashTable* table = 3648 WeakHashTable* table =
3652 WeakHashTable::cast(heap_->weak_object_to_code_table()); 3649 WeakHashTable::cast(heap_->weak_object_to_code_table());
3653 table->Iterate(&updating_visitor); 3650 table->Iterate(&updating_visitor);
3654 table->Rehash(heap_->isolate()->factory()->undefined_value()); 3651 table->Rehash(heap_->isolate()->factory()->undefined_value());
3655 } 3652 }
3656 3653
3657 // Update pointers from external string table. 3654 // Update pointers from external string table.
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
4534 while (buffer != NULL) { 4531 while (buffer != NULL) {
4535 SlotsBuffer* next_buffer = buffer->next(); 4532 SlotsBuffer* next_buffer = buffer->next();
4536 DeallocateBuffer(buffer); 4533 DeallocateBuffer(buffer);
4537 buffer = next_buffer; 4534 buffer = next_buffer;
4538 } 4535 }
4539 *buffer_address = NULL; 4536 *buffer_address = NULL;
4540 } 4537 }
4541 4538
4542 4539
4543 } } // namespace v8::internal 4540 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698