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

Issue 10444059: When generate snapshot use tags_ instead of class_ to store object ids. (Closed)

Created:
8 years, 6 months ago by Vyacheslav Egorov (Google)
Modified:
8 years, 6 months ago
Reviewers:
siva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

When generate snapshot use tags_ instead of class_ to store object ids. This is step towards removal of class_ field. Committed: https://code.google.com/p/dart/source/detail?r=8098

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -66 lines) Patch
M runtime/vm/raw_object_snapshot.cc View 48 chunks +73 lines, -55 lines 0 comments Download
M runtime/vm/snapshot.h View 3 chunks +7 lines, -3 lines 0 comments Download
M runtime/vm/snapshot.cc View 6 chunks +22 lines, -8 lines 3 comments Download

Messages

Total messages: 3 (0 generated)
Vyacheslav Egorov (Google)
Hi Siva, Here is snapshoting related CL extracted from big CL: http://codereview.chromium.org/10450014/. This CL switches ...
8 years, 6 months ago (2012-05-29 15:26:28 UTC) #1
siva
lgtm https://chromiumcodereview.appspot.com/10444059/diff/1/runtime/vm/snapshot.cc File runtime/vm/snapshot.cc (right): https://chromiumcodereview.appspot.com/10444059/diff/1/runtime/vm/snapshot.cc#newcode550 runtime/vm/snapshot.cc:550: raw->ptr()->tags_ = forward_list_[i]->tags(); // Restore original class. Comment ...
8 years, 6 months ago (2012-05-30 00:35:29 UTC) #2
Vyacheslav Egorov (Google)
8 years, 6 months ago (2012-05-30 07:48:34 UTC) #3
Thanks for the review, Siva!

https://chromiumcodereview.appspot.com/10444059/diff/1/runtime/vm/snapshot.cc
File runtime/vm/snapshot.cc (right):

https://chromiumcodereview.appspot.com/10444059/diff/1/runtime/vm/snapshot.cc...
runtime/vm/snapshot.cc:589: value = SerializedHeaderData::update(object_id,
value);
On 2012/05/30 00:35:29, asiva wrote:
> The SerializedHeaderTag bits collide with the reserved GC bits in tags
> (kFreeBit, kMarkBit).
> 
> Currently this is not a problem as the GC bits are only used during GC and
> should not collide during snapshot writing but there is a proposal to pre mark
> certain objects in order to speed up the marking phase. When that is
implemented
> we will have issues with the bit collision.
> 
> Could you add a TODO above enum SerializedHeaderType in snapshot.h to resolve
> this by using different bits (maybe the canonical/snapshot bits can be
reused).

Actually there is one change I did not merge from "big CL": there I just made
kObjectId == kFreeBit because to my understanding no free list element should
ever be serialized into snapshot, so there will never be a clash.

Here a decided to go a different way: no object in the heap will ever have
kFreeBit and kMarkBit both set up. Because when kFreeBit is set the rest of
tags_ is a pointer to the next free element which is 2 word aligned and thus has
0 at lower 3 (or 4 on x64) bits. Thus if kFreeBit is set kMarkBit (2nd bit) is
zero.

I think I will just merge the change that makes kObjectId to be equal to
kFreeBit.

What do you think?

Powered by Google App Engine
This is Rietveld 408576698