Skip to content

Commit c02a619

Browse files
committed
Remove unused separate_asm.py and emlink.py tools
These are no longer used or usefull since fastcomp removal. See: #11860
1 parent ce105db commit c02a619

File tree

11 files changed

+2
-210
lines changed

11 files changed

+2
-210
lines changed

docs/emcc.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,12 +585,6 @@ Options that are modified or new in *emcc* are listed below:
585585
with other bitcode files), instead of compiling all the way to
586586
JavaScript.
587587

588-
"--separate-asm"
589-
Emits asm.js in one file, and the rest of the code in another, and
590-
emits HTML that loads the asm.js first, in order to reduce memory
591-
load during startup. See Avoid memory spikes by separating out
592-
asm.js.
593-
594588
"--output_eol windows|linux"
595589
Specifies the line ending to generate for the text files that are
596590
outputted. If "--output_eol windows" is passed, the final output

emlink.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

site/source/docs/compiling/Building-Projects.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Emscripten compiler output often consists of several files and not just one. The
8484
- `emcc ... -o output.bc` does not produce a final asm.js/wasm build, but stops at LLVM bitcode generation stage, and produces a single LLVM bitcode file `output.bc`. Likewise only one bitcode file is produced if output suffix is `.ll`, `.o`, '.obj', '.lo', `.lib`, `.dylib` or `.so`.
8585
- `emcc ... -o output.a` generates a single archive file `output.a`.
8686
- `emcc ... -o output.{html,js} -s WASM=0` causes the compiler to target asm.js, and therefore a `.wasm` file is not produced.
87-
- `emcc ... -o output.{html,js} -s WASM=0 --separate-asm` likewise targets asm.js, but splits up the generated code to two files, `output.js` and `output.asm.js`.
8887
- `emcc ... -o output.{html,js} --emit-symbol-map` produces a file `output.{html,js}.symbols` if WebAssembly is being targeted (`-s WASM=0` not specified), or if asm.js is being targeted and `-Os`, `-Oz` or `-O2` or higher is specified, but debug level setting is `-g1` or lower (i.e. if symbols minification did occur).
8988
- `emcc ... -o output.{html,js} -s WASM=0 --memory-init-file 1` causes the generation of `output.{html,js}.mem` memory initializer file. Pasing `-O2`, `-Os` or `-Oz` also implies `--memory-init-file 1`.
9089
- `emcc ... -o output.{html,js} -g4` generates a source map file `output.wasm.map`. If targeting asm.js with `-s WASM=0`, the filename is `output.{html,js}.map`.

site/source/docs/compiling/Deploying-Pages.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Build Files and Custom Shell
1111

1212
Emscripten build output consists of two essential parts: 1) the low level compiled code module and 2) the JavaScript runtime to interact with it. If targeting WebAssembly which is done with linker flags ``-s WASM=1 -o out.html``, the compiled code is stored in a file ``out.wasm`` and the runtime lives in a file ``out.js``. When targeting asm.js there exists an additional binary file ``out.mem`` that contains the static memory section of the compiled code. This part is embedded in the ``out.wasm`` file when targeting WebAssembly.
1313

14-
By default when targeting asm.js, the compiled code and the runtime are fused in the same ``out.js`` file. For moderately large asm.js projects, it is recommended to use the ``--separate-asm`` flag to separate the compiled code to its own ``out.asm.js`` file, which enables browsers to optimize memory usage for the compiled asm.js code.
15-
1614
Additional build output files can also exist, depending on which features are used. If the Emscripten file packager is used, a binary ``out.data`` package is generated, along with an associated ``out.data.js`` loader file. Also Emscripten pthreads and Fetch APIs have their own associated Web Worker related script ``.js`` output files.
1715

1816
Developers can choose to output either to JavaScript or HTML. If outputting JavaScript (``emcc -o out.js``), the developer is expected to manually create the ``out.html`` main page in which the code is run in browsers. When targeting HTML with ``emcc -o out.html`` (the recommended build mode), Emscripten will generate the HTML shell file automatically. This shell file can be customized by using the ``emcc -o out.html --shell-file path/to/custom_shell.html`` linker directive. Copy the `default minimal HTML shell file <https://github.com/emscripten-core/emscripten/blob/master/src/shell_minimal.html>`_ from Emscripten repository to your project tree to get a good starting template for a customized shell file.

site/source/docs/optimizing/Optimizing-Code.rst

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -103,31 +103,6 @@ Very large codebases
103103

104104
The previous section on reducing code size can be helpful on very large codebases. In addition, here are some other topics that might be useful.
105105

106-
.. _optimizing-code-separating_asm:
107-
108-
Avoid memory spikes by separating out asm.js
109-
--------------------------------------------
110-
111-
When emitting asm.js, by default Emscripten emits one JS file, containing the entire codebase: Both the asm.js code that was compiled, and the general code that sets up the environment, connects to browser APIs, etc. in a very large codebase, this can be inefficient in terms of memory usage, as having all of that in one script means the JS engine might use some memory to parse and compile the asm.js, and might not free it before starting to run the codebase. And in a large game, starting to run the code might allocate a large typed array for memory, so you might see a "spike" of memory, after which temporary compilation memory will be freed. And if big enough, that spike can cause the browser to run out of memory and fail to load the application. This is a known problem on `Chrome <https://code.google.com/p/v8/issues/detail?id=4392>`_ (other browsers do not seem to have this issue).
112-
113-
A workaround is to separate out the asm.js into another file, and to make sure that the browser has a turn of the event loop between compiling the asm.js module and starting to run the application. This can be achieved by running **emcc** with ``--separate-asm``.
114-
115-
You can also do this manually, as follows:
116-
117-
* Run ``tools/separate_asm.py``. This receives as inputs the filename of the full project, and two filenames to emit: the asm.js file and a file for everything else.
118-
* Load the asm.js script first, then after a turn of the event loop, the other one, for example using code like this in your HTML file: ::
119-
120-
var script = document.createElement('script');
121-
script.src = "the_asm.js";
122-
script.onload = function() {
123-
setTimeout(function() {
124-
var script = document.createElement('script');
125-
script.src = "the_rest.js";
126-
document.body.appendChild(script);
127-
}, 1); // delaying even 1ms is enough
128-
};
129-
document.body.appendChild(script);
130-
131106
Running by itself
132107
-----------------
133108

site/source/docs/tools_reference/emcc.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,6 @@ Options that are modified or new in *emcc* are listed below:
451451
``-c``
452452
Tells *emcc* to generate LLVM bitcode (which can then be linked with other bitcode files), instead of compiling all the way to JavaScript.
453453

454-
``--separate-asm``
455-
Emits asm.js in one file, and the rest of the code in another, and emits HTML that loads the asm.js first, in order to reduce memory load during startup. See :ref:`optimizing-code-separating_asm`.
456-
457454
``--output_eol windows|linux``
458455
Specifies the line ending to generate for the text files that are outputted. If "--output_eol windows" is passed, the final output files will have Windows \r\n line endings in them. With "--output_eol linux", the final generated files will be written with Unix \n line endings.
459456

src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ var SHELL_FILE = 0;
823823
var RELOCATABLE = 0;
824824

825825
// A main module is a file compiled in a way that allows us to link it to
826-
// a side module using emlink.py.
826+
// a side module at runtime.
827827
// 1: Normal main module.
828828
// 2: DCE'd main module. We eliminate dead code normally. If a side
829829
// module needs something from main, it is up to you to make sure

tests/runner.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,9 +1555,6 @@ def btest(self, filename, expected=None, reference=None, force_c=False,
15551555
filename_is_src = '\n' in filename
15561556
src = filename if filename_is_src else ''
15571557
original_args = args[:]
1558-
if 'WASM=0' not in args:
1559-
# Filter out separate-asm, which is implied by wasm
1560-
args = [a for a in args if a != '--separate-asm']
15611558
# add in support for reporting results. this adds as an include a header so testcases can
15621559
# use REPORT_RESULT, and also adds a cpp file to be compiled alongside the testcase, which
15631560
# contains the implementation of REPORT_RESULT (we can't just include that implementation in

tests/test_other.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6725,15 +6725,11 @@ def test_disable_inlining(self):
67256725
syms = building.llvm_nm('test2.bc', include_internal=True)
67266726
assert 'foo' in syms.defs, 'foo() should not be inlined'
67276727

6728-
@no_wasm_backend('--separate-asm')
67296728
def test_output_eol(self):
6730-
# --separate-asm only makes sense without wasm (no asm.js with wasm)
6731-
for params in [[], ['--separate-asm', '-s', 'WASM=0'], ['--proxy-to-worker'], ['--proxy-to-worker', '--separate-asm', '-s', 'WASM=0']]:
6729+
for params in [[], ['--proxy-to-worker'], ['--proxy-to-worker', '-s', 'WASM=0']]:
67326730
for output_suffix in ['html', 'js']:
67336731
for eol in ['windows', 'linux']:
67346732
files = ['a.js']
6735-
if '--separate-asm' in params:
6736-
files += ['a.asm.js']
67376733
if output_suffix == 'html':
67386734
files += ['a.html']
67396735
cmd = [EMCC, path_from_root('tests', 'hello_world.c'), '-o', 'a.' + output_suffix, '--output_eol', eol] + params
@@ -6792,37 +6788,6 @@ def test_binaryen_warn_mem(self):
67926788
self.run_process([EMCC, path_from_root('tests', 'hello_world.cpp'), '-s', 'INITIAL_MEMORY=' + str(16 * 1024 * 1024), '--pre-js', 'pre.js', '-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'WASM_ASYNC_COMPILATION=0'])
67936789
self.assertContained('hello, world!', self.run_js('a.out.js'))
67946790

6795-
@no_wasm_backend('asm.js specific')
6796-
def test_binaryen_asmjs_outputs(self):
6797-
# Test that an .asm.js file is outputted exactly when it is requested.
6798-
for args, output_asmjs in [
6799-
([], False),
6800-
(['-s', 'MAIN_MODULE=2'], False),
6801-
]:
6802-
with temp_directory(self.get_dir()) as temp_dir:
6803-
cmd = [EMCC, path_from_root('tests', 'hello_world.c'), '-o', os.path.join(temp_dir, 'a.js')] + args
6804-
print(' '.join(cmd))
6805-
self.run_process(cmd)
6806-
if output_asmjs:
6807-
self.assertExists(os.path.join(temp_dir, 'a.asm.js'))
6808-
self.assertNotExists(os.path.join(temp_dir, 'a.temp.asm.js'))
6809-
6810-
# Test that outputting to .wasm does not nuke an existing .asm.js file, if
6811-
# user wants to manually dual-deploy both to same directory.
6812-
with temp_directory(self.get_dir()) as temp_dir:
6813-
cmd = [EMCC, path_from_root('tests', 'hello_world.c'), '-s', 'WASM=0', '-o', os.path.join(temp_dir, 'a.js'), '--separate-asm']
6814-
print(' '.join(cmd))
6815-
self.run_process(cmd)
6816-
self.assertExists(os.path.join(temp_dir, 'a.asm.js'))
6817-
6818-
cmd = [EMCC, path_from_root('tests', 'hello_world.c'), '-o', os.path.join(temp_dir, 'a.js')]
6819-
print(' '.join(cmd))
6820-
self.run_process(cmd)
6821-
self.assertExists(os.path.join(temp_dir, 'a.asm.js'))
6822-
self.assertExists(os.path.join(temp_dir, 'a.wasm'))
6823-
6824-
self.assertNotExists(os.path.join(temp_dir, 'a.temp.asm.js'))
6825-
68266791
def test_binaryen_mem(self):
68276792
for args, expect_initial, expect_max in [
68286793
(['-s', 'INITIAL_MEMORY=20971520'], 320, 320),

tools/separate_asm.py

Lines changed: 0 additions & 93 deletions
This file was deleted.

tools/shared.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353

5454
# warning about absolute-paths is disabled by default, and not enabled by -Wall
5555
diagnostics.add_warning('absolute-paths', enabled=False, part_of_all=False)
56-
diagnostics.add_warning('separate-asm')
5756
diagnostics.add_warning('almost-asm')
5857
diagnostics.add_warning('invalid-input')
5958
# Don't show legacy settings warnings by default

0 commit comments

Comments
 (0)