Skip to content

Commit 919d74e

Browse files
committed
make sure to set label if label is used in the emterpreter, as we will run aggressiveVariableElimination after it is no longer identifiable
1 parent b89f32d commit 919d74e

File tree

4 files changed

+4840
-3
lines changed

4 files changed

+4840
-3
lines changed

emcc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1495,12 +1495,16 @@ try:
14951495
js_optimizer_queue += [get_eliminate()]
14961496

14971497
if shared.Settings.AGGRESSIVE_VARIABLE_ELIMINATION:
1498+
# note that this happens before registerize/minification, which can obfuscate the name of 'label', which is tricky
14981499
js_optimizer_queue += ['aggressiveVariableElimination']
14991500

15001501
js_optimizer_queue += ['simplifyExpressions']
15011502

1502-
if shared.Settings.EMTERPRETIFY: # emterpreter code will not run through a JS optimizing JIT, do more work ourselves
1503+
if shared.Settings.EMTERPRETIFY:
1504+
# emterpreter code will not run through a JS optimizing JIT, do more work ourselves
15031505
js_optimizer_queue += ['localCSE']
1506+
# add explicit label setting, as we will run aggressiveVariableElimination late, *after* 'label' is no longer notable by name
1507+
js_optimizer_queue += ['safeLabelSetting']
15041508

15051509
if shared.Settings.RELOOP and not shared.Settings.ASM_JS:
15061510
js_optimizer_queue += ['optimizeShiftsAggressive', get_eliminate()] # aggressive shifts optimization requires loops, it breaks on switches

0 commit comments

Comments
 (0)