@@ -348,7 +348,7 @@ def js_optimizer(filename, passes):
348
348
def acorn_optimizer (filename , passes , extra_info = None , return_output = False , worker_js = False ):
349
349
optimizer = path_from_root ('tools/acorn-optimizer.mjs' )
350
350
original_filename = filename
351
- if extra_info is not None :
351
+ if extra_info is not None and not shared . SKIP_SUBPROCS :
352
352
temp_files = shared .get_temp_files ()
353
353
temp = temp_files .get ('.js' , prefix = 'emcc_acorn_info_' ).name
354
354
shutil .copyfile (filename , temp )
@@ -366,6 +366,9 @@ def acorn_optimizer(filename, passes, extra_info=None, return_output=False, work
366
366
if settings .VERBOSE :
367
367
cmd += ['--verbose' ]
368
368
if return_output :
369
+ shared .print_compiler_stage (cmd )
370
+ if shared .SKIP_SUBPROCS :
371
+ return ''
369
372
return check_call (cmd , stdout = PIPE ).stdout
370
373
371
374
acorn_optimizer .counter += 1
@@ -375,6 +378,9 @@ def acorn_optimizer(filename, passes, extra_info=None, return_output=False, work
375
378
output_file = basename + '.jso%d.js' % acorn_optimizer .counter
376
379
shared .get_temp_files ().note (output_file )
377
380
cmd += ['-o' , output_file ]
381
+ shared .print_compiler_stage (cmd )
382
+ if shared .SKIP_SUBPROCS :
383
+ return output_file
378
384
check_call (cmd )
379
385
save_intermediate (output_file , '%s.js' % passes [0 ])
380
386
return output_file
@@ -780,6 +786,9 @@ def metadce(js_file, wasm_file, debug_info, last):
780
786
extra_info = '{ "exports": [' + ',' .join (f'["{ asmjs_mangle (x )} ", "{ x } "]' for x in exports ) + ']}'
781
787
782
788
txt = acorn_optimizer (js_file , ['emitDCEGraph' , '--no-print' ], return_output = True , extra_info = extra_info )
789
+ if shared .SKIP_SUBPROCS :
790
+ # The next steps depend on the output from this step, so we can't do them if we aren't actually running.
791
+ return js_file
783
792
graph = json .loads (txt )
784
793
# ensure that functions expected to be exported to the outside are roots
785
794
required_symbols = user_requested_exports .union (set (settings .SIDE_MODULE_IMPORTS ))
@@ -1209,6 +1218,9 @@ def run_binaryen_command(tool, infile, outfile=None, args=None, debug=False, std
1209
1218
if settings .GENERATE_SOURCE_MAP and outfile and tool in ['wasm-opt' , 'wasm-emscripten-finalize' ]:
1210
1219
cmd += [f'--input-source-map={ infile } .map' ]
1211
1220
cmd += [f'--output-source-map={ outfile } .map' ]
1221
+ shared .print_compiler_stage (cmd )
1222
+ if shared .SKIP_SUBPROCS :
1223
+ return ''
1212
1224
ret = check_call (cmd , stdout = stdout ).stdout
1213
1225
if outfile :
1214
1226
save_intermediate (outfile , '%s.wasm' % tool )
0 commit comments