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

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: Make decompressor class public 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
« no previous file with comments | « samples/shell.cc ('k') | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 def ConfigureObjectFiles(): 309 def ConfigureObjectFiles():
310 env = Environment(tools=tools) 310 env = Environment(tools=tools)
311 env.Replace(**context.flags['v8']) 311 env.Replace(**context.flags['v8'])
312 context.ApplyEnvOverrides(env) 312 context.ApplyEnvOverrides(env)
313 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C) 313 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
314 if 'ENABLE_LOGGING_AND_PROFILING' in env['CPPDEFINES']: 314 if 'ENABLE_LOGGING_AND_PROFILING' in env['CPPDEFINES']:
315 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LO GFILE" --log-snapshot-positions') 315 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LO GFILE" --log-snapshot-positions')
316 else: 316 else:
317 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET') 317 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET')
318 318
319 def BuildJS2CEnv(type):
320 js2c_env = { 'TYPE': type, 'COMPRESSION': 'off' }
321 if 'COMPRESS_STARTUP_DATA_BZ2' in env['CPPDEFINES']:
322 js2c_env['COMPRESSION'] = 'bz2'
323 return js2c_env
324
319 # Build the standard platform-independent source files. 325 # Build the standard platform-independent source files.
320 source_files = context.GetRelevantSources(SOURCES) 326 source_files = context.GetRelevantSources(SOURCES)
321 327
322 d8_files = context.GetRelevantSources(D8_FILES) 328 d8_files = context.GetRelevantSources(D8_FILES)
323 d8_js = env.JS2C('d8-js.cc', 'd8.js', TYPE='D8') 329 d8_js = env.JS2C('d8-js.cc', 'd8.js', **{'TYPE': 'D8', 'COMPRESSION': 'off'})
324 d8_js_obj = context.ConfigureObject(env, d8_js, CPPPATH=['.']) 330 d8_js_obj = context.ConfigureObject(env, d8_js, CPPPATH=['.'])
325 d8_objs = [context.ConfigureObject(env, [d8_files]), d8_js_obj] 331 d8_objs = [context.ConfigureObject(env, [d8_files]), d8_js_obj]
326 332
327 # Combine the JavaScript library files into a single C++ file and 333 # Combine the JavaScript library files into a single C++ file and
328 # compile it. 334 # compile it.
329 library_files = [s for s in LIBRARY_FILES] 335 library_files = [s for s in LIBRARY_FILES]
330 library_files.append('macros.py') 336 library_files.append('macros.py')
331 libraries_src = env.JS2C(['libraries.cc'], library_files, TYPE='CORE') 337 libraries_src = env.JS2C(
338 ['libraries.cc'], library_files, **BuildJS2CEnv('CORE'))
332 libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.']) 339 libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
333 340
334 # Combine the experimental JavaScript library files into a C++ file 341 # Combine the experimental JavaScript library files into a C++ file
335 # and compile it. 342 # and compile it.
336 experimental_library_files = [ s for s in EXPERIMENTAL_LIBRARY_FILES ] 343 experimental_library_files = [ s for s in EXPERIMENTAL_LIBRARY_FILES ]
337 experimental_library_files.append('macros.py') 344 experimental_library_files.append('macros.py')
338 experimental_libraries_src = env.JS2C(['experimental-libraries.cc'], experimen tal_library_files, TYPE='EXPERIMENTAL') 345 experimental_libraries_src = env.JS2C(['experimental-libraries.cc'],
346 experimental_library_files,
347 **BuildJS2CEnv('EXPERIMENTAL'))
339 experimental_libraries_obj = context.ConfigureObject(env, experimental_librari es_src, CPPPATH=['.']) 348 experimental_libraries_obj = context.ConfigureObject(env, experimental_librari es_src, CPPPATH=['.'])
340 349
341 source_objs = context.ConfigureObject(env, source_files) 350 source_objs = context.ConfigureObject(env, source_files)
342 non_snapshot_files = [source_objs] 351 non_snapshot_files = [source_objs]
343 352
344 preparser_source_files = context.GetRelevantSources(PREPARSER_SOURCES) 353 preparser_source_files = context.GetRelevantSources(PREPARSER_SOURCES)
345 preparser_objs = context.ConfigureObject(env, preparser_source_files) 354 preparser_objs = context.ConfigureObject(env, preparser_source_files)
346 355
347 # Create snapshot if necessary. For cross compilation you should either 356 # Create snapshot if necessary. For cross compilation you should either
348 # do without snapshots and take the performance hit or you should build a 357 # do without snapshots and take the performance hit or you should build a
(...skipping 13 matching lines...) Expand all
362 snapshot_cc = 'snapshot.cc' 371 snapshot_cc = 'snapshot.cc'
363 snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.']) 372 snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.'])
364 else: 373 else:
365 snapshot_obj = empty_snapshot_obj 374 snapshot_obj = empty_snapshot_obj
366 library_objs = [non_snapshot_files, libraries_obj, experimental_libraries_obj, snapshot_obj] 375 library_objs = [non_snapshot_files, libraries_obj, experimental_libraries_obj, snapshot_obj]
367 return (library_objs, d8_objs, [mksnapshot], preparser_objs) 376 return (library_objs, d8_objs, [mksnapshot], preparser_objs)
368 377
369 378
370 (library_objs, d8_objs, mksnapshot, preparser_objs) = ConfigureObjectFiles() 379 (library_objs, d8_objs, mksnapshot, preparser_objs) = ConfigureObjectFiles()
371 Return('library_objs d8_objs mksnapshot preparser_objs') 380 Return('library_objs d8_objs mksnapshot preparser_objs')
OLDNEW
« no previous file with comments | « samples/shell.cc ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698