sgtm

https://codereview.chromium.org/22852024/diff/72001/src/spaces-inl.h
File src/spaces-inl.h (right):

https://codereview.chromium.org/22852024/diff/72001/src/spaces-inl.h#newcode310
src/spaces-inl.h:310: MaybeObject* PagedSpace::AllocateRaw(int
size_in_bytes,
I'd rewrite this the next way:

// Raw allocation.
MaybeObject* PagedSpace::AllocateRaw(int size_in_bytes,
                                     AllocationType event) {
  HeapObject* object = NULL;
  do {
    object = AllocateLinearly(size_in_bytes);
    if (object != NULL) break;

    ASSERT(!heap()->linear_allocation() ||
           (anchor_.next_chunk() == &anchor_ &&
            anchor_.prev_chunk() == &anchor_));

    object = free_list_.Allocate(size_in_bytes);
    if (object != NULL) break;

    object = SlowAllocateRaw(size_in_bytes);
  } while (false);

  if (object == NULL) return Failure::RetryAfterGC(identity());

  if (identity() == CODE_SPACE) {
    SkipList::Update(object->address(), size_in_bytes);
  }
  if (event == NEW_OBJECT) {
    HeapProfiler* profiler = heap()->isolate()->heap_profiler();
    if (profiler->is_tracking_allocations()) {
      profiler->NewObjectEvent(object->address(), size_in_bytes);
    }
  }
  return object;
}

https://codereview.chromium.org/22852024/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to