Revision: 17648
Author:   [email protected]
Date:     Tue Nov 12 14:15:29 2013 UTC
Log:      Remove dead Space::ReserveSpace implementations.

[email protected]

Review URL: https://codereview.chromium.org/67813009
http://code.google.com/p/v8/source/detail?r=17648

Modified:
 /branches/bleeding_edge/src/spaces.cc
 /branches/bleeding_edge/src/spaces.h

=======================================
--- /branches/bleeding_edge/src/spaces.cc       Tue Nov  5 11:59:42 2013 UTC
+++ /branches/bleeding_edge/src/spaces.cc       Tue Nov 12 14:15:29 2013 UTC
@@ -2504,29 +2504,6 @@
// -----------------------------------------------------------------------------
 // OldSpace implementation

-bool NewSpace::ReserveSpace(int bytes) {
-  // We can't reliably unpack a partial snapshot that needs more new space
-  // space than the minimum NewSpace size.  The limit can be set lower than
- // the end of new space either because there is more space on the next page - // or because we have lowered the limit in order to get periodic incremental - // marking. The most reliable way to ensure that there is linear space is
-  // to do the allocation, then rewind the limit.
-  ASSERT(bytes <= InitialCapacity());
-  MaybeObject* maybe = AllocateRaw(bytes);
-  Object* object = NULL;
-  if (!maybe->ToObject(&object)) return false;
-  HeapObject* allocation = HeapObject::cast(object);
-  Address top = allocation_info_.top();
-  if ((top - bytes) == allocation->address()) {
-    allocation_info_.set_top(allocation->address());
-    return true;
-  }
- // There may be a borderline case here where the allocation succeeded, but - // the limit and top have moved on to a new page. In that case we try again.
-  return ReserveSpace(bytes);
-}
-
-
 void PagedSpace::PrepareForMarkCompact() {
// We don't have a linear allocation area while sweeping. It will be restored
   // on the first allocation after the sweep.
@@ -2559,28 +2536,6 @@
   // Clear the free list before a full GC---it will be rebuilt afterward.
   free_list_.Reset();
 }
-
-
-bool PagedSpace::ReserveSpace(int size_in_bytes) {
-  ASSERT(size_in_bytes <= AreaSize());
-  ASSERT(size_in_bytes == RoundSizeDownToObjectAlignment(size_in_bytes));
-  Address current_top = allocation_info_.top();
-  Address new_top = current_top + size_in_bytes;
-  if (new_top <= allocation_info_.limit()) return true;
-
-  HeapObject* new_area = free_list_.Allocate(size_in_bytes);
-  if (new_area == NULL) new_area = SlowAllocateRaw(size_in_bytes);
-  if (new_area == NULL) return false;
-
-  int old_linear_size = static_cast<int>(limit() - top());
-  // Mark the old linear allocation area with a free space so it can be
- // skipped when scanning the heap. This also puts it back in the free list
-  // if it is big enough.
-  Free(top(), old_linear_size);
-
-  SetTop(new_area->address(), new_area->address() + size_in_bytes);
-  return true;
-}


 intptr_t PagedSpace::SizeOfObjects() {
@@ -2596,15 +2551,6 @@
 void PagedSpace::RepairFreeListsAfterBoot() {
   free_list_.RepairLists(heap());
 }
-
-
-// You have to call this last, since the implementation from PagedSpace
-// doesn't know that memory was 'promised' to large object space.
-bool LargeObjectSpace::ReserveSpace(int bytes) {
-  return heap()->OldGenerationCapacityAvailable() >= bytes &&
-         (!heap()->incremental_marking()->IsStopped() ||
-           heap()->OldGenerationSpaceAvailable() >= bytes);
-}


 bool PagedSpace::AdvanceSweeper(intptr_t bytes_to_sweep) {
=======================================
--- /branches/bleeding_edge/src/spaces.h        Mon Nov 11 17:46:08 2013 UTC
+++ /branches/bleeding_edge/src/spaces.h        Tue Nov 12 14:15:29 2013 UTC
@@ -1768,8 +1768,6 @@
   // failure object if not.
   MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes);

-  virtual bool ReserveSpace(int bytes);
-
   // Give a block of memory to the space's free list.  It might be added to
   // the free list or accounted as waste.
   // If add_to_freelist is false then just accounting stats are updated and
@@ -2166,11 +2164,6 @@
     UNREACHABLE();
     return 0;
   }
-
-  virtual bool ReserveSpace(int bytes) {
-    UNREACHABLE();
-    return false;
-  }

   bool is_committed() { return committed_; }
   bool Commit();
@@ -2535,8 +2528,6 @@
   // if successful.
   bool AddFreshPage();

-  virtual bool ReserveSpace(int bytes);
-
 #ifdef VERIFY_HEAP
   // Verify the active semispace.
   virtual void Verify();
@@ -2848,11 +2839,6 @@

   // Checks whether the space is empty.
   bool IsEmpty() { return first_page_ == NULL; }
-
-  // See the comments for ReserveSpace in the Space class.  This has to be
- // called after ReserveSpace has been called on the paged spaces, since they
-  // may use some memory, leaving less for large objects.
-  virtual bool ReserveSpace(int bytes);

   LargePage* first_page() { return first_page_; }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to