Commit 4733718d authored by yangguo@chromium.org's avatar yangguo@chromium.org

Extend snapshot creation to generate 4-byte values

R=rmcilroy@chromium.org, yangguo@chromium.org

Review URL: https://codereview.chromium.org/623993002

Patch from Andre Baixo <baixo@google.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24401 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 43257b61
......@@ -498,9 +498,16 @@ def CompressMaybe(sources, compression_type):
def PutInt(blob_file, value):
assert(value >= 0 and value < (1 << 20))
size = 1 if (value < 1 << 6) else (2 if (value < 1 << 14) else 3)
value_with_length = (value << 2) | size
assert(value >= 0 and value < (1 << 28))
if (value < 1 << 6):
size = 1
elif (value < 1 << 14):
size = 2
elif (value < 1 << 22):
size = 3
else:
size = 4
value_with_length = (value << 2) | (size - 1)
byte_sequence = bytearray()
for i in xrange(size):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment