aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc16
1 files changed, 5 insertions, 11 deletions
diff --git a/emcc b/emcc
index 4c4c3d97..5d429cc2 100755
--- a/emcc
+++ b/emcc
@@ -1200,6 +1200,8 @@ try:
js_optimizer_queue = []
def flush_js_optimizer_queue():
global final, js_optimizer_queue
+ if shared.Settings.ASM_JS:
+ js_optimizer_queue = ['asm'] + js_optimizer_queue
if len(js_optimizer_queue) > 0:
if DEBUG < 2:
if DEBUG: print >> sys.stderr, 'emcc: applying js optimization passes:', js_optimizer_queue
@@ -1221,20 +1223,12 @@ try:
if DEBUG: save_intermediate('pretty')
def get_eliminate():
- if shared.Settings.ASM_JS:
- return 'eliminateAsm'
- elif shared.Settings.ALLOW_MEMORY_GROWTH:
+ if shared.Settings.ALLOW_MEMORY_GROWTH:
return 'eliminateMemSafe'
else:
return 'eliminate'
- def get_simplify_pre():
- if shared.Settings.ASM_JS:
- return 'simplifyExpressionsPreAsm'
- else:
- return 'simplifyExpressionsPre'
-
- js_optimizer_queue += [get_eliminate(), get_simplify_pre()]
+ js_optimizer_queue += [get_eliminate(), 'simplifyExpressionsPre']
if shared.Settings.RELOOP:
js_optimizer_queue += ['optimizeShiftsAggressive', get_eliminate()] # aggressive shifts optimization requires loops, it breaks on switches
@@ -1246,7 +1240,7 @@ try:
final = shared.Building.closure_compiler(final)
if DEBUG: save_intermediate('closure')
elif shared.Settings.ASM_JS and shared.Settings.RELOOP:
- js_optimizer_queue += ['registerizeAsm'] # we can't use closure in asm, but this does much of the same
+ js_optimizer_queue += ['registerize'] # we can't use closure in asm, but this does much of the same
if opt_level >= 1:
if DEBUG: print >> sys.stderr, 'emcc: running post-closure post-opts'