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

Side by Side Diff: src/SConscript

Issue 7066048: Compress sources of JS libraries in addition to the snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments addressed Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2011 the V8 project authors. All rights reserved. 1 # Copyright 2011 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 'os:linux': ['platform-linux.cc', 'platform-posix.cc'], 216 'os:linux': ['platform-linux.cc', 'platform-posix.cc'],
217 'os:android': ['platform-linux.cc', 'platform-posix.cc'], 217 'os:android': ['platform-linux.cc', 'platform-posix.cc'],
218 'os:macos': ['platform-macos.cc', 'platform-posix.cc'], 218 'os:macos': ['platform-macos.cc', 'platform-posix.cc'],
219 'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'], 219 'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'],
220 'os:cygwin': ['platform-cygwin.cc', 'platform-posix.cc'], 220 'os:cygwin': ['platform-cygwin.cc', 'platform-posix.cc'],
221 'os:nullos': ['platform-nullos.cc'], 221 'os:nullos': ['platform-nullos.cc'],
222 'os:win32': ['platform-win32.cc'], 222 'os:win32': ['platform-win32.cc'],
223 'mode:release': [], 223 'mode:release': [],
224 'mode:debug': [ 224 'mode:debug': [
225 'objects-debug.cc', 'prettyprinter.cc', 'regexp-macro-assembler-tracer.cc' 225 'objects-debug.cc', 'prettyprinter.cc', 'regexp-macro-assembler-tracer.cc'
226 ] 226 ],
227 'compress_startup_data:bz2': ['bz2-decompress.cc'],
227 } 228 }
228 229
229 230
230 PREPARSER_SOURCES = { 231 PREPARSER_SOURCES = {
231 'all': Split(""" 232 'all': Split("""
232 allocation.cc 233 allocation.cc
233 hashmap.cc 234 hashmap.cc
234 preparse-data.cc 235 preparse-data.cc
235 preparser.cc 236 preparser.cc
236 preparser-api.cc 237 preparser-api.cc
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 def ConfigureObjectFiles(): 310 def ConfigureObjectFiles():
310 env = Environment(tools=tools) 311 env = Environment(tools=tools)
311 env.Replace(**context.flags['v8']) 312 env.Replace(**context.flags['v8'])
312 context.ApplyEnvOverrides(env) 313 context.ApplyEnvOverrides(env)
313 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C) 314 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
314 if 'ENABLE_LOGGING_AND_PROFILING' in env['CPPDEFINES']: 315 if 'ENABLE_LOGGING_AND_PROFILING' in env['CPPDEFINES']:
315 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LO GFILE" --log-snapshot-positions') 316 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LO GFILE" --log-snapshot-positions')
316 else: 317 else:
317 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET') 318 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET')
318 319
320 def BuildJS2CEnv(type):
321 js2c_env = { 'TYPE': type, 'COMPRESSION': 'off' }
322 if 'COMPRESS_STARTUP_DATA_BZ2' in env['CPPDEFINES']:
323 js2c_env['COMPRESSION'] = 'bz2'
324 return js2c_env
325
319 # Build the standard platform-independent source files. 326 # Build the standard platform-independent source files.
320 source_files = context.GetRelevantSources(SOURCES) 327 source_files = context.GetRelevantSources(SOURCES)
321 328
322 d8_files = context.GetRelevantSources(D8_FILES) 329 d8_files = context.GetRelevantSources(D8_FILES)
323 d8_js = env.JS2C('d8-js.cc', 'd8.js', TYPE='D8') 330 d8_js = env.JS2C('d8-js.cc', 'd8.js', **{'TYPE': 'D8', 'COMPRESSION': 'off'})
324 d8_js_obj = context.ConfigureObject(env, d8_js, CPPPATH=['.']) 331 d8_js_obj = context.ConfigureObject(env, d8_js, CPPPATH=['.'])
325 d8_objs = [context.ConfigureObject(env, [d8_files]), d8_js_obj] 332 d8_objs = [context.ConfigureObject(env, [d8_files]), d8_js_obj]
326 333
327 # Combine the JavaScript library files into a single C++ file and 334 # Combine the JavaScript library files into a single C++ file and
328 # compile it. 335 # compile it.
329 library_files = [s for s in LIBRARY_FILES] 336 library_files = [s for s in LIBRARY_FILES]
330 library_files.append('macros.py') 337 library_files.append('macros.py')
331 libraries_src = env.JS2C(['libraries.cc'], library_files, TYPE='CORE') 338 libraries_src = env.JS2C(
339 ['libraries.cc'], library_files, **BuildJS2CEnv('CORE'))
332 libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.']) 340 libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
333 341
334 # Combine the experimental JavaScript library files into a C++ file 342 # Combine the experimental JavaScript library files into a C++ file
335 # and compile it. 343 # and compile it.
336 experimental_library_files = [ s for s in EXPERIMENTAL_LIBRARY_FILES ] 344 experimental_library_files = [ s for s in EXPERIMENTAL_LIBRARY_FILES ]
337 experimental_library_files.append('macros.py') 345 experimental_library_files.append('macros.py')
338 experimental_libraries_src = env.JS2C(['experimental-libraries.cc'], experimen tal_library_files, TYPE='EXPERIMENTAL') 346 experimental_libraries_src = env.JS2C(['experimental-libraries.cc'],
347 experimental_library_files,
348 **BuildJS2CEnv('EXPERIMENTAL'))
339 experimental_libraries_obj = context.ConfigureObject(env, experimental_librari es_src, CPPPATH=['.']) 349 experimental_libraries_obj = context.ConfigureObject(env, experimental_librari es_src, CPPPATH=['.'])
340 350
341 source_objs = context.ConfigureObject(env, source_files) 351 source_objs = context.ConfigureObject(env, source_files)
342 non_snapshot_files = [source_objs] 352 non_snapshot_files = [source_objs]
343 353
344 preparser_source_files = context.GetRelevantSources(PREPARSER_SOURCES) 354 preparser_source_files = context.GetRelevantSources(PREPARSER_SOURCES)
345 preparser_objs = context.ConfigureObject(env, preparser_source_files) 355 preparser_objs = context.ConfigureObject(env, preparser_source_files)
346 356
347 # Create snapshot if necessary. For cross compilation you should either 357 # Create snapshot if necessary. For cross compilation you should either
348 # do without snapshots and take the performance hit or you should build a 358 # do without snapshots and take the performance hit or you should build a
(...skipping 13 matching lines...) Expand all
362 snapshot_cc = 'snapshot.cc' 372 snapshot_cc = 'snapshot.cc'
363 snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.']) 373 snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.'])
364 else: 374 else:
365 snapshot_obj = empty_snapshot_obj 375 snapshot_obj = empty_snapshot_obj
366 library_objs = [non_snapshot_files, libraries_obj, experimental_libraries_obj, snapshot_obj] 376 library_objs = [non_snapshot_files, libraries_obj, experimental_libraries_obj, snapshot_obj]
367 return (library_objs, d8_objs, [mksnapshot], preparser_objs) 377 return (library_objs, d8_objs, [mksnapshot], preparser_objs)
368 378
369 379
370 (library_objs, d8_objs, mksnapshot, preparser_objs) = ConfigureObjectFiles() 380 (library_objs, d8_objs, mksnapshot, preparser_objs) = ConfigureObjectFiles()
371 Return('library_objs d8_objs mksnapshot preparser_objs') 381 Return('library_objs d8_objs mksnapshot preparser_objs')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698