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

Unified Diff: tools/js2c.py

Issue 623993002: Extend snapshot creation to generate 4-byte values (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Ross' comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/js2c.py
diff --git a/tools/js2c.py b/tools/js2c.py
index 77485f6e22f5f698cbf7632c3fd7a3972ee6d2c2..0d85faff9cc2504eb2b4ad04b6f0dfe121ac4725 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -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):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698