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

Issue 6901090: Add support for startup data (snapshot) compression. (Closed)

Created:
9 years, 8 months ago by mnaganov (inactive)
Modified:
9 years, 7 months ago
CC:
v8-dev, Satish, Torne
Visibility:
Public.

Description

Add support for startup data (snapshot) compression. This is for mobile platforms where application footprint size is important. To avoid including compression libraries into V8, we assume that the host machine have them (true for Linux), and rely on embedder to provide decompressed data. Currently, only snapshot data can be comressed. It is also possible to compress libraries sources, but it is more involved and will be addressed in another CL. BUG=none TEST=none Committed: http://code.google.com/p/v8/source/detail?r=7724

Patch Set 1 #

Total comments: 16

Patch Set 2 : The version I'll commit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -55 lines) Patch
M SConstruct View 1 5 chunks +22 lines, -1 line 0 comments Download
M include/v8.h View 1 2 chunks +32 lines, -0 lines 0 comments Download
M samples/process.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M samples/shell.cc View 1 3 chunks +36 lines, -0 lines 0 comments Download
M src/api.cc View 1 1 chunk +55 lines, -0 lines 0 comments Download
M src/d8.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/list.h View 2 chunks +4 lines, -1 line 0 comments Download
M src/list-inl.h View 1 chunk +9 lines, -3 lines 0 comments Download
M src/mksnapshot.cc View 1 6 chunks +112 lines, -46 lines 0 comments Download
M src/snapshot.h View 1 2 chunks +18 lines, -0 lines 0 comments Download
M src/snapshot-common.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M src/snapshot-empty.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 5 chunks +23 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
mnaganov (inactive)
9 years, 8 months ago (2011-04-28 13:38:15 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/6901090/diff/1/SConstruct File SConstruct (right): http://codereview.chromium.org/6901090/diff/1/SConstruct#newcode343 SConstruct:343: }, As this is Linux only I think ...
9 years, 7 months ago (2011-04-29 06:50:29 UTC) #2
Søren Thygesen Gjesse
On 2011/04/29 06:50:29, Søren Gjesse wrote: > LGTM > > http://codereview.chromium.org/6901090/diff/1/SConstruct > File SConstruct (right): ...
9 years, 7 months ago (2011-04-29 06:55:58 UTC) #3
mnaganov (inactive)
9 years, 7 months ago (2011-04-29 12:07:58 UTC) #4
http://codereview.chromium.org/6901090/diff/1/SConstruct
File SConstruct (right):

http://codereview.chromium.org/6901090/diff/1/SConstruct#newcode343
SConstruct:343: },
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> As this is Linux only I think this should be either inside the os:linux
section
> above or have a 'os:linux' inside. I think an os:linux here is the best
choice,
> and makes adding more platforms most logical.

Done.

http://codereview.chromium.org/6901090/diff/1/SConstruct#newcode488
SConstruct:488: 'CPPDEFINES':   ['COMPRESS_STARTUP_DATA_BZ2'],
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> Ditto for the LIBS part.

Done.

http://codereview.chromium.org/6901090/diff/1/include/v8.h
File include/v8.h (right):

http://codereview.chromium.org/6901090/diff/1/include/v8.h#newcode2646
include/v8.h:2646: int id;
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> Is this id actually required?

I think, no. As we don't expose to embedder what those ids mean, they make no
sense.

http://codereview.chromium.org/6901090/diff/1/include/v8.h#newcode2649
include/v8.h:2649: int decompressed_size;
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> Should the compression algorithm be exposed here (enum or string)?

Makes sense. But not for every resource, as it is the same for all of them. I've
added another API function for returning it.

http://codereview.chromium.org/6901090/diff/1/include/v8.h#newcode2682
include/v8.h:2682: * The following 3 functions are to be used when V8 is built
with
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> with -> with the

Done.

http://codereview.chromium.org/6901090/diff/1/samples/shell.cc
File samples/shell.cc (right):

http://codereview.chromium.org/6901090/diff/1/samples/shell.cc#newcode31
samples/shell.cc:31: #ifdef COMPRESS_STARTUP_DATA_BZ2
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> Should this support be added to D8 as well? The process sample? For the
process
> sample maybe just add an #error.

I think, this doesn't make much sense for D8 either. I implemented decompression
support in shell just for demo purposes.

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

http://codereview.chromium.org/6901090/diff/1/src/mksnapshot.cc#newcode130
src/mksnapshot.cc:130: bool Compress(Compressor* compressor) {
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> ASSERT_EQ(-1, decompressed_size_)?

Done.

http://codereview.chromium.org/6901090/diff/1/src/snapshot-empty.cc
File src/snapshot-empty.cc (right):

http://codereview.chromium.org/6901090/diff/1/src/snapshot-empty.cc#newcode36
src/snapshot-empty.cc:36: 
On 2011/04/29 06:50:29, Søren Gjesse wrote:
> How about removing decompressed_ and instead adding raw_ (or something like
> that) to the input data, e.g.
> 
> const byte Snapshot::raw_data_[] = { 0 };
> const byte* Snapshot::data_ = NULL;

Good idea. "decompressed" is a too long word.
I ended up with using "raw" for naming decompressed data -- this feels more
natural than using "raw" for compressed.

Powered by Google App Engine
This is Rietveld 408576698