| 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 "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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |