| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 // object->IsConsString() && !object->IsInternalizedString() && | 1312 // object->IsConsString() && !object->IsInternalizedString() && |
| 1313 // (ConsString::cast(object)->second() == HEAP->empty_string()) | 1313 // (ConsString::cast(object)->second() == HEAP->empty_string()) |
| 1314 // except the maps for the object and its possible substrings might be | 1314 // except the maps for the object and its possible substrings might be |
| 1315 // marked. | 1315 // marked. |
| 1316 HeapObject* object = HeapObject::cast(*p); | 1316 HeapObject* object = HeapObject::cast(*p); |
| 1317 if (!FLAG_clever_optimizations) return object; | 1317 if (!FLAG_clever_optimizations) return object; |
| 1318 Map* map = object->map(); | 1318 Map* map = object->map(); |
| 1319 InstanceType type = map->instance_type(); | 1319 InstanceType type = map->instance_type(); |
| 1320 if ((type & kShortcutTypeMask) != kShortcutTypeTag) return object; | 1320 if ((type & kShortcutTypeMask) != kShortcutTypeTag) return object; |
| 1321 | 1321 |
| 1322 Object* second = reinterpret_cast<ConsString*>(object)->unchecked_second(); | 1322 Object* second = reinterpret_cast<ConsString*>(object)->second(); |
| 1323 Heap* heap = map->GetHeap(); | 1323 Heap* heap = map->GetHeap(); |
| 1324 if (second != heap->empty_string()) { | 1324 if (second != heap->empty_string()) { |
| 1325 return object; | 1325 return object; |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 // Since we don't have the object's start, it is impossible to update the | 1328 // Since we don't have the object's start, it is impossible to update the |
| 1329 // page dirty marks. Therefore, we only replace the string with its left | 1329 // page dirty marks. Therefore, we only replace the string with its left |
| 1330 // substring when page dirty marks do not change. | 1330 // substring when page dirty marks do not change. |
| 1331 Object* first = reinterpret_cast<ConsString*>(object)->unchecked_first(); | 1331 Object* first = reinterpret_cast<ConsString*>(object)->first(); |
| 1332 if (!heap->InNewSpace(object) && heap->InNewSpace(first)) return object; | 1332 if (!heap->InNewSpace(object) && heap->InNewSpace(first)) return object; |
| 1333 | 1333 |
| 1334 *p = first; | 1334 *p = first; |
| 1335 return HeapObject::cast(first); | 1335 return HeapObject::cast(first); |
| 1336 } | 1336 } |
| 1337 | 1337 |
| 1338 | 1338 |
| 1339 class MarkCompactMarkingVisitor | 1339 class MarkCompactMarkingVisitor |
| 1340 : public StaticMarkingVisitor<MarkCompactMarkingVisitor> { | 1340 : public StaticMarkingVisitor<MarkCompactMarkingVisitor> { |
| 1341 public: | 1341 public: |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 VISITOR_ID_LIST(VISITOR_ID_COUNT_FUNCTION) | 1706 VISITOR_ID_LIST(VISITOR_ID_COUNT_FUNCTION) |
| 1707 #undef VISITOR_ID_COUNT_FUNCTION | 1707 #undef VISITOR_ID_COUNT_FUNCTION |
| 1708 } | 1708 } |
| 1709 } | 1709 } |
| 1710 | 1710 |
| 1711 | 1711 |
| 1712 VisitorDispatchTable<MarkCompactMarkingVisitor::Callback> | 1712 VisitorDispatchTable<MarkCompactMarkingVisitor::Callback> |
| 1713 MarkCompactMarkingVisitor::non_count_table_; | 1713 MarkCompactMarkingVisitor::non_count_table_; |
| 1714 | 1714 |
| 1715 | 1715 |
| 1716 class MarkingVisitor : public ObjectVisitor { | |
| 1717 public: | |
| 1718 explicit MarkingVisitor(Heap* heap) : heap_(heap) { } | |
| 1719 | |
| 1720 void VisitPointer(Object** p) { | |
| 1721 MarkCompactMarkingVisitor::VisitPointer(heap_, p); | |
| 1722 } | |
| 1723 | |
| 1724 void VisitPointers(Object** start, Object** end) { | |
| 1725 MarkCompactMarkingVisitor::VisitPointers(heap_, start, end); | |
| 1726 } | |
| 1727 | |
| 1728 private: | |
| 1729 Heap* heap_; | |
| 1730 }; | |
| 1731 | |
| 1732 | |
| 1733 class CodeMarkingVisitor : public ThreadVisitor { | 1716 class CodeMarkingVisitor : public ThreadVisitor { |
| 1734 public: | 1717 public: |
| 1735 explicit CodeMarkingVisitor(MarkCompactCollector* collector) | 1718 explicit CodeMarkingVisitor(MarkCompactCollector* collector) |
| 1736 : collector_(collector) {} | 1719 : collector_(collector) {} |
| 1737 | 1720 |
| 1738 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { | 1721 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { |
| 1739 collector_->PrepareThreadForCodeFlushing(isolate, top); | 1722 collector_->PrepareThreadForCodeFlushing(isolate, top); |
| 1740 } | 1723 } |
| 1741 | 1724 |
| 1742 private: | 1725 private: |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2031 bool MarkCompactCollector::IsUnmarkedHeapObjectWithHeap(Heap* heap, | 2014 bool MarkCompactCollector::IsUnmarkedHeapObjectWithHeap(Heap* heap, |
| 2032 Object** p) { | 2015 Object** p) { |
| 2033 Object* o = *p; | 2016 Object* o = *p; |
| 2034 ASSERT(o->IsHeapObject()); | 2017 ASSERT(o->IsHeapObject()); |
| 2035 HeapObject* heap_object = HeapObject::cast(o); | 2018 HeapObject* heap_object = HeapObject::cast(o); |
| 2036 MarkBit mark = Marking::MarkBitFrom(heap_object); | 2019 MarkBit mark = Marking::MarkBitFrom(heap_object); |
| 2037 return !mark.Get(); | 2020 return !mark.Get(); |
| 2038 } | 2021 } |
| 2039 | 2022 |
| 2040 | 2023 |
| 2041 void MarkCompactCollector::MarkStringTable() { | 2024 void MarkCompactCollector::MarkStringTable(RootMarkingVisitor* visitor) { |
| 2042 StringTable* string_table = heap()->string_table(); | 2025 StringTable* string_table = heap()->string_table(); |
| 2043 // Mark the string table itself. | 2026 // Mark the string table itself. |
| 2044 MarkBit string_table_mark = Marking::MarkBitFrom(string_table); | 2027 MarkBit string_table_mark = Marking::MarkBitFrom(string_table); |
| 2045 SetMark(string_table, string_table_mark); | 2028 SetMark(string_table, string_table_mark); |
| 2046 // Explicitly mark the prefix. | 2029 // Explicitly mark the prefix. |
| 2047 MarkingVisitor marker(heap()); | 2030 string_table->IteratePrefix(visitor); |
| 2048 string_table->IteratePrefix(&marker); | |
| 2049 ProcessMarkingDeque(); | 2031 ProcessMarkingDeque(); |
| 2050 } | 2032 } |
| 2051 | 2033 |
| 2052 | 2034 |
| 2053 void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { | 2035 void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { |
| 2054 // Mark the heap roots including global variables, stack variables, | 2036 // Mark the heap roots including global variables, stack variables, |
| 2055 // etc., and all objects reachable from them. | 2037 // etc., and all objects reachable from them. |
| 2056 heap()->IterateStrongRoots(visitor, VISIT_ONLY_STRONG); | 2038 heap()->IterateStrongRoots(visitor, VISIT_ONLY_STRONG); |
| 2057 | 2039 |
| 2058 // Handle the string table specially. | 2040 // Handle the string table specially. |
| 2059 MarkStringTable(); | 2041 MarkStringTable(visitor); |
| 2060 | 2042 |
| 2061 // There may be overflowed objects in the heap. Visit them now. | 2043 // There may be overflowed objects in the heap. Visit them now. |
| 2062 while (marking_deque_.overflowed()) { | 2044 while (marking_deque_.overflowed()) { |
| 2063 RefillMarkingDeque(); | 2045 RefillMarkingDeque(); |
| 2064 EmptyMarkingDeque(); | 2046 EmptyMarkingDeque(); |
| 2065 } | 2047 } |
| 2066 } | 2048 } |
| 2067 | 2049 |
| 2068 | 2050 |
| 2069 void MarkCompactCollector::MarkImplicitRefGroups() { | 2051 void MarkCompactCollector::MarkImplicitRefGroups() { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2262 } | 2244 } |
| 2263 } | 2245 } |
| 2264 } | 2246 } |
| 2265 { | 2247 { |
| 2266 HeapObjectIterator js_global_property_cell_iterator( | 2248 HeapObjectIterator js_global_property_cell_iterator( |
| 2267 heap()->property_cell_space()); | 2249 heap()->property_cell_space()); |
| 2268 HeapObject* cell; | 2250 HeapObject* cell; |
| 2269 while ((cell = js_global_property_cell_iterator.Next()) != NULL) { | 2251 while ((cell = js_global_property_cell_iterator.Next()) != NULL) { |
| 2270 ASSERT(cell->IsPropertyCell()); | 2252 ASSERT(cell->IsPropertyCell()); |
| 2271 if (IsMarked(cell)) { | 2253 if (IsMarked(cell)) { |
| 2272 int offset = PropertyCell::kValueOffset; | 2254 MarkCompactMarkingVisitor::VisitPropertyCell(cell->map(), cell); |
| 2273 MarkCompactMarkingVisitor::VisitPointer( | |
| 2274 heap(), | |
| 2275 reinterpret_cast<Object**>(cell->address() + offset)); | |
| 2276 offset = PropertyCell::kTypeOffset; | |
| 2277 MarkCompactMarkingVisitor::VisitPointer( | |
| 2278 heap(), | |
| 2279 reinterpret_cast<Object**>(cell->address() + offset)); | |
| 2280 } | 2255 } |
| 2281 } | 2256 } |
| 2282 } | 2257 } |
| 2283 } | 2258 } |
| 2284 | 2259 |
| 2285 RootMarkingVisitor root_visitor(heap()); | 2260 RootMarkingVisitor root_visitor(heap()); |
| 2286 MarkRoots(&root_visitor); | 2261 MarkRoots(&root_visitor); |
| 2287 | 2262 |
| 2288 // The objects reachable from the roots are marked, yet unreachable | 2263 // The objects reachable from the roots are marked, yet unreachable |
| 2289 // objects are unmarked. Mark objects reachable due to host | 2264 // objects are unmarked. Mark objects reachable due to host |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2409 } | 2384 } |
| 2410 ProcessMarkingDeque(); | 2385 ProcessMarkingDeque(); |
| 2411 } | 2386 } |
| 2412 | 2387 |
| 2413 | 2388 |
| 2414 void MarkCompactCollector::ReattachInitialMaps() { | 2389 void MarkCompactCollector::ReattachInitialMaps() { |
| 2415 HeapObjectIterator map_iterator(heap()->map_space()); | 2390 HeapObjectIterator map_iterator(heap()->map_space()); |
| 2416 for (HeapObject* obj = map_iterator.Next(); | 2391 for (HeapObject* obj = map_iterator.Next(); |
| 2417 obj != NULL; | 2392 obj != NULL; |
| 2418 obj = map_iterator.Next()) { | 2393 obj = map_iterator.Next()) { |
| 2419 if (obj->IsFreeSpace()) continue; | |
| 2420 Map* map = Map::cast(obj); | 2394 Map* map = Map::cast(obj); |
| 2421 | 2395 |
| 2422 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 2396 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
| 2423 if (map->instance_type() < FIRST_JS_RECEIVER_TYPE) continue; | 2397 if (map->instance_type() < FIRST_JS_RECEIVER_TYPE) continue; |
| 2424 | 2398 |
| 2425 if (map->attached_to_shared_function_info()) { | 2399 if (map->attached_to_shared_function_info()) { |
| 2426 JSFunction::cast(map->constructor())->shared()->AttachInitialMap(map); | 2400 JSFunction::cast(map->constructor())->shared()->AttachInitialMap(map); |
| 2427 } | 2401 } |
| 2428 } | 2402 } |
| 2429 } | 2403 } |
| 2430 | 2404 |
| 2431 | 2405 |
| 2432 void MarkCompactCollector::ClearNonLiveReferences() { | 2406 void MarkCompactCollector::ClearNonLiveReferences() { |
| 2433 HeapObjectIterator map_iterator(heap()->map_space()); | |
| 2434 // Iterate over the map space, setting map transitions that go from | 2407 // Iterate over the map space, setting map transitions that go from |
| 2435 // a marked map to an unmarked map to null transitions. This action | 2408 // a marked map to an unmarked map to null transitions. This action |
| 2436 // is carried out only on maps of JSObjects and related subtypes. | 2409 // is carried out only on maps of JSObjects and related subtypes. |
| 2410 HeapObjectIterator map_iterator(heap()->map_space()); |
| 2437 for (HeapObject* obj = map_iterator.Next(); | 2411 for (HeapObject* obj = map_iterator.Next(); |
| 2438 obj != NULL; obj = map_iterator.Next()) { | 2412 obj != NULL; |
| 2439 Map* map = reinterpret_cast<Map*>(obj); | 2413 obj = map_iterator.Next()) { |
| 2440 MarkBit map_mark = Marking::MarkBitFrom(map); | 2414 Map* map = Map::cast(obj); |
| 2441 if (map->IsFreeSpace()) continue; | |
| 2442 | 2415 |
| 2443 ASSERT(map->IsMap()); | |
| 2444 if (!map->CanTransition()) continue; | 2416 if (!map->CanTransition()) continue; |
| 2445 | 2417 |
| 2446 if (map_mark.Get() && | 2418 MarkBit map_mark = Marking::MarkBitFrom(map); |
| 2447 map->attached_to_shared_function_info()) { | 2419 if (map_mark.Get() && map->attached_to_shared_function_info()) { |
| 2448 // This map is used for inobject slack tracking and has been detached | 2420 // This map is used for inobject slack tracking and has been detached |
| 2449 // from SharedFunctionInfo during the mark phase. | 2421 // from SharedFunctionInfo during the mark phase. |
| 2450 // Since it survived the GC, reattach it now. | 2422 // Since it survived the GC, reattach it now. |
| 2451 JSFunction::cast(map->constructor())->shared()->AttachInitialMap(map); | 2423 JSFunction::cast(map->constructor())->shared()->AttachInitialMap(map); |
| 2452 } | 2424 } |
| 2453 | 2425 |
| 2454 ClearNonLivePrototypeTransitions(map); | 2426 ClearNonLivePrototypeTransitions(map); |
| 2455 ClearNonLiveMapTransitions(map, map_mark); | 2427 ClearNonLiveMapTransitions(map, map_mark); |
| 2456 | 2428 |
| 2457 if (map_mark.Get()) { | 2429 if (map_mark.Get()) { |
| 2458 ClearNonLiveDependentCode(map); | 2430 ClearNonLiveDependentCode(map->dependent_code()); |
| 2459 } else { | 2431 } else { |
| 2460 ClearAndDeoptimizeDependentCode(map); | 2432 ClearAndDeoptimizeDependentCode(map); |
| 2461 } | 2433 } |
| 2462 } | 2434 } |
| 2435 |
| 2436 // Iterate over property cell space, removing dependent code that is not |
| 2437 // otherwise kept alive by strong references. |
| 2438 HeapObjectIterator cell_iterator(heap_->property_cell_space()); |
| 2439 for (HeapObject* cell = cell_iterator.Next(); |
| 2440 cell != NULL; |
| 2441 cell = cell_iterator.Next()) { |
| 2442 if (IsMarked(cell)) { |
| 2443 ClearNonLiveDependentCode(PropertyCell::cast(cell)->dependent_code()); |
| 2444 } |
| 2445 } |
| 2463 } | 2446 } |
| 2464 | 2447 |
| 2465 | 2448 |
| 2466 void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) { | 2449 void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) { |
| 2467 int number_of_transitions = map->NumberOfProtoTransitions(); | 2450 int number_of_transitions = map->NumberOfProtoTransitions(); |
| 2468 FixedArray* prototype_transitions = map->GetPrototypeTransitions(); | 2451 FixedArray* prototype_transitions = map->GetPrototypeTransitions(); |
| 2469 | 2452 |
| 2470 int new_number_of_transitions = 0; | 2453 int new_number_of_transitions = 0; |
| 2471 const int header = Map::kProtoTransitionHeaderSize; | 2454 const int header = Map::kProtoTransitionHeaderSize; |
| 2472 const int proto_offset = header + Map::kProtoTransitionPrototypeOffset; | 2455 const int proto_offset = header + Map::kProtoTransitionPrototypeOffset; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2538 Code* code = entries->code_at(i); | 2521 Code* code = entries->code_at(i); |
| 2539 if (IsMarked(code) && !code->marked_for_deoptimization()) { | 2522 if (IsMarked(code) && !code->marked_for_deoptimization()) { |
| 2540 code->set_marked_for_deoptimization(true); | 2523 code->set_marked_for_deoptimization(true); |
| 2541 } | 2524 } |
| 2542 entries->clear_at(i); | 2525 entries->clear_at(i); |
| 2543 } | 2526 } |
| 2544 map->set_dependent_code(DependentCode::cast(heap()->empty_fixed_array())); | 2527 map->set_dependent_code(DependentCode::cast(heap()->empty_fixed_array())); |
| 2545 } | 2528 } |
| 2546 | 2529 |
| 2547 | 2530 |
| 2548 void MarkCompactCollector::ClearNonLiveDependentCode(Map* map) { | 2531 void MarkCompactCollector::ClearNonLiveDependentCode(DependentCode* entries) { |
| 2549 DisallowHeapAllocation no_allocation; | 2532 DisallowHeapAllocation no_allocation; |
| 2550 DependentCode* entries = map->dependent_code(); | |
| 2551 DependentCode::GroupStartIndexes starts(entries); | 2533 DependentCode::GroupStartIndexes starts(entries); |
| 2552 int number_of_entries = starts.number_of_entries(); | 2534 int number_of_entries = starts.number_of_entries(); |
| 2553 if (number_of_entries == 0) return; | 2535 if (number_of_entries == 0) return; |
| 2554 int new_number_of_entries = 0; | 2536 int new_number_of_entries = 0; |
| 2555 // Go through all groups, remove dead codes and compact. | 2537 // Go through all groups, remove dead codes and compact. |
| 2556 for (int g = 0; g < DependentCode::kGroupCount; g++) { | 2538 for (int g = 0; g < DependentCode::kGroupCount; g++) { |
| 2557 int group_number_of_entries = 0; | 2539 int group_number_of_entries = 0; |
| 2558 for (int i = starts.at(g); i < starts.at(g + 1); i++) { | 2540 for (int i = starts.at(g); i < starts.at(g + 1); i++) { |
| 2559 Object* obj = entries->object_at(i); | 2541 Object* obj = entries->object_at(i); |
| 2560 ASSERT(obj->IsCode() || IsMarked(obj)); | 2542 ASSERT(obj->IsCode() || IsMarked(obj)); |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3284 invalidated_code_.Rewind(0); | 3266 invalidated_code_.Rewind(0); |
| 3285 } | 3267 } |
| 3286 | 3268 |
| 3287 | 3269 |
| 3288 void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { | 3270 void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { |
| 3289 Heap::RelocationLock relocation_lock(heap()); | 3271 Heap::RelocationLock relocation_lock(heap()); |
| 3290 | 3272 |
| 3291 bool code_slots_filtering_required; | 3273 bool code_slots_filtering_required; |
| 3292 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP_NEWSPACE); | 3274 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP_NEWSPACE); |
| 3293 code_slots_filtering_required = MarkInvalidatedCode(); | 3275 code_slots_filtering_required = MarkInvalidatedCode(); |
| 3294 | |
| 3295 EvacuateNewSpace(); | 3276 EvacuateNewSpace(); |
| 3296 } | 3277 } |
| 3297 | 3278 |
| 3298 | |
| 3299 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES); | 3279 { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES); |
| 3300 EvacuatePages(); | 3280 EvacuatePages(); |
| 3301 } | 3281 } |
| 3302 | 3282 |
| 3303 // Second pass: find pointers to new space and update them. | 3283 // Second pass: find pointers to new space and update them. |
| 3304 PointersUpdatingVisitor updating_visitor(heap()); | 3284 PointersUpdatingVisitor updating_visitor(heap()); |
| 3305 | 3285 |
| 3306 { GCTracer::Scope gc_scope(tracer_, | 3286 { GCTracer::Scope gc_scope(tracer_, |
| 3307 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); | 3287 GCTracer::Scope::MC_UPDATE_NEW_TO_NEW_POINTERS); |
| 3308 // Update pointers in to space. | 3288 // Update pointers in to space. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3411 } | 3391 } |
| 3412 | 3392 |
| 3413 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_UPDATE_MISC_POINTERS); | 3393 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_UPDATE_MISC_POINTERS); |
| 3414 | 3394 |
| 3415 // Update pointers from cells. | 3395 // Update pointers from cells. |
| 3416 HeapObjectIterator cell_iterator(heap_->cell_space()); | 3396 HeapObjectIterator cell_iterator(heap_->cell_space()); |
| 3417 for (HeapObject* cell = cell_iterator.Next(); | 3397 for (HeapObject* cell = cell_iterator.Next(); |
| 3418 cell != NULL; | 3398 cell != NULL; |
| 3419 cell = cell_iterator.Next()) { | 3399 cell = cell_iterator.Next()) { |
| 3420 if (cell->IsCell()) { | 3400 if (cell->IsCell()) { |
| 3421 Address value_address = reinterpret_cast<Address>(cell) + | 3401 Cell::BodyDescriptor::IterateBody(cell, &updating_visitor); |
| 3422 (Cell::kValueOffset - kHeapObjectTag); | |
| 3423 updating_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); | |
| 3424 } | 3402 } |
| 3425 } | 3403 } |
| 3426 | 3404 |
| 3427 HeapObjectIterator js_global_property_cell_iterator( | 3405 HeapObjectIterator js_global_property_cell_iterator( |
| 3428 heap_->property_cell_space()); | 3406 heap_->property_cell_space()); |
| 3429 for (HeapObject* cell = js_global_property_cell_iterator.Next(); | 3407 for (HeapObject* cell = js_global_property_cell_iterator.Next(); |
| 3430 cell != NULL; | 3408 cell != NULL; |
| 3431 cell = js_global_property_cell_iterator.Next()) { | 3409 cell = js_global_property_cell_iterator.Next()) { |
| 3432 if (cell->IsPropertyCell()) { | 3410 if (cell->IsPropertyCell()) { |
| 3433 Address value_address = | 3411 PropertyCell::BodyDescriptor::IterateBody(cell, &updating_visitor); |
| 3434 reinterpret_cast<Address>(cell) + | |
| 3435 (PropertyCell::kValueOffset - kHeapObjectTag); | |
| 3436 updating_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); | |
| 3437 Address type_address = | |
| 3438 reinterpret_cast<Address>(cell) + | |
| 3439 (PropertyCell::kTypeOffset - kHeapObjectTag); | |
| 3440 updating_visitor.VisitPointer(reinterpret_cast<Object**>(type_address)); | |
| 3441 } | 3412 } |
| 3442 } | 3413 } |
| 3443 | 3414 |
| 3444 // Update pointer from the native contexts list. | 3415 // Update pointer from the native contexts list. |
| 3445 updating_visitor.VisitPointer(heap_->native_contexts_list_address()); | 3416 updating_visitor.VisitPointer(heap_->native_contexts_list_address()); |
| 3446 | 3417 |
| 3447 heap_->string_table()->Iterate(&updating_visitor); | 3418 heap_->string_table()->Iterate(&updating_visitor); |
| 3448 | 3419 |
| 3449 // Update pointers from external string table. | 3420 // Update pointers from external string table. |
| 3450 heap_->UpdateReferencesInExternalStringTable( | 3421 heap_->UpdateReferencesInExternalStringTable( |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4315 while (buffer != NULL) { | 4286 while (buffer != NULL) { |
| 4316 SlotsBuffer* next_buffer = buffer->next(); | 4287 SlotsBuffer* next_buffer = buffer->next(); |
| 4317 DeallocateBuffer(buffer); | 4288 DeallocateBuffer(buffer); |
| 4318 buffer = next_buffer; | 4289 buffer = next_buffer; |
| 4319 } | 4290 } |
| 4320 *buffer_address = NULL; | 4291 *buffer_address = NULL; |
| 4321 } | 4292 } |
| 4322 | 4293 |
| 4323 | 4294 |
| 4324 } } // namespace v8::internal | 4295 } } // namespace v8::internal |
| OLD | NEW |