Skip to content

Commit b9d3751

Browse files
author
erik.corry@gmail.com
committed
* 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. Review URL: http://codereview.chromium.org/341079 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent 6d425b7 commit b9d3751

4 files changed

Lines changed: 341 additions & 175 deletions

File tree

src/mksnapshot.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ int main2(int argc, char** argv) {
194194
context.Dispose();
195195
CppByteSink sink(argv[1]);
196196
i::Serializer2 ser(&sink);
197+
// This results in a somewhat smaller snapshot, probably because it gets rid
198+
// of some things that are cached between garbage collections.
199+
i::Heap::CollectAllGarbage(true);
197200
ser.Serialize();
198201
return 0;
199202
}

src/objects.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2910,7 +2910,8 @@ class Code: public HeapObject {
29102910
void CodeVerify();
29112911
#endif
29122912
// Code entry points are aligned to 32 bytes.
2913-
static const int kCodeAlignment = 32;
2913+
static const int kCodeAlignmentBits = 5;
2914+
static const int kCodeAlignment = 1 << kCodeAlignmentBits;
29142915
static const int kCodeAlignmentMask = kCodeAlignment - 1;
29152916

29162917
// Layout description.

0 commit comments

Comments
 (0)