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

Side by Side Diff: tools/js2c.py

Issue 360050: Keep natives source code in external strings instead of putting... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2006-2008 the V8 project authors. All rights reserved. 3 # Copyright 2006-2008 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 Validate(lines, filename) 294 Validate(lines, filename)
295 lines = minifier.JSMinify(lines) 295 lines = minifier.JSMinify(lines)
296 data = ToCArray(lines) 296 data = ToCArray(lines)
297 id = (os.path.split(filename)[1])[:-3] 297 id = (os.path.split(filename)[1])[:-3]
298 if delay: id = id[:-6] 298 if delay: id = id[:-6]
299 if delay: 299 if delay:
300 delay_ids.append((id, len(lines))) 300 delay_ids.append((id, len(lines)))
301 else: 301 else:
302 ids.append((id, len(lines))) 302 ids.append((id, len(lines)))
303 source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data }) 303 source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data })
304 source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': 0 }) 304 source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': data })
305 305
306 # Build delay support functions 306 # Build delay support functions
307 get_index_cases = [ ] 307 get_index_cases = [ ]
308 get_script_source_cases = [ ] 308 get_script_source_cases = [ ]
309 get_script_name_cases = [ ] 309 get_script_name_cases = [ ]
310 310
311 i = 0 311 i = 0
312 for (id, length) in delay_ids: 312 for (id, length) in delay_ids:
313 native_name = "native %s.js" % id 313 native_name = "native %s.js" % id
314 get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i }) 314 get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i })
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 def main(): 368 def main():
369 natives = sys.argv[1] 369 natives = sys.argv[1]
370 natives_empty = sys.argv[2] 370 natives_empty = sys.argv[2]
371 type = sys.argv[3] 371 type = sys.argv[3]
372 source_files = sys.argv[4:] 372 source_files = sys.argv[4:]
373 JS2C(source_files, [natives, natives_empty], { 'TYPE': type }) 373 JS2C(source_files, [natives, natives_empty], { 'TYPE': type })
374 374
375 if __name__ == "__main__": 375 if __name__ == "__main__":
376 main() 376 main()
OLDNEW
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698