Simplify checking during allocation when Heap::always_allocate() is

true.  The rules are:

1. Heap::AllocateRaw can normally handle allocation requests in new
   space even when always_allocate() is true.  It properly retries
   failed allocation in the second 'retry' space.

2. Heap::Allocate can normally handle allocation requests in new
   space.

3. We only need to check always_allocate() when explicitly requesting
   allocation in new space via Heap::new_space().AllocateRaw().

4. The exception to these rules is fixed arrays with size such that
   MaxObjectSizeInPagedSpace < size <= MaxObjectSizeInNewSpace (ie,
   those that will be allocated in new space and promoted to large
   object space).  They cannot be allocated in new space via
   Heap::Allocate or Heap::AllocateRaw, because the retry logic does
   not know to allocate extra remembered set bits when retrying in
   large object space.

Review URL: http://codereview.chromium.org/518007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a1bf8797
......@@ -54,7 +54,8 @@ Object* Heap::AllocateRaw(int size_in_bytes,
ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
ASSERT(space != NEW_SPACE ||
retry_space == OLD_POINTER_SPACE ||
retry_space == OLD_DATA_SPACE);
retry_space == OLD_DATA_SPACE ||
retry_space == LO_SPACE);
#ifdef DEBUG
if (FLAG_gc_interval >= 0 &&
!disallow_allocation_failure_ &&
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment