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

Issue 10918067: Refactoring of snapshots. This simplifies and improves (Closed)

Created:
8 years, 3 months ago by Erik Corry
Modified:
8 years, 3 months ago
Reviewers:
Yang
CC:
v8-dev
Visibility:
Public.

Description

Refactoring of snapshots. This simplifies and improves the speed of deserializing code. The current startup time improvement for V8 is around 6%, but code deserialization is speeded up disproportionately, and we will soon have more code in the snapshot. * Removed support for deserializing into large object space. The regular pages are 1Mbyte now and that is plenty. This is a big simplification. * Instead of reserving space for the snapshot we actually allocate it now. This removes some special casing from the memory management and simplifies deserialization since we are just bumping a pointer rather than calling the normal allocation routines during deserialization. * Record in the snapshot how much we need to boot up and allocate it instead of just assuming that allocations in a new VM will always be linear. * In the snapshot we always address an object as a negative offset from the current allocation point. We used to sometimes address from the start of the deserialized data, but this is less useful now that we have good support for roots and repetitions in the deserialization data. * Code objects were previously deserialized (like other objects) by alternating raw data (deserialized with memcpy) and pointers (to external references, other objects, etc.). Now we deserialize code objects with a single memcpy, followed by a series of skips and pointers that partially overwrite the code we memcopied out of the snapshot. The skips are sometimes merged into the following instruction in the deserialization data to reduce dispatch time. * Integers in the snapshot were stored in a variable length format that gives a compact representation for small positive integers. This is still the case, but the new encoding can be decoded without branches or conditional instructions, which is faster on a modern CPU. Committed: https://code.google.com/p/v8/source/detail?r=12505

Patch Set 1 #

Total comments: 22

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+659 lines, -748 lines) Patch
M src/code-stubs.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M src/heap.h View 1 5 chunks +24 lines, -22 lines 0 comments Download
M src/heap.cc View 1 4 chunks +57 lines, -60 lines 0 comments Download
M src/heap-inl.h View 1 1 chunk +0 lines, -11 lines 0 comments Download
M src/isolate.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/mksnapshot.cc View 1 2 chunks +28 lines, -13 lines 0 comments Download
M src/runtime.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/serialize.h View 1 16 chunks +120 lines, -110 lines 0 comments Download
M src/serialize.cc View 1 36 chunks +250 lines, -353 lines 0 comments Download
M src/snapshot.h View 1 1 chunk +7 lines, -2 lines 0 comments Download
M src/snapshot-common.cc View 1 2 chunks +56 lines, -15 lines 0 comments Download
M src/snapshot-empty.cc View 1 1 chunk +7 lines, -1 line 0 comments Download
M src/spaces.h View 1 4 chunks +12 lines, -8 lines 0 comments Download
M src/spaces.cc View 1 2 chunks +32 lines, -3 lines 0 comments Download
M src/spaces-inl.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M test/cctest/test-heap.cc View 1 3 chunks +10 lines, -4 lines 0 comments Download
M test/cctest/test-mark-compact.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/test-serialize.cc View 1 14 chunks +45 lines, -139 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Erik Corry
8 years, 3 months ago (2012-09-05 09:21:18 UTC) #1
Yang
LGTM with some comments. http://codereview.chromium.org/10918067/diff/1/src/serialize.cc File src/serialize.cc (right): http://codereview.chromium.org/10918067/diff/1/src/serialize.cc#newcode611 src/serialize.cc:611: isolate_->heap()->ReserveSpace(&reservations_[0], &high_water_[0]); why dereference and ...
8 years, 3 months ago (2012-09-13 08:47:58 UTC) #2
Erik Corry
http://codereview.chromium.org/10918067/diff/1/src/serialize.cc File src/serialize.cc (right): http://codereview.chromium.org/10918067/diff/1/src/serialize.cc#newcode611 src/serialize.cc:611: isolate_->heap()->ReserveSpace(&reservations_[0], &high_water_[0]); On 2012/09/13 08:47:59, Yang wrote: > why ...
8 years, 3 months ago (2012-09-13 12:13:35 UTC) #3
Erik Corry
I had to make some changes to the way immovable stubs were created, because we ...
8 years, 3 months ago (2012-09-13 13:52:57 UTC) #4
Erik Corry
http://codereview.chromium.org/10918067/diff2/1:19/src/heap.cc http://codereview.chromium.org/10918067/diff/19/src/code-stubs.cc http://codereview.chromium.org/10918067/diff/19/test/cctest/test-mark-compact.cc
8 years, 3 months ago (2012-09-13 13:54:21 UTC) #5
Yang
8 years, 3 months ago (2012-09-13 14:31:30 UTC) #6

Powered by Google App Engine
This is Rietveld 408576698