I left some comments how we could clean up and unify the code even further. I
stopped after line 5572. WDYT?

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc
File src/heap.cc (right):

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode2844
src/heap.cc:2844: AllocationSpace space = (pretenure == TENURED) ?
OLD_DATA_SPACE : NEW_SPACE;
You can also use the select function here.

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode4044
src/heap.cc:4044: AllocationSpace space = (pretenure == TENURED) ?
OLD_DATA_SPACE : NEW_SPACE;
You can also use the select function here.

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode4144
src/heap.cc:4144: MaybeObject* maybe_result;
We could also clean up the code allocation with a proper select function
then just calling space->AllocateRaw. lo_space could implement a
AllocateRaw(size) wrapper for AllocateRaw(size, EXECUTABLE);

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode4357
src/heap.cc:4357: { MaybeObject* maybe_result =
We could do a proper space selection here as well. arguments_object_size
could become really big...?

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode4873
src/heap.cc:4873: if (always_allocate()) {
You could also use the select function here... but object_size should be
never larger than the large object allocation limit. Can we add an
assert?

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode4951
src/heap.cc:4951: if (always_allocate()) {
Likewise.

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode5414
src/heap.cc:5414: AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
For cases like that we could add an AllocateRaw(size, space) function
which is a wrapper for AllocateRaw(size, space1, space2) if space1 ==
space2.

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode5439
src/heap.cc:5439: return size <= Page::kMaxNonCodeHeapObjectSize
Can we merge this function with AllocateRawFixedArray(int length,
PretenureFlag pretenure)?

https://codereview.chromium.org/22925004/diff/3001/src/heap.cc#newcode5576
src/heap.cc:5576: AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
here we could use the AllocateRaw(size, space) wrapper

https://codereview.chromium.org/22925004/diff/3001/src/heap.h
File src/heap.h (right):

https://codereview.chromium.org/22925004/diff/3001/src/heap.h#newcode2084
src/heap.h:2084: // size and the given pretenuring decision.
... and the given preferred old space if old data space or old pointer
space is selected ...

https://codereview.chromium.org/22925004/

--
--
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