Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Issue 6800003: Make object groups and implicit references a bit more lightweight. (Closed)

Created:
9 years, 8 months ago by Vitaly Repeshko
Modified:
9 years, 7 months ago
Reviewers:
antonm
CC:
v8-dev
Visibility:
Public.

Description

Make object groups and implicit references a bit more lightweight. We can only call malloc/free once per group and we can avoid scanning through a list of NULLs if we keep unprocessed groups in the beginning. I also changed the internal representation of implicit references to hold a handle to the parent (instead of a direct pointer). The prologue callback must not trigger a GC, but it's better to be safe.

Patch Set 1 #

Total comments: 10

Patch Set 2 : Review fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -64 lines) Patch
M src/api.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/global-handles.h View 1 2 chunks +46 lines, -17 lines 0 comments Download
M src/global-handles.cc View 1 2 chunks +9 lines, -12 lines 0 comments Download
M src/mark-compact.cc View 1 3 chunks +28 lines, -21 lines 0 comments Download
M src/profile-generator.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/v8utils.h View 1 chunk +3 lines, -1 line 0 comments Download
M test/cctest/test-mark-compact.cc View 1 5 chunks +53 lines, -11 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Vitaly Repeshko
9 years, 8 months ago (2011-04-06 01:43:29 UTC) #1
antonm
LGTM http://codereview.chromium.org/6800003/diff/1/src/allocation.h File src/allocation.h (right): http://codereview.chromium.org/6800003/diff/1/src/allocation.h#newcode55 src/allocation.h:55: class CustomlyAllocated { I don't like the name, ...
9 years, 8 months ago (2011-04-06 11:01:47 UTC) #2
Vitaly Repeshko
9 years, 8 months ago (2011-04-06 19:11:01 UTC) #3
Anton, thanks for the review!

Comments addressed. I also added a test for empty groups. (It doesn't make sense
to allocate them.)


-- Vitaly

http://codereview.chromium.org/6800003/diff/1/src/allocation.h
File src/allocation.h (right):

http://codereview.chromium.org/6800003/diff/1/src/allocation.h#newcode55
src/allocation.h:55: class CustomlyAllocated {
On 2011/04/06 11:01:48, antonm wrote:
> I don't like the name, but I cannot come up with anything better.
> 
> However, apparently the best way to make class really custom allocated is by
> making its ctor/dtor private (so it cannot be stack allocated).
> 
> Maybe just declare a macro for it and forget about special base class?

Yeah, since it requires hiding both new/delete and ctor/dtor, we need a macro.
But given that we'd only have two usages, I removed this base class and made
new/delete private explicitly in the global handle classes.

http://codereview.chromium.org/6800003/diff/1/src/global-handles.h
File src/global-handles.h (right):

http://codereview.chromium.org/6800003/diff/1/src/global-handles.h#newcode64
src/global-handles.h:64: Object** objects_[1];
On 2011/04/06 11:01:48, antonm wrote:
> maybe add a comment that it's a placeholder for variable size object.

Done.

http://codereview.chromium.org/6800003/diff/1/src/global-handles.h#newcode94
src/global-handles.h:94: Object** children_[1];
On 2011/04/06 11:01:48, antonm wrote:
> ditto

Done.

http://codereview.chromium.org/6800003/diff/1/src/mark-compact.cc
File src/mark-compact.cc (right):

http://codereview.chromium.org/6800003/diff/1/src/mark-compact.cc#newcode1249
src/mark-compact.cc:1249: // be processed again.
On 2011/04/06 11:01:48, antonm wrote:
> nit: comment appears to be slightly incorrect: disposing won't prevent a group
> for being processed again, it's just not needed anymore.

Done.

http://codereview.chromium.org/6800003/diff/1/src/mark-compact.cc#newcode1279
src/mark-compact.cc:1279: // be processed again.
On 2011/04/06 11:01:48, antonm wrote:
> Ditto

Done.

Powered by Google App Engine
This is Rietveld 408576698