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

Issue 341079: * Do a GC in mksnapshot to get rid of some extraneous junk.... (Closed)

Created:
11 years, 1 month ago by Erik Corry
Modified:
11 years, 1 month ago
Reviewers:
Kasper Lund
CC:
v8-dev
Visibility:
Public.

Description

* Do a GC in mksnapshot to get rid of some extraneous junk. * Make snapshot more compact by coding the tag and the space in one byte. Contract some common sequences to one byte. * Use back references only within one page. Index from the start of the space otherwise. * Serialize Smis as raw data rather than int-encoding them. This takes a little more space but is faster. Committed: http://code.google.com/p/v8/source/detail?r=3208

Patch Set 1 #

Total comments: 13

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+316 lines, -165 lines) Patch
M src/mksnapshot.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/serialize.h View 4 chunks +51 lines, -25 lines 0 comments Download
M src/serialize.cc View 1 16 chunks +263 lines, -140 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Erik Corry
11 years, 1 month ago (2009-11-03 10:08:49 UTC) #1
Kasper Lund
11 years, 1 month ago (2009-11-03 12:12:39 UTC) #2
LGTM, even though I think you should try to make smaller changes (this is a lot
of changes to fairly complicated stuff).

http://codereview.chromium.org/341079/diff/1/4
File src/mksnapshot.cc (right):

http://codereview.chromium.org/341079/diff/1/4#newcode197
Line 197: i::Heap::CollectAllGarbage(false);
Is there any reason why you're not forcing a compaction? Maybe you should add a
comment on why it's necessary to do a GC (what kind of stuff you expect to get
rid off, etc.).

http://codereview.chromium.org/341079/diff/1/3
File src/objects.h (right):

http://codereview.chromium.org/341079/diff/1/3#newcode2913
Line 2913: static const int kCodeAlignment = 32;
Express via kCodeAlignmentBits?

http://codereview.chromium.org/341079/diff/1/5
File src/serialize.cc (right):

http://codereview.chromium.org/341079/diff/1/5#newcode1907
Line 1907: ASSERT(NUMBER_OF_DATA_TYPES <= 16);
Maybe explain why this assertion is important?

http://codereview.chromium.org/341079/diff/1/5#newcode1912
Line 1912: case RAW_DATA_SERIALIZATION + index: {                \
Indent \

http://codereview.chromium.org/341079/diff/1/5#newcode1986
Line 1986: int backref_space = (data & 15);
Abstract out constant (15) used in multiple places to get space. Maybe even add
a static inline helper that returns something of type AllocationSpace?

http://codereview.chromium.org/341079/diff/1/5#newcode2005
Line 2005: case REFERENCE_SERIALIZATION + index: {                           \
Indent \

http://codereview.chromium.org/341079/diff/1/5#newcode2105
Line 2105: sink_->Put(character, "tagcharacter\n");
The seconds parameter to sink_->Put(...) isn't used very consistently (maybe
it's on purpose). Sometimes it's all lower case, sometimes it's terminated with
\n. If the \n versions have a specific meaning it might make sense to have a
special Put method that adds the newline (PutSection?).

http://codereview.chromium.org/341079/diff/1/5#newcode2139
Line 2139: sink_->PutInt(kPointerSize, "length");
Wouldn't it be even better to have a special serialized smi tag to avoid
outputting kPointerSize everywhere? Maybe you've already tried this.

http://codereview.chromium.org/341079/diff/1/5#newcode2193
Line 2193: {  /* NOLINT */
Why is this scope { } necessary?

http://codereview.chromium.org/341079/diff/1/5#newcode2315
Line 2315: {  /* NOLINT */
Why is this scope needed?

http://codereview.chromium.org/341079/diff/1/2
File src/serialize.h (right):

http://codereview.chromium.org/341079/diff/1/2#newcode401
Line 401: // only works for objects in the first page of a space
Terminate comment with .

http://codereview.chromium.org/341079/diff/1/2#newcode434
Line 434: RAW_DATA_SERIALIZATION = 0,      // And 15 common raw lengths.
Maybe move the // And ... comment to the next line to better match the // Free:
comments.

http://codereview.chromium.org/341079/diff/1/2#newcode508
Line 508: Address high_water_[LAST_SPACE + 1];
Add separate comments on high_water_ and last_object_address_ that explain how
they are used and updated.

Powered by Google App Engine
This is Rietveld 408576698