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

Issue 10381053: Implement explicit back pointers in transition tree. (Closed)

Created:
8 years, 7 months ago by Michael Starzinger
Modified:
8 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implement explicit back pointers in transition tree. This makes back pointers in the map transition tree explicit by having accurate back pointers throughout the lifetime of maps instead of establishing and destroying back pointers before and after each marking phase. This is a prerequisite for being able to clear map transitions during incremental marking. R=vegorov@chromium.org BUG=v8:1465 Committed: https://code.google.com/p/v8/source/detail?r=11528

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed some comments by Vyacheslav Egorov. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -196 lines) Patch
M src/heap.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M src/mark-compact.h View 1 chunk +0 lines, -7 lines 0 comments Download
M src/mark-compact.cc View 1 5 chunks +23 lines, -62 lines 0 comments Download
M src/objects.h View 1 4 chunks +26 lines, -26 lines 0 comments Download
M src/objects.cc View 1 13 chunks +31 lines, -89 lines 0 comments Download
M src/objects-debug.cc View 1 2 chunks +57 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 1 chunk +57 lines, -4 lines 0 comments Download
M src/profile-generator.cc View 1 1 chunk +10 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Michael Starzinger
8 years, 7 months ago (2012-05-08 12:33:10 UTC) #1
Vyacheslav Egorov (Chromium)
lgtm https://chromiumcodereview.appspot.com/10381053/diff/1/src/mark-compact.cc File src/mark-compact.cc (left): https://chromiumcodereview.appspot.com/10381053/diff/1/src/mark-compact.cc#oldcode683 src/mark-compact.cc:683: if (collect_maps_) CreateBackPointers(); side effect of always having ...
8 years, 7 months ago (2012-05-08 14:29:19 UTC) #2
Michael Starzinger
8 years, 7 months ago (2012-05-09 07:30:02 UTC) #3
Addressed comments. Rebased. Landed.

https://chromiumcodereview.appspot.com/10381053/diff/1/src/mark-compact.cc
File src/mark-compact.cc (left):

https://chromiumcodereview.appspot.com/10381053/diff/1/src/mark-compact.cc#ol...
src/mark-compact.cc:683: if (collect_maps_) CreateBackPointers();
On 2012/05/08 14:29:19, Vyacheslav Egorov wrote:
> side effect of always having back pointer and always treating it as a strong
> reference is that map trees will never be able to die from the root (which
could
> previously happen when running V8 with --nocollect-maps). 
> 
> We have seen obscure cases when this would lead to OOM.
> 
> Consider making back pointer weak when appropriate to fully mimic old
> --collect-maps behavior. 

Yes, that is a good point. I will address this comment in the follow-up CL that
enables map collection for incremental marking. Because it's much easier to do
that once we don't have to special-case incremental marking anymore.

https://chromiumcodereview.appspot.com/10381053/diff/1/src/objects.cc
File src/objects.cc (right):

https://chromiumcodereview.appspot.com/10381053/diff/1/src/objects.cc#newcode...
src/objects.cc:5172: Object* header = *Header();
On 2012/05/08 14:29:19, Vyacheslav Egorov wrote:
> is this change really required?

Yes it is, because this iterator overwrites the map of the prototype_transitions
array to hold a SMI representing the iteration index. So here I need to check
whether proto_trans_ actually is a valid FixedArray only if the map is still
intact.

I admit it's mighty confusing, so I tried to clean it up a bit.

https://chromiumcodereview.appspot.com/10381053/diff/1/src/objects.cc#newcode...
src/objects.cc:5174: proto_trans_->length() >= Map::kProtoTransitionHeaderSize);
On 2012/05/08 14:29:19, Vyacheslav Egorov wrote:
> should not this just be >?

Done. The length check is obsolete actually. The prototype transitions can never
have an empty fixed array as a backing store, it's size is always >
kProtoTransitionHeaderSize.

https://chromiumcodereview.appspot.com/10381053/diff/1/src/objects.h
File src/objects.h (right):

https://chromiumcodereview.appspot.com/10381053/diff/1/src/objects.h#newcode4729
src/objects.h:4729: DECL_ACCESSORS(back_pointer, Object)
On 2012/05/08 14:29:19, Vyacheslav Egorov wrote:
> I would prefer if this was declared as GetBackPointer() and SetBackPointer()
to
> show that this is not a trivial getter/setter.

Done.

https://chromiumcodereview.appspot.com/10381053/diff/1/src/profile-generator.cc
File src/profile-generator.cc (right):

https://chromiumcodereview.appspot.com/10381053/diff/1/src/profile-generator....
src/profile-generator.cc:2155: SetInternalReference(map, entry,
On 2012/05/08 14:29:19, Vyacheslav Egorov wrote:
> You might also want to include back pointer as a strong reference (which it
is).

Done.

Powered by Google App Engine
This is Rietveld 408576698