| Index: src/spaces.cc
|
| ===================================================================
|
| --- src/spaces.cc (revision 10404)
|
| +++ src/spaces.cc (working copy)
|
| @@ -132,7 +132,7 @@
|
| }
|
|
|
|
|
| -bool CodeRange::Setup(const size_t requested) {
|
| +bool CodeRange::SetUp(const size_t requested) {
|
| ASSERT(code_range_ == NULL);
|
|
|
| code_range_ = new VirtualMemory(requested);
|
| @@ -268,7 +268,7 @@
|
| }
|
|
|
|
|
| -bool MemoryAllocator::Setup(intptr_t capacity, intptr_t capacity_executable) {
|
| +bool MemoryAllocator::SetUp(intptr_t capacity, intptr_t capacity_executable) {
|
| capacity_ = RoundUp(capacity, Page::kPageSize);
|
| capacity_executable_ = RoundUp(capacity_executable, Page::kPageSize);
|
| ASSERT_GE(capacity_, capacity_executable_);
|
| @@ -658,7 +658,8 @@
|
| : Space(heap, id, executable),
|
| free_list_(this),
|
| was_swept_conservatively_(false),
|
| - first_unswept_page_(Page::FromAddress(NULL)) {
|
| + first_unswept_page_(Page::FromAddress(NULL)),
|
| + unswept_free_bytes_(0) {
|
| max_capacity_ = (RoundDown(max_capacity, Page::kPageSize) / Page::kPageSize)
|
| * Page::kObjectAreaSize;
|
| accounting_stats_.Clear();
|
| @@ -670,12 +671,12 @@
|
| }
|
|
|
|
|
| -bool PagedSpace::Setup() {
|
| +bool PagedSpace::SetUp() {
|
| return true;
|
| }
|
|
|
|
|
| -bool PagedSpace::HasBeenSetup() {
|
| +bool PagedSpace::HasBeenSetUp() {
|
| return true;
|
| }
|
|
|
| @@ -873,9 +874,9 @@
|
| // NewSpace implementation
|
|
|
|
|
| -bool NewSpace::Setup(int reserved_semispace_capacity,
|
| +bool NewSpace::SetUp(int reserved_semispace_capacity,
|
| int maximum_semispace_capacity) {
|
| - // Setup new space based on the preallocated memory block defined by
|
| + // Set up new space based on the preallocated memory block defined by
|
| // start and size. The provided space is divided into two semi-spaces.
|
| // To support fast containment testing in the new space, the size of
|
| // this chunk must be a power of two and it must be aligned to its size.
|
| @@ -894,7 +895,7 @@
|
| ASSERT(initial_semispace_capacity <= maximum_semispace_capacity);
|
| ASSERT(IsPowerOf2(maximum_semispace_capacity));
|
|
|
| - // Allocate and setup the histogram arrays if necessary.
|
| + // Allocate and set up the histogram arrays if necessary.
|
| allocated_histogram_ = NewArray<HistogramInfo>(LAST_TYPE + 1);
|
| promoted_histogram_ = NewArray<HistogramInfo>(LAST_TYPE + 1);
|
|
|
| @@ -908,12 +909,12 @@
|
| 2 * heap()->ReservedSemiSpaceSize());
|
| ASSERT(IsAddressAligned(chunk_base_, 2 * reserved_semispace_capacity, 0));
|
|
|
| - if (!to_space_.Setup(chunk_base_,
|
| + if (!to_space_.SetUp(chunk_base_,
|
| initial_semispace_capacity,
|
| maximum_semispace_capacity)) {
|
| return false;
|
| }
|
| - if (!from_space_.Setup(chunk_base_ + reserved_semispace_capacity,
|
| + if (!from_space_.SetUp(chunk_base_ + reserved_semispace_capacity,
|
| initial_semispace_capacity,
|
| maximum_semispace_capacity)) {
|
| return false;
|
| @@ -1148,7 +1149,7 @@
|
| // -----------------------------------------------------------------------------
|
| // SemiSpace implementation
|
|
|
| -bool SemiSpace::Setup(Address start,
|
| +bool SemiSpace::SetUp(Address start,
|
| int initial_capacity,
|
| int maximum_capacity) {
|
| // Creates a space in the young generation. The constructor does not
|
| @@ -2062,6 +2063,7 @@
|
| } while (p != anchor());
|
| }
|
| first_unswept_page_ = Page::FromAddress(NULL);
|
| + unswept_free_bytes_ = 0;
|
|
|
| // Clear the free list before a full GC---it will be rebuilt afterward.
|
| free_list_.Reset();
|
| @@ -2110,6 +2112,7 @@
|
| PrintF("Sweeping 0x%" V8PRIxPTR " lazily advanced.\n",
|
| reinterpret_cast<intptr_t>(p));
|
| }
|
| + unswept_free_bytes_ -= (Page::kObjectAreaSize - p->LiveBytes());
|
| freed_bytes += MarkCompactCollector::SweepConservatively(this, p);
|
| }
|
| p = next_page;
|
| @@ -2408,7 +2411,7 @@
|
| objects_size_(0) {}
|
|
|
|
|
| -bool LargeObjectSpace::Setup() {
|
| +bool LargeObjectSpace::SetUp() {
|
| first_page_ = NULL;
|
| size_ = 0;
|
| page_count_ = 0;
|
| @@ -2428,7 +2431,7 @@
|
| space, kAllocationActionFree, page->size());
|
| heap()->isolate()->memory_allocator()->Free(page);
|
| }
|
| - Setup();
|
| + SetUp();
|
| }
|
|
|
|
|
|
|