You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This new setting lets the user define which Module arguments will be provided at runtime. By default we assume, as always, that the user may provide any such API. With this new setting, the compiler can be told at compile time that only some of those values may be arriving. That allows it to not emit code for all the options that are not.
This starts to optimize using that option, but only does a little work so far. Specifically, Module['arguments'], Module['thisProgram'], Module['quit'] are all optimized, that is, they are no longer placed on Module, and they are not read from Module unless the user expects them to be provided at runtime. (Again, that is the default, so no existing code should break.)
On hello world this saves 2.5%, but again, this option lets us optimize a lot more later. In principle, I think this option is key to letting us remove the bulk of unnecessary code from our minimal JS, in fact.
Copy file name to clipboardExpand all lines: emcc.py
+3
Original file line number
Diff line number
Diff line change
@@ -1154,6 +1154,9 @@ def check(input_file):
1154
1154
1155
1155
ifshared.Settings.MODULARIZE:
1156
1156
assertnotoptions.proxy_to_worker, '-s MODULARIZE=1 and -s MODULARIZE_INSTANCE=1 are not compatible with --proxy-to-worker (if you want to run in a worker with -s MODULARIZE=1, you likely want to do the worker side setup manually)'
1157
+
# MODULARIZE's .then() method uses onRuntimeInitialized currently, so make sure
if(INITIAL_TOTAL_MEMORY<TOTAL_STACK)err('TOTAL_MEMORY should be larger than TOTAL_STACK, was '+INITIAL_TOTAL_MEMORY+'! (TOTAL_STACK='+TOTAL_STACK+')');
339
342
340
-
// Initialize the runtime's memory
341
343
#if ASSERTIONS
344
+
assert(INITIAL_TOTAL_MEMORY>=TOTAL_STACK,'TOTAL_MEMORY should be larger than TOTAL_STACK, was '+INITIAL_TOTAL_MEMORY+'! (TOTAL_STACK='+TOTAL_STACK+')');
345
+
342
346
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
0 commit comments