@@ -1437,54 +1437,53 @@ static void EnsureEqualImagePages(OldPage* pages, OldPage* other_pages) {
14371437#endif
14381438}
14391439
1440- void PageSpace::MergeOtherPageSpace (PageSpace* other ) {
1441- other ->AbandonBumpAllocation ();
1440+ void PageSpace::MergeFrom (PageSpace* donor ) {
1441+ donor ->AbandonBumpAllocation ();
14421442
1443- ASSERT (other ->tasks_ == 0 );
1444- ASSERT (other ->concurrent_marker_tasks_ == 0 );
1445- ASSERT (other ->phase_ == kDone );
1446- DEBUG_ASSERT (other ->iterating_thread_ == nullptr );
1447- ASSERT (other ->marker_ == nullptr );
1443+ ASSERT (donor ->tasks_ == 0 );
1444+ ASSERT (donor ->concurrent_marker_tasks_ == 0 );
1445+ ASSERT (donor ->phase_ == kDone );
1446+ DEBUG_ASSERT (donor ->iterating_thread_ == nullptr );
1447+ ASSERT (donor ->marker_ == nullptr );
14481448
14491449 for (intptr_t i = 0 ; i < num_freelists_; ++i) {
1450- ASSERT (other ->freelists_ [i].top () == 0 );
1451- ASSERT (other ->freelists_ [i].end () == 0 );
1450+ ASSERT (donor ->freelists_ [i].top () == 0 );
1451+ ASSERT (donor ->freelists_ [i].end () == 0 );
14521452 const bool is_protected =
14531453 FLAG_write_protect_code && i == OldPage::kExecutable ;
1454- freelists_[i].MergeOtherFreelist (&other ->freelists_ [i], is_protected);
1455- other ->freelists_ [i].Reset ();
1454+ freelists_[i].MergeFrom (&donor ->freelists_ [i], is_protected);
1455+ donor ->freelists_ [i].Reset ();
14561456 }
14571457
14581458 // The freelist locks will be taken in MergeOtherFreelist above, and the
14591459 // locking order is the freelist locks are taken before the page list locks,
14601460 // so don't take the pages lock until after MergeOtherFreelist.
14611461 MutexLocker ml (&pages_lock_);
1462- MutexLocker ml2 (&other ->pages_lock_ );
1462+ MutexLocker ml2 (&donor ->pages_lock_ );
14631463
1464- AppendList (&pages_, &pages_tail_, &other ->pages_ , &other ->pages_tail_ );
1465- AppendList (&exec_pages_, &exec_pages_tail_, &other ->exec_pages_ ,
1466- &other ->exec_pages_tail_ );
1467- AppendList (&large_pages_, &large_pages_tail_, &other ->large_pages_ ,
1468- &other ->large_pages_tail_ );
1464+ AppendList (&pages_, &pages_tail_, &donor ->pages_ , &donor ->pages_tail_ );
1465+ AppendList (&exec_pages_, &exec_pages_tail_, &donor ->exec_pages_ ,
1466+ &donor ->exec_pages_tail_ );
1467+ AppendList (&large_pages_, &large_pages_tail_, &donor ->large_pages_ ,
1468+ &donor ->large_pages_tail_ );
14691469 // We intentionall do not merge [image_pages_] beause [this] and [other] have
14701470 // the same mmap()ed image page areas.
1471- EnsureEqualImagePages (image_pages_, other ->image_pages_ );
1471+ EnsureEqualImagePages (image_pages_, donor ->image_pages_ );
14721472
14731473 // We intentionaly do not increase [max_capacity_in_words_] because this can
14741474 // lead [max_capacity_in_words_] to become larger and larger and eventually
14751475 // wrap-around and become negative.
1476- allocated_black_in_words_ += other ->allocated_black_in_words_ ;
1477- gc_time_micros_ += other ->gc_time_micros_ ;
1478- collections_ += other ->collections_ ;
1476+ allocated_black_in_words_ += donor ->allocated_black_in_words_ ;
1477+ gc_time_micros_ += donor ->gc_time_micros_ ;
1478+ collections_ += donor ->collections_ ;
14791479
1480- usage_.capacity_in_words += other ->usage_ .capacity_in_words ;
1481- usage_.used_in_words += other ->usage_ .used_in_words ;
1482- usage_.external_in_words += other ->usage_ .external_in_words ;
1480+ usage_.capacity_in_words += donor ->usage_ .capacity_in_words ;
1481+ usage_.used_in_words += donor ->usage_ .used_in_words ;
1482+ usage_.external_in_words += donor ->usage_ .external_in_words ;
14831483
1484- page_space_controller_.MergeOtherPageSpaceController (
1485- &other->page_space_controller_ );
1484+ page_space_controller_.MergeFrom (&donor->page_space_controller_ );
14861485
1487- ASSERT (FLAG_concurrent_mark || other ->enable_concurrent_mark_ == false );
1486+ ASSERT (FLAG_concurrent_mark || donor ->enable_concurrent_mark_ == false );
14881487}
14891488
14901489PageSpaceController::PageSpaceController (Heap* heap,
@@ -1697,11 +1696,10 @@ void PageSpaceController::RecordUpdate(SpaceUsage before,
16971696 }
16981697}
16991698
1700- void PageSpaceController::MergeOtherPageSpaceController (
1701- PageSpaceController* other) {
1702- last_usage_.capacity_in_words += other->last_usage_ .capacity_in_words ;
1703- last_usage_.used_in_words += other->last_usage_ .used_in_words ;
1704- last_usage_.external_in_words += other->last_usage_ .external_in_words ;
1699+ void PageSpaceController::MergeFrom (PageSpaceController* donor) {
1700+ last_usage_.capacity_in_words += donor->last_usage_ .capacity_in_words ;
1701+ last_usage_.used_in_words += donor->last_usage_ .used_in_words ;
1702+ last_usage_.external_in_words += donor->last_usage_ .external_in_words ;
17051703}
17061704
17071705void PageSpaceGarbageCollectionHistory::AddGarbageCollectionTime (int64_t start,
0 commit comments