webruby 0.2.7 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/webruby/environment.rb +24 -8
- data/lib/webruby/rake/files.rake +6 -22
- data/lib/webruby/rake/general.rake +1 -1
- data/lib/webruby/rake/mruby.rake +1 -0
- data/lib/webruby/utility.rb +14 -0
- data/modules/mruby/AUTHORS +14 -0
- data/modules/mruby/CONTRIBUTING.md +7 -4
- data/modules/mruby/INSTALL +28 -11
- data/modules/mruby/MITL +13 -13
- data/modules/mruby/Makefile +4 -5
- data/modules/mruby/README.md +54 -49
- data/modules/mruby/Rakefile +36 -6
- data/modules/mruby/benchmark/ao-render.rb +1 -2
- data/modules/mruby/benchmark/bm_app_lc_fizzbuzz.rb +52 -0
- data/modules/mruby/benchmark/fib39.rb +0 -0
- data/modules/mruby/bintest/mrbc.rb +12 -0
- data/modules/mruby/build_config.rb +32 -2
- data/modules/mruby/doc/api/README.md +30 -0
- data/modules/mruby/doc/api/mruby.h.md +69 -0
- data/modules/mruby/doc/compile/README.md +208 -99
- data/modules/mruby/doc/debugger/README.md +370 -0
- data/modules/mruby/doc/language/Core.md +1590 -0
- data/modules/mruby/doc/language/README.md +9 -0
- data/modules/mruby/doc/language/generator.rb +15 -0
- data/modules/mruby/doc/language/mrbdoc/lib/mrbdoc_analyze.rb +231 -0
- data/modules/mruby/doc/language/mrbdoc/lib/mrbdoc_docu.rb +118 -0
- data/modules/mruby/doc/language/mrbdoc/mrbdoc.rb +38 -0
- data/modules/mruby/doc/mrbconf/README.md +160 -0
- data/modules/mruby/doc/mrbgems/README.md +136 -66
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +1 -1
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +1 -1
- data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +1 -1
- data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +1 -1
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +1 -1
- data/modules/mruby/examples/targets/{ArduinoDue.rb → build_config_ArduinoDue.rb} +32 -6
- data/modules/mruby/examples/targets/build_config_IntelGalileo.rb +106 -0
- data/modules/mruby/examples/targets/{chipKitMax32.rb → build_config_chipKITMax32.rb} +26 -7
- data/modules/mruby/include/mrbconf.h +25 -1
- data/modules/mruby/include/mruby/array.h +32 -22
- data/modules/mruby/include/mruby/boxing_nan.h +94 -0
- data/modules/mruby/include/mruby/boxing_no.h +49 -0
- data/modules/mruby/include/mruby/boxing_word.h +119 -0
- data/modules/mruby/include/mruby/class.h +15 -13
- data/modules/mruby/include/mruby/compile.h +43 -36
- data/modules/mruby/include/mruby/data.h +13 -5
- data/modules/mruby/include/mruby/debug.h +9 -9
- data/modules/mruby/include/mruby/dump.h +32 -23
- data/modules/mruby/include/mruby/error.h +36 -0
- data/modules/mruby/include/mruby/gc.h +11 -6
- data/modules/mruby/include/mruby/hash.h +12 -12
- data/modules/mruby/include/mruby/irep.h +9 -3
- data/modules/mruby/include/mruby/khash.h +58 -41
- data/modules/mruby/include/mruby/numeric.h +38 -4
- data/modules/mruby/include/mruby/object.h +55 -0
- data/modules/mruby/include/mruby/opcode.h +160 -0
- data/modules/mruby/include/mruby/proc.h +19 -5
- data/modules/mruby/include/mruby/range.h +4 -3
- data/modules/mruby/include/mruby/re.h +20 -0
- data/modules/mruby/include/mruby/string.h +86 -47
- data/modules/mruby/include/mruby/value.h +100 -374
- data/modules/mruby/include/mruby/variable.h +34 -32
- data/modules/mruby/include/mruby/version.h +40 -0
- data/modules/mruby/include/mruby.h +211 -139
- data/modules/mruby/minirake +16 -9
- data/modules/mruby/mrbgems/default.gembox +12 -0
- data/modules/mruby/mrbgems/full-core.gembox +3 -3
- data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +488 -8
- data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +57 -31
- data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +231 -45
- data/modules/mruby/mrbgems/mruby-bin-debugger/bintest/mrdb.rb +286 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/bintest/print.rb +701 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/mrbgem.rake +9 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +516 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h +26 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c +235 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.h +14 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +78 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.h +13 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c +428 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c +501 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +58 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c +54 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +746 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +163 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +16 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdberror.h +20 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/bintest/mirb.rb +12 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +14 -1
- data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +154 -72
- data/modules/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +46 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +37 -28
- data/modules/mruby/mrbgems/mruby-bin-mruby-config/mrbgem.rake +30 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby-config/mruby-config +16 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby-config/mruby-config.bat +30 -0
- data/modules/mruby/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb +73 -0
- data/modules/mruby/mrbgems/mruby-bin-strip/mrbgem.rake +6 -0
- data/modules/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +155 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +555 -21
- data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +119 -0
- data/modules/mruby/mrbgems/mruby-enum-lazy/mrbgem.rake +7 -0
- data/modules/mruby/mrbgems/mruby-enum-lazy/mrblib/lazy.rb +150 -0
- data/modules/mruby/mrbgems/mruby-enum-lazy/test/lazy.rb +47 -0
- data/modules/mruby/mrbgems/mruby-enumerator/mrbgem.rake +7 -0
- data/modules/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +636 -0
- data/modules/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +537 -0
- data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-eval/src/eval.c +243 -4
- data/modules/mruby/mrbgems/mruby-eval/test/eval.rb +80 -0
- data/modules/mruby/mrbgems/mruby-exit/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-exit/src/mruby-exit.c +1 -1
- data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +157 -51
- data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +179 -35
- data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +3 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +241 -1
- data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +11 -19
- data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +138 -1
- data/modules/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +183 -0
- data/modules/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +53 -0
- data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-math/src/math.c +107 -14
- data/modules/mruby/mrbgems/mruby-math/test/math.rb +16 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +5 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +9 -1
- data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +19 -0
- data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +5 -8
- data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +16 -0
- data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +121 -53
- data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +27 -4
- data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-print/src/print.c +3 -5
- data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +89 -19
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.c +56 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +47 -0
- data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +30 -25
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +6 -3
- data/modules/mruby/mrbgems/mruby-random/src/random.c +157 -137
- data/modules/mruby/mrbgems/mruby-random/src/random.h +3 -3
- data/modules/mruby/mrbgems/mruby-random/test/random.rb +9 -9
- data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +57 -3
- data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +9 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrblib/string.rb +9 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +29 -23
- data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +7 -2
- data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +250 -11
- data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +220 -5
- data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +326 -4
- data/modules/mruby/mrbgems/mruby-string-utf8/mrbgem.rake +2 -0
- data/modules/mruby/mrbgems/mruby-string-utf8/src/string.c +486 -52
- data/modules/mruby/mrbgems/mruby-string-utf8/test/string.rb +97 -14
- data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +31 -0
- data/modules/mruby/mrbgems/mruby-struct/src/struct.c +178 -196
- data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +115 -61
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +22 -17
- data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +20 -11
- data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +14 -0
- data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-time/mrblib/time.rb +9 -0
- data/modules/mruby/mrbgems/mruby-time/src/time.c +98 -37
- data/modules/mruby/mrbgems/mruby-time/test/time.rb +152 -148
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +1 -1
- data/modules/mruby/mrblib/array.rb +110 -4
- data/modules/mruby/mrblib/class.rb +1 -22
- data/modules/mruby/mrblib/compar.rb +10 -30
- data/modules/mruby/mrblib/enum.rb +64 -52
- data/modules/mruby/mrblib/error.rb +9 -4
- data/modules/mruby/mrblib/hash.rb +164 -23
- data/modules/mruby/mrblib/kernel.rb +26 -22
- data/modules/mruby/mrblib/mrblib.rake +4 -4
- data/modules/mruby/mrblib/numeric.rb +22 -9
- data/modules/mruby/mrblib/range.rb +24 -2
- data/modules/mruby/mrblib/string.rb +15 -3
- data/modules/mruby/src/array.c +279 -339
- data/modules/mruby/src/backtrace.c +68 -16
- data/modules/mruby/src/class.c +539 -379
- data/modules/mruby/src/codegen.c +424 -207
- data/modules/mruby/src/compar.c +1 -1
- data/modules/mruby/src/crc.c +7 -6
- data/modules/mruby/src/debug.c +37 -36
- data/modules/mruby/src/dump.c +463 -213
- data/modules/mruby/src/enum.c +1 -1
- data/modules/mruby/src/error.c +91 -92
- data/modules/mruby/src/error.h +3 -19
- data/modules/mruby/src/etc.c +85 -82
- data/modules/mruby/src/gc.c +134 -108
- data/modules/mruby/src/hash.c +161 -565
- data/modules/mruby/src/init.c +2 -13
- data/modules/mruby/src/kernel.c +217 -251
- data/modules/mruby/src/load.c +280 -283
- data/modules/mruby/src/mrb_throw.h +41 -0
- data/modules/mruby/src/mruby_core.rake +57 -7
- data/modules/mruby/src/node.h +104 -104
- data/modules/mruby/src/numeric.c +221 -208
- data/modules/mruby/src/object.c +41 -42
- data/modules/mruby/src/opcode.h +2 -160
- data/modules/mruby/src/parse.y +3430 -3223
- data/modules/mruby/src/pool.c +13 -9
- data/modules/mruby/src/print.c +20 -17
- data/modules/mruby/src/proc.c +77 -21
- data/modules/mruby/src/range.c +55 -45
- data/modules/mruby/src/state.c +95 -31
- data/modules/mruby/src/string.c +462 -468
- data/modules/mruby/src/symbol.c +95 -85
- data/modules/mruby/src/variable.c +104 -74
- data/modules/mruby/src/version.c +13 -0
- data/modules/mruby/src/vm.c +528 -296
- data/modules/mruby/tasks/libmruby.rake +9 -5
- data/modules/mruby/tasks/mrbgem_spec.rake +130 -26
- data/modules/mruby/tasks/mrbgems.rake +21 -11
- data/modules/mruby/tasks/mrbgems_test.rake +46 -40
- data/modules/mruby/tasks/mruby_build.rake +54 -12
- data/modules/mruby/tasks/mruby_build_commands.rake +34 -5
- data/modules/mruby/tasks/mruby_build_gem.rake +25 -3
- data/modules/mruby/tasks/ruby_ext.rake +11 -2
- data/modules/mruby/tasks/toolchains/clang.rake +2 -1
- data/modules/mruby/tasks/toolchains/gcc.rake +26 -3
- data/modules/mruby/tasks/toolchains/visualcpp.rake +17 -8
- data/modules/mruby/test/assert.rb +30 -8
- data/modules/mruby/test/bintest.rb +10 -0
- data/modules/mruby/test/driver.c +74 -24
- data/modules/mruby/test/init_mrbtest.c +21 -2
- data/modules/mruby/test/mrbtest.rake +27 -5
- data/modules/mruby/test/t/argumenterror.rb +0 -5
- data/modules/mruby/test/t/array.rb +23 -7
- data/modules/mruby/test/t/bs_block.rb +32 -0
- data/modules/mruby/test/t/class.rb +29 -5
- data/modules/mruby/test/t/comparable.rb +20 -12
- data/modules/mruby/test/t/enumerable.rb +33 -7
- data/modules/mruby/test/t/exception.rb +63 -38
- data/modules/mruby/test/t/false.rb +2 -4
- data/modules/mruby/test/t/float.rb +39 -4
- data/modules/mruby/test/t/hash.rb +40 -6
- data/modules/mruby/test/t/indexerror.rb +0 -4
- data/modules/mruby/test/t/integer.rb +41 -5
- data/modules/mruby/test/t/kernel.rb +90 -3
- data/modules/mruby/test/t/localjumperror.rb +4 -4
- data/modules/mruby/test/t/methods.rb +1 -1
- data/modules/mruby/test/t/module.rb +43 -13
- data/modules/mruby/test/t/nameerror.rb +0 -4
- data/modules/mruby/test/t/nil.rb +5 -0
- data/modules/mruby/test/t/nomethoderror.rb +11 -2
- data/modules/mruby/test/t/numeric.rb +18 -4
- data/modules/mruby/test/t/proc.rb +59 -6
- data/modules/mruby/test/t/range.rb +15 -5
- data/modules/mruby/test/t/rangeerror.rb +0 -4
- data/modules/mruby/test/t/standarderror.rb +0 -4
- data/modules/mruby/test/t/string.rb +56 -12
- data/modules/mruby/test/t/superclass.rb +46 -0
- data/modules/mruby/test/t/symbol.rb +0 -4
- data/modules/mruby/test/t/syntax.rb +134 -1
- data/modules/mruby/test/t/true.rb +2 -4
- data/modules/mruby/test/t/typeerror.rb +0 -5
- data/modules/mruby/test/t/unicode.rb +35 -0
- data/modules/mruby/tools/mrbc/mrbc.c +9 -12
- data/modules/mruby/travis_config.rb +22 -2
- metadata +98 -1299
- data/modules/emscripten/AUTHORS +0 -117
- data/modules/emscripten/CONTRIBUTING.markdown +0 -5
- data/modules/emscripten/ChangeLog +0 -468
- data/modules/emscripten/LICENSE +0 -94
- data/modules/emscripten/README.markdown +0 -14
- data/modules/emscripten/cmake/Modules/FindOpenAL.cmake +0 -26
- data/modules/emscripten/cmake/Platform/Emscripten.cmake +0 -228
- data/modules/emscripten/em++ +0 -12
- data/modules/emscripten/em++.bat +0 -2
- data/modules/emscripten/em-config +0 -24
- data/modules/emscripten/em-config.bat +0 -2
- data/modules/emscripten/emar +0 -24
- data/modules/emscripten/emar.bat +0 -2
- data/modules/emscripten/emcc +0 -2069
- data/modules/emscripten/emcc.bat +0 -2
- data/modules/emscripten/emcc.py +0 -5
- data/modules/emscripten/emconfigure +0 -27
- data/modules/emscripten/emconfigure.bat +0 -2
- data/modules/emscripten/emlink.py +0 -33
- data/modules/emscripten/emmake +0 -29
- data/modules/emscripten/emmake.bat +0 -2
- data/modules/emscripten/emranlib +0 -9
- data/modules/emscripten/emranlib.bat +0 -2
- data/modules/emscripten/emrun +0 -1087
- data/modules/emscripten/emrun.bat +0 -2
- data/modules/emscripten/emscons +0 -20
- data/modules/emscripten/emscripten.py +0 -1347
- data/modules/emscripten/package.json +0 -7
- data/modules/emscripten/patches/README +0 -4
- data/modules/emscripten/patches/series +0 -2
- data/modules/emscripten/scons-tools/closure.py +0 -28
- data/modules/emscripten/scons-tools/emscripten.py +0 -364
- data/modules/emscripten/scons-tools/llvm.py +0 -34
- data/modules/emscripten/src/analyzer.js +0 -1781
- data/modules/emscripten/src/closure-externs.js +0 -110
- data/modules/emscripten/src/compiler.html +0 -48
- data/modules/emscripten/src/compiler.js +0 -331
- data/modules/emscripten/src/compiler_phase.html +0 -33
- data/modules/emscripten/src/corruptionCheck.js +0 -98
- data/modules/emscripten/src/determinstic.js +0 -20
- data/modules/emscripten/src/embind/embind.js +0 -1677
- data/modules/emscripten/src/embind/emval.js +0 -284
- data/modules/emscripten/src/emrun_postjs.js +0 -20
- data/modules/emscripten/src/emrun_prejs.js +0 -5
- data/modules/emscripten/src/emscripten-source-map.min.js +0 -31
- data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +0 -97
- data/modules/emscripten/src/experimental/batching.diff +0 -44
- data/modules/emscripten/src/experimental/functypeopt.diff +0 -113
- data/modules/emscripten/src/experimental/multiple_heaps.diff +0 -175
- data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +0 -197
- data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +0 -124
- data/modules/emscripten/src/experimental/remove__label__s.diff +0 -140
- data/modules/emscripten/src/experimental/renderer_cache_hash.diff +0 -99
- data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +0 -57
- data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +0 -336
- data/modules/emscripten/src/experimental/stringCache.diff +0 -147
- data/modules/emscripten/src/fastLong.js +0 -299
- data/modules/emscripten/src/gl-matrix.js +0 -1952
- data/modules/emscripten/src/headless.js +0 -295
- data/modules/emscripten/src/headlessCanvas.js +0 -618
- data/modules/emscripten/src/hello_world.js +0 -92
- data/modules/emscripten/src/intertyper.js +0 -1228
- data/modules/emscripten/src/jsifier.js +0 -1969
- data/modules/emscripten/src/library.js +0 -9196
- data/modules/emscripten/src/library_browser.js +0 -988
- data/modules/emscripten/src/library_egl.js +0 -564
- data/modules/emscripten/src/library_fs.js +0 -1619
- data/modules/emscripten/src/library_gc.js +0 -236
- data/modules/emscripten/src/library_gl.js +0 -5194
- data/modules/emscripten/src/library_glfw.js +0 -585
- data/modules/emscripten/src/library_glut.js +0 -504
- data/modules/emscripten/src/library_idbfs.js +0 -216
- data/modules/emscripten/src/library_jansson.js +0 -320
- data/modules/emscripten/src/library_memfs.js +0 -303
- data/modules/emscripten/src/library_nodefs.js +0 -286
- data/modules/emscripten/src/library_openal.js +0 -915
- data/modules/emscripten/src/library_path.js +0 -133
- data/modules/emscripten/src/library_sdl.js +0 -2728
- data/modules/emscripten/src/library_sockfs.js +0 -578
- data/modules/emscripten/src/library_strtok_r.c +0 -97
- data/modules/emscripten/src/library_tty.js +0 -146
- data/modules/emscripten/src/library_uuid.js +0 -140
- data/modules/emscripten/src/library_xlib.js +0 -23
- data/modules/emscripten/src/long.js +0 -1609
- data/modules/emscripten/src/modules.js +0 -543
- data/modules/emscripten/src/parseTools.js +0 -2723
- data/modules/emscripten/src/postamble.js +0 -239
- data/modules/emscripten/src/postamble_sharedlib.js +0 -16
- data/modules/emscripten/src/preamble.js +0 -1233
- data/modules/emscripten/src/preamble_sharedlib.js +0 -25
- data/modules/emscripten/src/proxyClient.js +0 -82
- data/modules/emscripten/src/proxyWorker.js +0 -143
- data/modules/emscripten/src/relooper/README.markdown +0 -14
- data/modules/emscripten/src/relooper/Relooper.cpp +0 -1301
- data/modules/emscripten/src/relooper/Relooper.h +0 -257
- data/modules/emscripten/src/relooper/doit.sh +0 -70
- data/modules/emscripten/src/relooper/emscripten/glue.js +0 -67
- data/modules/emscripten/src/relooper/emscripten/test.js +0 -44
- data/modules/emscripten/src/relooper/fuzzer.py +0 -131
- data/modules/emscripten/src/relooper/ministring.h +0 -35
- data/modules/emscripten/src/relooper/paper.pdf +0 -0
- data/modules/emscripten/src/relooper/test.cpp +0 -290
- data/modules/emscripten/src/relooper/test.txt +0 -317
- data/modules/emscripten/src/relooper/test2.c +0 -44
- data/modules/emscripten/src/relooper/test2.txt +0 -26
- data/modules/emscripten/src/relooper/test3.c +0 -42
- data/modules/emscripten/src/relooper/test3.txt +0 -56
- data/modules/emscripten/src/relooper/test4.cpp +0 -40
- data/modules/emscripten/src/relooper/test4.txt +0 -44
- data/modules/emscripten/src/relooper/test5.cpp +0 -40
- data/modules/emscripten/src/relooper/test5.txt +0 -56
- data/modules/emscripten/src/relooper/test6.cpp +0 -31
- data/modules/emscripten/src/relooper/test6.txt +0 -26
- data/modules/emscripten/src/relooper/test_dead.cpp +0 -28
- data/modules/emscripten/src/relooper/test_dead.txt +0 -9
- data/modules/emscripten/src/relooper/test_debug.cpp +0 -30
- data/modules/emscripten/src/relooper/test_debug.txt +0 -142
- data/modules/emscripten/src/relooper/test_fuzz1.cpp +0 -52
- data/modules/emscripten/src/relooper/test_fuzz1.txt +0 -72
- data/modules/emscripten/src/relooper/test_fuzz2.cpp +0 -34
- data/modules/emscripten/src/relooper/test_fuzz2.txt +0 -30
- data/modules/emscripten/src/relooper/test_fuzz3.cpp +0 -36
- data/modules/emscripten/src/relooper/test_fuzz3.txt +0 -25
- data/modules/emscripten/src/relooper/test_fuzz4.cpp +0 -38
- data/modules/emscripten/src/relooper/test_fuzz4.txt +0 -41
- data/modules/emscripten/src/relooper/test_fuzz5.cpp +0 -57
- data/modules/emscripten/src/relooper/test_fuzz5.txt +0 -86
- data/modules/emscripten/src/relooper/test_fuzz6.cpp +0 -322
- data/modules/emscripten/src/relooper/test_fuzz6.txt +0 -291
- data/modules/emscripten/src/relooper/test_inf.cpp +0 -813
- data/modules/emscripten/src/relooper/test_inf.txt +0 -1131
- data/modules/emscripten/src/relooper/testit.sh +0 -62
- data/modules/emscripten/src/relooper/updateit.sh +0 -17
- data/modules/emscripten/src/runtime.js +0 -604
- data/modules/emscripten/src/settings.js +0 -476
- data/modules/emscripten/src/shell.html +0 -95
- data/modules/emscripten/src/shell.js +0 -173
- data/modules/emscripten/src/shell_sharedlib.js +0 -29
- data/modules/emscripten/src/simd.js +0 -1128
- data/modules/emscripten/src/socket.io.js +0 -3870
- data/modules/emscripten/src/struct_info.json +0 -1077
- data/modules/emscripten/src/utility.js +0 -411
- data/modules/emscripten/src/wrtcp.js +0 -821
- data/modules/emscripten/system/bin/sdl-config +0 -13
- data/modules/emscripten/system/include/AL/al.h +0 -172
- data/modules/emscripten/system/include/AL/alc.h +0 -84
- data/modules/emscripten/system/include/EGL/egl.h +0 -329
- data/modules/emscripten/system/include/EGL/eglext.h +0 -398
- data/modules/emscripten/system/include/EGL/eglplatform.h +0 -141
- data/modules/emscripten/system/include/GL/freeglut_std.h +0 -628
- data/modules/emscripten/system/include/GL/gl.h +0 -2241
- data/modules/emscripten/system/include/GL/glew.h +0 -6
- data/modules/emscripten/system/include/GL/glext.h +0 -11127
- data/modules/emscripten/system/include/GL/glfw.h +0 -518
- data/modules/emscripten/system/include/GL/glu.h +0 -353
- data/modules/emscripten/system/include/GL/glut.h +0 -21
- data/modules/emscripten/system/include/GLES/gl.h +0 -770
- data/modules/emscripten/system/include/GLES/glext.h +0 -1278
- data/modules/emscripten/system/include/GLES/glplatform.h +0 -30
- data/modules/emscripten/system/include/GLES2/gl2.h +0 -621
- data/modules/emscripten/system/include/GLES2/gl2ext.h +0 -803
- data/modules/emscripten/system/include/GLES2/gl2platform.h +0 -30
- data/modules/emscripten/system/include/KHR/khrplatform.h +0 -277
- data/modules/emscripten/system/include/SDL/COPYING +0 -19
- data/modules/emscripten/system/include/SDL/SDL.h +0 -162
- data/modules/emscripten/system/include/SDL/SDL_assert.h +0 -241
- data/modules/emscripten/system/include/SDL/SDL_atomic.h +0 -318
- data/modules/emscripten/system/include/SDL/SDL_audio.h +0 -509
- data/modules/emscripten/system/include/SDL/SDL_blendmode.h +0 -60
- data/modules/emscripten/system/include/SDL/SDL_clipboard.h +0 -75
- data/modules/emscripten/system/include/SDL/SDL_compat.h +0 -365
- data/modules/emscripten/system/include/SDL/SDL_config.h +0 -48
- data/modules/emscripten/system/include/SDL/SDL_config.h.in +0 -297
- data/modules/emscripten/system/include/SDL/SDL_config_android.h +0 -133
- data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +0 -148
- data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +0 -172
- data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +0 -74
- data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +0 -129
- data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +0 -125
- data/modules/emscripten/system/include/SDL/SDL_config_windows.h +0 -207
- data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +0 -119
- data/modules/emscripten/system/include/SDL/SDL_copying.h +0 -20
- data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +0 -150
- data/modules/emscripten/system/include/SDL/SDL_endian.h +0 -248
- data/modules/emscripten/system/include/SDL/SDL_error.h +0 -77
- data/modules/emscripten/system/include/SDL/SDL_events.h +0 -640
- data/modules/emscripten/system/include/SDL/SDL_gesture.h +0 -91
- data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +0 -246
- data/modules/emscripten/system/include/SDL/SDL_haptic.h +0 -1200
- data/modules/emscripten/system/include/SDL/SDL_hints.h +0 -206
- data/modules/emscripten/system/include/SDL/SDL_image.h +0 -138
- data/modules/emscripten/system/include/SDL/SDL_input.h +0 -87
- data/modules/emscripten/system/include/SDL/SDL_joystick.h +0 -208
- data/modules/emscripten/system/include/SDL/SDL_keyboard.h +0 -169
- data/modules/emscripten/system/include/SDL/SDL_keycode.h +0 -344
- data/modules/emscripten/system/include/SDL/SDL_loadso.h +0 -85
- data/modules/emscripten/system/include/SDL/SDL_log.h +0 -211
- data/modules/emscripten/system/include/SDL/SDL_main.h +0 -98
- data/modules/emscripten/system/include/SDL/SDL_mixer.h +0 -634
- data/modules/emscripten/system/include/SDL/SDL_mouse.h +0 -213
- data/modules/emscripten/system/include/SDL/SDL_mutex.h +0 -248
- data/modules/emscripten/system/include/SDL/SDL_name.h +0 -11
- data/modules/emscripten/system/include/SDL/SDL_opengl.h +0 -11116
- data/modules/emscripten/system/include/SDL/SDL_opengles.h +0 -38
- data/modules/emscripten/system/include/SDL/SDL_opengles2.h +0 -38
- data/modules/emscripten/system/include/SDL/SDL_pixels.h +0 -423
- data/modules/emscripten/system/include/SDL/SDL_platform.h +0 -160
- data/modules/emscripten/system/include/SDL/SDL_power.h +0 -79
- data/modules/emscripten/system/include/SDL/SDL_quit.h +0 -58
- data/modules/emscripten/system/include/SDL/SDL_rect.h +0 -136
- data/modules/emscripten/system/include/SDL/SDL_render.h +0 -615
- data/modules/emscripten/system/include/SDL/SDL_revision.h +0 -2
- data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +0 -2
- data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +0 -123
- data/modules/emscripten/system/include/SDL/SDL_rwops.h +0 -220
- data/modules/emscripten/system/include/SDL/SDL_scancode.h +0 -398
- data/modules/emscripten/system/include/SDL/SDL_shape.h +0 -147
- data/modules/emscripten/system/include/SDL/SDL_stdinc.h +0 -764
- data/modules/emscripten/system/include/SDL/SDL_surface.h +0 -499
- data/modules/emscripten/system/include/SDL/SDL_syswm.h +0 -241
- data/modules/emscripten/system/include/SDL/SDL_thread.h +0 -182
- data/modules/emscripten/system/include/SDL/SDL_timer.h +0 -108
- data/modules/emscripten/system/include/SDL/SDL_touch.h +0 -124
- data/modules/emscripten/system/include/SDL/SDL_ttf.h +0 -249
- data/modules/emscripten/system/include/SDL/SDL_types.h +0 -29
- data/modules/emscripten/system/include/SDL/SDL_version.h +0 -166
- data/modules/emscripten/system/include/SDL/SDL_video.h +0 -820
- data/modules/emscripten/system/include/SDL/begin_code.h +0 -135
- data/modules/emscripten/system/include/SDL/close_code.h +0 -37
- data/modules/emscripten/system/include/X11/X.h +0 -717
- data/modules/emscripten/system/include/X11/Xatom.h +0 -79
- data/modules/emscripten/system/include/X11/Xfuncproto.h +0 -127
- data/modules/emscripten/system/include/X11/Xlib.h +0 -4023
- data/modules/emscripten/system/include/X11/Xosdefs.h +0 -116
- data/modules/emscripten/system/include/X11/Xutil.h +0 -826
- data/modules/emscripten/system/include/X11/keysym.h +0 -73
- data/modules/emscripten/system/include/X11/keysymdef.h +0 -2389
- data/modules/emscripten/system/include/compat/ctype.h +0 -34
- data/modules/emscripten/system/include/compat/malloc.h +0 -48
- data/modules/emscripten/system/include/compat/math.h +0 -14
- data/modules/emscripten/system/include/compat/netdb.h +0 -22
- data/modules/emscripten/system/include/compat/stdarg.h +0 -16
- data/modules/emscripten/system/include/compat/stdlib.h +0 -16
- data/modules/emscripten/system/include/compat/string.h +0 -17
- data/modules/emscripten/system/include/compat/sys/socketvar.h +0 -14
- data/modules/emscripten/system/include/compat/sys/stat.h +0 -20
- data/modules/emscripten/system/include/compat/sys/timeb.h +0 -35
- data/modules/emscripten/system/include/compat/time.h +0 -18
- data/modules/emscripten/system/include/compat/unistd.h +0 -16
- data/modules/emscripten/system/include/compat/wchar.h +0 -23
- data/modules/emscripten/system/include/compat/wctype.h +0 -23
- data/modules/emscripten/system/include/compat/xlocale.h +0 -19
- data/modules/emscripten/system/include/emscripten/bind.h +0 -1210
- data/modules/emscripten/system/include/emscripten/emmintrin.h +0 -87
- data/modules/emscripten/system/include/emscripten/emscripten.h +0 -519
- data/modules/emscripten/system/include/emscripten/val.h +0 -311
- data/modules/emscripten/system/include/emscripten/vector.h +0 -34
- data/modules/emscripten/system/include/emscripten/wire.h +0 -393
- data/modules/emscripten/system/include/emscripten/xmmintrin.h +0 -131
- data/modules/emscripten/system/include/execinfo.h +0 -44
- data/modules/emscripten/system/include/gc.h +0 -70
- data/modules/emscripten/system/include/gfx/png.h +0 -3798
- data/modules/emscripten/system/include/gfx/pngconf.h +0 -1665
- data/modules/emscripten/system/include/gfx/tiff.h +0 -654
- data/modules/emscripten/system/include/gfx/tiffconf.h +0 -104
- data/modules/emscripten/system/include/gfx/tiffio.h +0 -526
- data/modules/emscripten/system/include/gfx/tiffvers.h +0 -9
- data/modules/emscripten/system/include/jansson.h +0 -323
- data/modules/emscripten/system/include/jansson_config.h +0 -54
- data/modules/emscripten/system/include/libc/aio.h +0 -69
- data/modules/emscripten/system/include/libc/alloca.h +0 -21
- data/modules/emscripten/system/include/libc/ar.h +0 -25
- data/modules/emscripten/system/include/libc/arpa/ftp.h +0 -35
- data/modules/emscripten/system/include/libc/arpa/inet.h +0 -36
- data/modules/emscripten/system/include/libc/arpa/nameser.h +0 -467
- data/modules/emscripten/system/include/libc/arpa/nameser_compat.h +0 -2
- data/modules/emscripten/system/include/libc/arpa/telnet.h +0 -251
- data/modules/emscripten/system/include/libc/arpa/tftp.h +0 -31
- data/modules/emscripten/system/include/libc/assert.h +0 -19
- data/modules/emscripten/system/include/libc/bits/alltypes.h +0 -397
- data/modules/emscripten/system/include/libc/bits/endian.h +0 -1
- data/modules/emscripten/system/include/libc/bits/errno.h +0 -134
- data/modules/emscripten/system/include/libc/bits/fcntl.h +0 -38
- data/modules/emscripten/system/include/libc/bits/fenv.h +0 -34
- data/modules/emscripten/system/include/libc/bits/float.h +0 -17
- data/modules/emscripten/system/include/libc/bits/io.h +0 -0
- data/modules/emscripten/system/include/libc/bits/ioctl.h +0 -197
- data/modules/emscripten/system/include/libc/bits/ipc.h +0 -14
- data/modules/emscripten/system/include/libc/bits/limits.h +0 -8
- data/modules/emscripten/system/include/libc/bits/mman.h +0 -62
- data/modules/emscripten/system/include/libc/bits/msg.h +0 -16
- data/modules/emscripten/system/include/libc/bits/posix.h +0 -2
- data/modules/emscripten/system/include/libc/bits/reg.h +0 -19
- data/modules/emscripten/system/include/libc/bits/setjmp.h +0 -1
- data/modules/emscripten/system/include/libc/bits/shm.h +0 -18
- data/modules/emscripten/system/include/libc/bits/signal.h +0 -112
- data/modules/emscripten/system/include/libc/bits/socket.h +0 -17
- data/modules/emscripten/system/include/libc/bits/stat.h +0 -22
- data/modules/emscripten/system/include/libc/bits/statfs.h +0 -7
- data/modules/emscripten/system/include/libc/bits/stdarg.h +0 -4
- data/modules/emscripten/system/include/libc/bits/stdint.h +0 -20
- data/modules/emscripten/system/include/libc/bits/syscall.h +0 -696
- data/modules/emscripten/system/include/libc/bits/termios.h +0 -160
- data/modules/emscripten/system/include/libc/bits/user.h +0 -48
- data/modules/emscripten/system/include/libc/byteswap.h +0 -26
- data/modules/emscripten/system/include/libc/complex.h +0 -125
- data/modules/emscripten/system/include/libc/cpio.h +0 -29
- data/modules/emscripten/system/include/libc/crypt.h +0 -20
- data/modules/emscripten/system/include/libc/ctype.h +0 -67
- data/modules/emscripten/system/include/libc/dirent.h +0 -79
- data/modules/emscripten/system/include/libc/dlfcn.h +0 -42
- data/modules/emscripten/system/include/libc/elf.h +0 -2555
- data/modules/emscripten/system/include/libc/endian.h +0 -82
- data/modules/emscripten/system/include/libc/err.h +0 -25
- data/modules/emscripten/system/include/libc/errno.h +0 -27
- data/modules/emscripten/system/include/libc/fcntl.h +0 -175
- data/modules/emscripten/system/include/libc/features.h +0 -32
- data/modules/emscripten/system/include/libc/fenv.h +0 -28
- data/modules/emscripten/system/include/libc/float.h +0 -34
- data/modules/emscripten/system/include/libc/fnmatch.h +0 -29
- data/modules/emscripten/system/include/libc/ftw.h +0 -42
- data/modules/emscripten/system/include/libc/getopt.h +0 -31
- data/modules/emscripten/system/include/libc/glob.h +0 -48
- data/modules/emscripten/system/include/libc/grp.h +0 -52
- data/modules/emscripten/system/include/libc/iconv.h +0 -24
- data/modules/emscripten/system/include/libc/ifaddrs.h +0 -35
- data/modules/emscripten/system/include/libc/inttypes.h +0 -227
- data/modules/emscripten/system/include/libc/iso646.h +0 -20
- data/modules/emscripten/system/include/libc/langinfo.h +0 -88
- data/modules/emscripten/system/include/libc/lastlog.h +0 -1
- data/modules/emscripten/system/include/libc/libgen.h +0 -15
- data/modules/emscripten/system/include/libc/libintl.h +0 -25
- data/modules/emscripten/system/include/libc/limits.h +0 -146
- data/modules/emscripten/system/include/libc/link.h +0 -54
- data/modules/emscripten/system/include/libc/locale.h +0 -82
- data/modules/emscripten/system/include/libc/malloc.h +0 -0
- data/modules/emscripten/system/include/libc/math.h +0 -422
- data/modules/emscripten/system/include/libc/memory.h +0 -1
- data/modules/emscripten/system/include/libc/mntent.h +0 -44
- data/modules/emscripten/system/include/libc/monetary.h +0 -23
- data/modules/emscripten/system/include/libc/mqueue.h +0 -36
- data/modules/emscripten/system/include/libc/net/ethernet.h +0 -55
- data/modules/emscripten/system/include/libc/net/if.h +0 -135
- data/modules/emscripten/system/include/libc/net/if_arp.h +0 -133
- data/modules/emscripten/system/include/libc/net/route.h +0 -124
- data/modules/emscripten/system/include/libc/netdb.h +0 -161
- data/modules/emscripten/system/include/libc/netinet/ether.h +0 -14
- data/modules/emscripten/system/include/libc/netinet/icmp6.h +0 -305
- data/modules/emscripten/system/include/libc/netinet/if_ether.h +0 -126
- data/modules/emscripten/system/include/libc/netinet/in.h +0 -336
- data/modules/emscripten/system/include/libc/netinet/in_systm.h +0 -9
- data/modules/emscripten/system/include/libc/netinet/ip.h +0 -186
- data/modules/emscripten/system/include/libc/netinet/ip6.h +0 -142
- data/modules/emscripten/system/include/libc/netinet/ip_icmp.h +0 -192
- data/modules/emscripten/system/include/libc/netinet/tcp.h +0 -71
- data/modules/emscripten/system/include/libc/netinet/udp.h +0 -35
- data/modules/emscripten/system/include/libc/netpacket/packet.h +0 -44
- data/modules/emscripten/system/include/libc/nl_types.h +0 -22
- data/modules/emscripten/system/include/libc/paths.h +0 -32
- data/modules/emscripten/system/include/libc/poll.h +0 -46
- data/modules/emscripten/system/include/libc/pthread.h +0 -222
- data/modules/emscripten/system/include/libc/pty.h +0 -18
- data/modules/emscripten/system/include/libc/pwd.h +0 -49
- data/modules/emscripten/system/include/libc/readme.txt +0 -3
- data/modules/emscripten/system/include/libc/regex.h +0 -62
- data/modules/emscripten/system/include/libc/resolv.h +0 -144
- data/modules/emscripten/system/include/libc/sched.h +0 -132
- data/modules/emscripten/system/include/libc/search.h +0 -51
- data/modules/emscripten/system/include/libc/semaphore.h +0 -35
- data/modules/emscripten/system/include/libc/setjmp.h +0 -42
- data/modules/emscripten/system/include/libc/shadow.h +0 -44
- data/modules/emscripten/system/include/libc/signal.h +0 -255
- data/modules/emscripten/system/include/libc/spawn.h +0 -74
- data/modules/emscripten/system/include/libc/stdalign.h +0 -15
- data/modules/emscripten/system/include/libc/stdarg.h +0 -25
- data/modules/emscripten/system/include/libc/stdbool.h +0 -14
- data/modules/emscripten/system/include/libc/stddef.h +0 -18
- data/modules/emscripten/system/include/libc/stdint.h +0 -117
- data/modules/emscripten/system/include/libc/stdio.h +0 -199
- data/modules/emscripten/system/include/libc/stdio_ext.h +0 -34
- data/modules/emscripten/system/include/libc/stdlib.h +0 -171
- data/modules/emscripten/system/include/libc/stdnoreturn.h +0 -5
- data/modules/emscripten/system/include/libc/string.h +0 -102
- data/modules/emscripten/system/include/libc/strings.h +0 -35
- data/modules/emscripten/system/include/libc/stropts.h +0 -139
- data/modules/emscripten/system/include/libc/sys/acct.h +0 -75
- data/modules/emscripten/system/include/libc/sys/cachectl.h +0 -22
- data/modules/emscripten/system/include/libc/sys/dir.h +0 -2
- data/modules/emscripten/system/include/libc/sys/epoll.h +0 -67
- data/modules/emscripten/system/include/libc/sys/errno.h +0 -2
- data/modules/emscripten/system/include/libc/sys/eventfd.h +0 -26
- data/modules/emscripten/system/include/libc/sys/fcntl.h +0 -2
- data/modules/emscripten/system/include/libc/sys/file.h +0 -21
- data/modules/emscripten/system/include/libc/sys/fsuid.h +0 -20
- data/modules/emscripten/system/include/libc/sys/inotify.h +0 -57
- data/modules/emscripten/system/include/libc/sys/io.h +0 -17
- data/modules/emscripten/system/include/libc/sys/ioctl.h +0 -14
- data/modules/emscripten/system/include/libc/sys/ipc.h +0 -42
- data/modules/emscripten/system/include/libc/sys/klog.h +0 -14
- data/modules/emscripten/system/include/libc/sys/mman.h +0 -55
- data/modules/emscripten/system/include/libc/sys/mount.h +0 -72
- data/modules/emscripten/system/include/libc/sys/msg.h +0 -52
- data/modules/emscripten/system/include/libc/sys/mtio.h +0 -188
- data/modules/emscripten/system/include/libc/sys/param.h +0 -35
- data/modules/emscripten/system/include/libc/sys/personality.h +0 -46
- data/modules/emscripten/system/include/libc/sys/poll.h +0 -2
- data/modules/emscripten/system/include/libc/sys/prctl.h +0 -101
- data/modules/emscripten/system/include/libc/sys/procfs.h +0 -65
- data/modules/emscripten/system/include/libc/sys/ptrace.h +0 -96
- data/modules/emscripten/system/include/libc/sys/reboot.h +0 -20
- data/modules/emscripten/system/include/libc/sys/reg.h +0 -9
- data/modules/emscripten/system/include/libc/sys/resource.h +0 -103
- data/modules/emscripten/system/include/libc/sys/select.h +0 -42
- data/modules/emscripten/system/include/libc/sys/sem.h +0 -82
- data/modules/emscripten/system/include/libc/sys/sendfile.h +0 -22
- data/modules/emscripten/system/include/libc/sys/shm.h +0 -61
- data/modules/emscripten/system/include/libc/sys/signal.h +0 -2
- data/modules/emscripten/system/include/libc/sys/signalfd.h +0 -44
- data/modules/emscripten/system/include/libc/sys/socket.h +0 -299
- data/modules/emscripten/system/include/libc/sys/stat.h +0 -114
- data/modules/emscripten/system/include/libc/sys/statfs.h +0 -32
- data/modules/emscripten/system/include/libc/sys/statvfs.h +0 -57
- data/modules/emscripten/system/include/libc/sys/stropts.h +0 -1
- data/modules/emscripten/system/include/libc/sys/swap.h +0 -21
- data/modules/emscripten/system/include/libc/sys/syscall.h +0 -6
- data/modules/emscripten/system/include/libc/sys/sysctl.h +0 -17
- data/modules/emscripten/system/include/libc/sys/sysinfo.h +0 -36
- data/modules/emscripten/system/include/libc/sys/syslog.h +0 -1
- data/modules/emscripten/system/include/libc/sys/sysmacros.h +0 -15
- data/modules/emscripten/system/include/libc/sys/termios.h +0 -2
- data/modules/emscripten/system/include/libc/sys/time.h +0 -57
- data/modules/emscripten/system/include/libc/sys/timerfd.h +0 -24
- data/modules/emscripten/system/include/libc/sys/times.h +0 -26
- data/modules/emscripten/system/include/libc/sys/timex.h +0 -98
- data/modules/emscripten/system/include/libc/sys/ttydefaults.h +0 -39
- data/modules/emscripten/system/include/libc/sys/types.h +0 -91
- data/modules/emscripten/system/include/libc/sys/ucontext.h +0 -1
- data/modules/emscripten/system/include/libc/sys/uio.h +0 -48
- data/modules/emscripten/system/include/libc/sys/un.h +0 -32
- data/modules/emscripten/system/include/libc/sys/user.h +0 -16
- data/modules/emscripten/system/include/libc/sys/utsname.h +0 -30
- data/modules/emscripten/system/include/libc/sys/vfs.h +0 -1
- data/modules/emscripten/system/include/libc/sys/wait.h +0 -55
- data/modules/emscripten/system/include/libc/sys/xattr.h +0 -30
- data/modules/emscripten/system/include/libc/syscall.h +0 -1
- data/modules/emscripten/system/include/libc/sysexits.h +0 -21
- data/modules/emscripten/system/include/libc/syslog.h +0 -104
- data/modules/emscripten/system/include/libc/tar.h +0 -33
- data/modules/emscripten/system/include/libc/termios.h +0 -46
- data/modules/emscripten/system/include/libc/tgmath.h +0 -270
- data/modules/emscripten/system/include/libc/time.h +0 -132
- data/modules/emscripten/system/include/libc/ucontext.h +0 -25
- data/modules/emscripten/system/include/libc/ulimit.h +0 -17
- data/modules/emscripten/system/include/libc/unistd.h +0 -519
- data/modules/emscripten/system/include/libc/utime.h +0 -24
- data/modules/emscripten/system/include/libc/utmp.h +0 -47
- data/modules/emscripten/system/include/libc/utmpx.h +0 -58
- data/modules/emscripten/system/include/libc/values.h +0 -39
- data/modules/emscripten/system/include/libc/wchar.h +0 -183
- data/modules/emscripten/system/include/libc/wctype.h +0 -77
- data/modules/emscripten/system/include/libc/wordexp.h +0 -42
- data/modules/emscripten/system/include/libcxx/CREDITS.TXT +0 -123
- data/modules/emscripten/system/include/libcxx/LICENSE.txt +0 -76
- data/modules/emscripten/system/include/libcxx/__bit_reference +0 -1287
- data/modules/emscripten/system/include/libcxx/__config +0 -610
- data/modules/emscripten/system/include/libcxx/__debug +0 -218
- data/modules/emscripten/system/include/libcxx/__functional_03 +0 -2130
- data/modules/emscripten/system/include/libcxx/__functional_base +0 -615
- data/modules/emscripten/system/include/libcxx/__functional_base_03 +0 -1087
- data/modules/emscripten/system/include/libcxx/__hash_table +0 -2457
- data/modules/emscripten/system/include/libcxx/__locale +0 -1445
- data/modules/emscripten/system/include/libcxx/__mutex_base +0 -407
- data/modules/emscripten/system/include/libcxx/__split_buffer +0 -654
- data/modules/emscripten/system/include/libcxx/__sso_allocator +0 -77
- data/modules/emscripten/system/include/libcxx/__std_stream +0 -359
- data/modules/emscripten/system/include/libcxx/__tree +0 -2309
- data/modules/emscripten/system/include/libcxx/__tuple +0 -305
- data/modules/emscripten/system/include/libcxx/__tuple_03 +0 -27
- data/modules/emscripten/system/include/libcxx/__undef_min_max +0 -27
- data/modules/emscripten/system/include/libcxx/algorithm +0 -5679
- data/modules/emscripten/system/include/libcxx/array +0 -342
- data/modules/emscripten/system/include/libcxx/atomic +0 -1531
- data/modules/emscripten/system/include/libcxx/bitset +0 -1081
- data/modules/emscripten/system/include/libcxx/cassert +0 -25
- data/modules/emscripten/system/include/libcxx/ccomplex +0 -29
- data/modules/emscripten/system/include/libcxx/cctype +0 -164
- data/modules/emscripten/system/include/libcxx/cerrno +0 -393
- data/modules/emscripten/system/include/libcxx/cfenv +0 -82
- data/modules/emscripten/system/include/libcxx/cfloat +0 -78
- data/modules/emscripten/system/include/libcxx/chrono +0 -1027
- data/modules/emscripten/system/include/libcxx/cinttypes +0 -259
- data/modules/emscripten/system/include/libcxx/ciso646 +0 -25
- data/modules/emscripten/system/include/libcxx/climits +0 -48
- data/modules/emscripten/system/include/libcxx/clocale +0 -53
- data/modules/emscripten/system/include/libcxx/cmath +0 -1690
- data/modules/emscripten/system/include/libcxx/codecvt +0 -550
- data/modules/emscripten/system/include/libcxx/complex +0 -1567
- data/modules/emscripten/system/include/libcxx/complex.h +0 -35
- data/modules/emscripten/system/include/libcxx/condition_variable +0 -256
- data/modules/emscripten/system/include/libcxx/csetjmp +0 -52
- data/modules/emscripten/system/include/libcxx/csignal +0 -58
- data/modules/emscripten/system/include/libcxx/cstdarg +0 -48
- data/modules/emscripten/system/include/libcxx/cstdbool +0 -32
- data/modules/emscripten/system/include/libcxx/cstddef +0 -103
- data/modules/emscripten/system/include/libcxx/cstdint +0 -191
- data/modules/emscripten/system/include/libcxx/cstdio +0 -182
- data/modules/emscripten/system/include/libcxx/cstdlib +0 -172
- data/modules/emscripten/system/include/libcxx/cstring +0 -112
- data/modules/emscripten/system/include/libcxx/ctgmath +0 -29
- data/modules/emscripten/system/include/libcxx/ctime +0 -72
- data/modules/emscripten/system/include/libcxx/cwchar +0 -217
- data/modules/emscripten/system/include/libcxx/cwctype +0 -213
- data/modules/emscripten/system/include/libcxx/deque +0 -2873
- data/modules/emscripten/system/include/libcxx/dynarray +0 -311
- data/modules/emscripten/system/include/libcxx/exception +0 -250
- data/modules/emscripten/system/include/libcxx/ext/__hash +0 -46
- data/modules/emscripten/system/include/libcxx/ext/hash_map +0 -1007
- data/modules/emscripten/system/include/libcxx/ext/hash_set +0 -661
- data/modules/emscripten/system/include/libcxx/forward_list +0 -1663
- data/modules/emscripten/system/include/libcxx/fstream +0 -1431
- data/modules/emscripten/system/include/libcxx/functional +0 -2418
- data/modules/emscripten/system/include/libcxx/future +0 -2615
- data/modules/emscripten/system/include/libcxx/initializer_list +0 -118
- data/modules/emscripten/system/include/libcxx/iomanip +0 -651
- data/modules/emscripten/system/include/libcxx/ios +0 -1023
- data/modules/emscripten/system/include/libcxx/iosfwd +0 -194
- data/modules/emscripten/system/include/libcxx/iostream +0 -60
- data/modules/emscripten/system/include/libcxx/istream +0 -1716
- data/modules/emscripten/system/include/libcxx/iterator +0 -1568
- data/modules/emscripten/system/include/libcxx/limits +0 -813
- data/modules/emscripten/system/include/libcxx/list +0 -2355
- data/modules/emscripten/system/include/libcxx/locale +0 -4465
- data/modules/emscripten/system/include/libcxx/map +0 -2045
- data/modules/emscripten/system/include/libcxx/memory +0 -5448
- data/modules/emscripten/system/include/libcxx/mutex +0 -566
- data/modules/emscripten/system/include/libcxx/new +0 -146
- data/modules/emscripten/system/include/libcxx/numeric +0 -197
- data/modules/emscripten/system/include/libcxx/optional +0 -697
- data/modules/emscripten/system/include/libcxx/ostream +0 -1295
- data/modules/emscripten/system/include/libcxx/queue +0 -717
- data/modules/emscripten/system/include/libcxx/random +0 -6725
- data/modules/emscripten/system/include/libcxx/ratio +0 -487
- data/modules/emscripten/system/include/libcxx/readme.txt +0 -1
- data/modules/emscripten/system/include/libcxx/regex +0 -6487
- data/modules/emscripten/system/include/libcxx/scoped_allocator +0 -578
- data/modules/emscripten/system/include/libcxx/set +0 -1189
- data/modules/emscripten/system/include/libcxx/shared_mutex +0 -419
- data/modules/emscripten/system/include/libcxx/sstream +0 -972
- data/modules/emscripten/system/include/libcxx/stack +0 -292
- data/modules/emscripten/system/include/libcxx/stdexcept +0 -162
- data/modules/emscripten/system/include/libcxx/streambuf +0 -564
- data/modules/emscripten/system/include/libcxx/string +0 -4198
- data/modules/emscripten/system/include/libcxx/strstream +0 -400
- data/modules/emscripten/system/include/libcxx/support/ibm/limits.h +0 -99
- data/modules/emscripten/system/include/libcxx/support/ibm/support.h +0 -54
- data/modules/emscripten/system/include/libcxx/support/ibm/xlocale.h +0 -326
- data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +0 -5
- data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +0 -38
- data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +0 -146
- data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +0 -79
- data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +0 -129
- data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +0 -115
- data/modules/emscripten/system/include/libcxx/support/win32/support.h +0 -119
- data/modules/emscripten/system/include/libcxx/system_error +0 -642
- data/modules/emscripten/system/include/libcxx/tgmath.h +0 -29
- data/modules/emscripten/system/include/libcxx/thread +0 -458
- data/modules/emscripten/system/include/libcxx/tuple +0 -1102
- data/modules/emscripten/system/include/libcxx/type_traits +0 -3292
- data/modules/emscripten/system/include/libcxx/typeindex +0 -103
- data/modules/emscripten/system/include/libcxx/typeinfo +0 -124
- data/modules/emscripten/system/include/libcxx/unordered_map +0 -2078
- data/modules/emscripten/system/include/libcxx/unordered_set +0 -1379
- data/modules/emscripten/system/include/libcxx/utility +0 -768
- data/modules/emscripten/system/include/libcxx/valarray +0 -4779
- data/modules/emscripten/system/include/libcxx/vector +0 -3246
- data/modules/emscripten/system/include/unwind.h +0 -154
- data/modules/emscripten/system/include/uuid/uuid.h +0 -35
- data/modules/emscripten/system/include/zconf.h +0 -428
- data/modules/emscripten/system/include/zlib.h +0 -1613
- data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +0 -97
- data/modules/emscripten/system/lib/compiler-rt/divdi3.c +0 -47
- data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +0 -116
- data/modules/emscripten/system/lib/compiler-rt/int_lib.h +0 -46
- data/modules/emscripten/system/lib/compiler-rt/int_math.h +0 -67
- data/modules/emscripten/system/lib/compiler-rt/int_types.h +0 -140
- data/modules/emscripten/system/lib/compiler-rt/int_util.h +0 -29
- data/modules/emscripten/system/lib/compiler-rt/muldi3.c +0 -56
- data/modules/emscripten/system/lib/compiler-rt/readme.txt +0 -20
- data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +0 -36
- data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +0 -251
- data/modules/emscripten/system/lib/debugging.cpp +0 -24
- data/modules/emscripten/system/lib/dlmalloc.c +0 -6297
- data/modules/emscripten/system/lib/embind/bind.cpp +0 -63
- data/modules/emscripten/system/lib/libc/gen/err.c +0 -49
- data/modules/emscripten/system/lib/libc/gen/errx.c +0 -49
- data/modules/emscripten/system/lib/libc/gen/verr.c +0 -58
- data/modules/emscripten/system/lib/libc/gen/verrx.c +0 -51
- data/modules/emscripten/system/lib/libc/gen/vwarn.c +0 -55
- data/modules/emscripten/system/lib/libc/gen/vwarnx.c +0 -48
- data/modules/emscripten/system/lib/libc/gen/warn.c +0 -49
- data/modules/emscripten/system/lib/libc/gen/warnx.c +0 -49
- data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +0 -92
- data/modules/emscripten/system/lib/libc/musl/readme.txt +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +0 -125
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +0 -14
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +0 -10
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +0 -63
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +0 -19
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +0 -12
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +0 -19
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +0 -62
- data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +0 -109
- data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +0 -268
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +0 -16
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +0 -29
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +0 -42
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +0 -22
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +0 -71
- data/modules/emscripten/system/lib/libc/musl/src/internal/locale_impl.h +0 -5
- data/modules/emscripten/system/lib/libc/musl/src/internal/stdio_impl.h +0 -92
- data/modules/emscripten/system/lib/libc/musl/src/locale/big5.h +0 -1085
- data/modules/emscripten/system/lib/libc/musl/src/locale/codepages.h +0 -238
- data/modules/emscripten/system/lib/libc/musl/src/locale/gb18030.h +0 -1836
- data/modules/emscripten/system/lib/libc/musl/src/locale/hkscs.h +0 -390
- data/modules/emscripten/system/lib/libc/musl/src/locale/iconv.c +0 -454
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswalnum_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswalpha_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswblank_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswcntrl_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswctype_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswdigit_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswgraph_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswlower_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswprint_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswpunct_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswspace_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswupper_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswxdigit_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/jis0208.h +0 -550
- data/modules/emscripten/system/lib/libc/musl/src/locale/ksc.h +0 -640
- data/modules/emscripten/system/lib/libc/musl/src/locale/legacychars.h +0 -39
- data/modules/emscripten/system/lib/libc/musl/src/locale/strfmon.c +0 -101
- data/modules/emscripten/system/lib/libc/musl/src/locale/strxfrm.c +0 -18
- data/modules/emscripten/system/lib/libc/musl/src/locale/towctrans_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/towlower_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/locale/towupper_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcscoll.c +0 -16
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcscoll_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcsxfrm.c +0 -21
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcsxfrm_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/wctrans_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/wctype_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +0 -38
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +0 -22
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +0 -17
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +0 -18
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +0 -57
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +0 -17
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +0 -65
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +0 -100
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +0 -53
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +0 -38
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +0 -52
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +0 -58
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +0 -18
- data/modules/emscripten/system/lib/libc/musl/src/regex/regcomp.c +0 -3352
- data/modules/emscripten/system/lib/libc/musl/src/regex/regerror.c +0 -35
- data/modules/emscripten/system/lib/libc/musl/src/regex/regexec.c +0 -1011
- data/modules/emscripten/system/lib/libc/musl/src/regex/tre-mem.c +0 -158
- data/modules/emscripten/system/lib/libc/musl/src/regex/tre.h +0 -231
- data/modules/emscripten/system/lib/libc/musl/src/stdio/fwprintf.c +0 -13
- data/modules/emscripten/system/lib/libc/musl/src/stdio/swprintf.c +0 -14
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vfwprintf.c +0 -361
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vswprintf.c +0 -53
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vwprintf.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/stdio/wprintf.c +0 -13
- data/modules/emscripten/system/lib/libc/musl/src/stdlib/ecvt.c +0 -19
- data/modules/emscripten/system/lib/libc/musl/src/stdlib/fcvt.c +0 -25
- data/modules/emscripten/system/lib/libc/musl/src/stdlib/gcvt.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +0 -10
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +0 -11
- data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +0 -10
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +0 -108
- data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +0 -12
- data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +0 -12
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +0 -9
- data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +0 -511
- data/modules/emscripten/system/lib/libc/stdlib/strtod.c +0 -305
- data/modules/emscripten/system/lib/libc.symbols +0 -81
- data/modules/emscripten/system/lib/libcextra.symbols +0 -115
- data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +0 -123
- data/modules/emscripten/system/lib/libcxx/LICENSE.txt +0 -76
- data/modules/emscripten/system/lib/libcxx/algorithm.cpp +0 -84
- data/modules/emscripten/system/lib/libcxx/bind.cpp +0 -30
- data/modules/emscripten/system/lib/libcxx/chrono.cpp +0 -132
- data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +0 -81
- data/modules/emscripten/system/lib/libcxx/debug.cpp +0 -530
- data/modules/emscripten/system/lib/libcxx/exception.cpp +0 -307
- data/modules/emscripten/system/lib/libcxx/future.cpp +0 -291
- data/modules/emscripten/system/lib/libcxx/hash.cpp +0 -570
- data/modules/emscripten/system/lib/libcxx/ios.cpp +0 -460
- data/modules/emscripten/system/lib/libcxx/iostream.cpp +0 -68
- data/modules/emscripten/system/lib/libcxx/locale.cpp +0 -6169
- data/modules/emscripten/system/lib/libcxx/memory.cpp +0 -223
- data/modules/emscripten/system/lib/libcxx/mutex.cpp +0 -253
- data/modules/emscripten/system/lib/libcxx/new.cpp +0 -239
- data/modules/emscripten/system/lib/libcxx/optional.cpp +0 -25
- data/modules/emscripten/system/lib/libcxx/random.cpp +0 -74
- data/modules/emscripten/system/lib/libcxx/readme.txt +0 -1
- data/modules/emscripten/system/lib/libcxx/regex.cpp +0 -325
- data/modules/emscripten/system/lib/libcxx/shared_mutex.cpp +0 -101
- data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +0 -200
- data/modules/emscripten/system/lib/libcxx/string.cpp +0 -530
- data/modules/emscripten/system/lib/libcxx/strstream.cpp +0 -329
- data/modules/emscripten/system/lib/libcxx/support/solaris/README +0 -4
- data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +0 -76
- data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +0 -93
- data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +0 -245
- data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +0 -95
- data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +0 -166
- data/modules/emscripten/system/lib/libcxx/symbols +0 -2699
- data/modules/emscripten/system/lib/libcxx/system_error.cpp +0 -205
- data/modules/emscripten/system/lib/libcxx/thread.cpp +0 -225
- data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +0 -73
- data/modules/emscripten/system/lib/libcxx/utility.cpp +0 -17
- data/modules/emscripten/system/lib/libcxx/valarray.cpp +0 -56
- data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +0 -38
- data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +0 -76
- data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +0 -167
- data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +0 -175
- data/modules/emscripten/system/lib/libcxxabi/lib/buildit +0 -99
- data/modules/emscripten/system/lib/libcxxabi/readme.txt +0 -1
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +0 -50
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +0 -33
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +0 -34
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +0 -11036
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +0 -622
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +0 -123
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +0 -91
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +0 -231
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +0 -125
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +0 -54
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +0 -242
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +0 -1055
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +0 -27
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +0 -367
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +0 -31
- data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +0 -41
- data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +0 -174
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +0 -1146
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +0 -248
- data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +0 -169
- data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +0 -53
- data/modules/emscripten/system/lib/libcxxabi/symbols +0 -236
- data/modules/emscripten/system/lib/sdl.cpp +0 -13
- data/modules/emscripten/system/lib/sdl.symbols +0 -1
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +0 -2347
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +0 -4
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +0 -657
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +0 -147
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +0 -74
- data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +0 -249
- data/modules/emscripten/third_party/CppHeaderParser/README.html +0 -544
- data/modules/emscripten/third_party/CppHeaderParser/README.txt +0 -226
- data/modules/emscripten/third_party/CppHeaderParser/setup.py +0 -43
- data/modules/emscripten/third_party/ansidecl.h +0 -371
- data/modules/emscripten/third_party/closure-compiler/COPYING +0 -202
- data/modules/emscripten/third_party/closure-compiler/README +0 -292
- data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
- data/modules/emscripten/third_party/closure-compiler/readme.txt +0 -3
- data/modules/emscripten/third_party/cp-demangle.h +0 -161
- data/modules/emscripten/third_party/demangle.h +0 -549
- data/modules/emscripten/third_party/demangler.py +0 -49
- data/modules/emscripten/third_party/gcc_demangler.c +0 -4226
- data/modules/emscripten/third_party/gcc_demangler.js +0 -21282
- data/modules/emscripten/third_party/jni/emjvm.cpp +0 -133
- data/modules/emscripten/third_party/jni/emjvm.h +0 -8
- data/modules/emscripten/third_party/jni/emjvm.js +0 -185
- data/modules/emscripten/third_party/jni/jni.h +0 -1154
- data/modules/emscripten/third_party/libiberty.h +0 -634
- data/modules/emscripten/third_party/lzma.js/README.markdown +0 -37
- data/modules/emscripten/third_party/lzma.js/doit.bat +0 -4
- data/modules/emscripten/third_party/lzma.js/doit.sh +0 -44
- data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +0 -7
- data/modules/emscripten/third_party/lzma.js/lzip/COPYING +0 -676
- data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +0 -201
- data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +0 -56
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile +0 -160
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +0 -138
- data/modules/emscripten/third_party/lzma.js/lzip/NEWS +0 -22
- data/modules/emscripten/third_party/lzma.js/lzip/README +0 -77
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +0 -204
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +0 -106
- data/modules/emscripten/third_party/lzma.js/lzip/configure +0 -192
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +0 -252
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +0 -268
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +0 -643
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +0 -582
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +0 -378
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +0 -171
- data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +0 -264
- data/modules/emscripten/third_party/lzma.js/lzip/main.cc +0 -545
- data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +0 -27
- data/modules/emscripten/third_party/lzma.js/lzma-full.js +0 -27
- data/modules/emscripten/third_party/lzma.js/native_test.sh +0 -5
- data/modules/emscripten/third_party/lzma.js/post.js +0 -13
- data/modules/emscripten/third_party/lzma.js/pre.js +0 -13
- data/modules/emscripten/third_party/lzma.js/test-decoder.js +0 -39
- data/modules/emscripten/third_party/lzma.js/test-full.html +0 -9
- data/modules/emscripten/third_party/lzma.js/test-full.js +0 -78
- data/modules/emscripten/third_party/ply/ANNOUNCE +0 -40
- data/modules/emscripten/third_party/ply/CHANGES +0 -1093
- data/modules/emscripten/third_party/ply/PKG-INFO +0 -22
- data/modules/emscripten/third_party/ply/README +0 -271
- data/modules/emscripten/third_party/ply/TODO +0 -16
- data/modules/emscripten/third_party/ply/doc/internal.html +0 -874
- data/modules/emscripten/third_party/ply/doc/makedoc.py +0 -194
- data/modules/emscripten/third_party/ply/doc/ply.html +0 -3262
- data/modules/emscripten/third_party/ply/example/BASIC/README +0 -79
- data/modules/emscripten/third_party/ply/example/BASIC/basic.py +0 -71
- data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +0 -74
- data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +0 -79
- data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +0 -441
- data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +0 -424
- data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +0 -14
- data/modules/emscripten/third_party/ply/example/BASIC/func.bas +0 -5
- data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +0 -22
- data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +0 -13
- data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +0 -4
- data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +0 -17
- data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +0 -12
- data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +0 -13
- data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +0 -4
- data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +0 -20
- data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +0 -18
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +0 -5
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +0 -4
- data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +0 -709
- data/modules/emscripten/third_party/ply/example/GardenSnake/README +0 -5
- data/modules/emscripten/third_party/ply/example/README +0 -10
- data/modules/emscripten/third_party/ply/example/ansic/README +0 -2
- data/modules/emscripten/third_party/ply/example/ansic/clex.py +0 -164
- data/modules/emscripten/third_party/ply/example/ansic/cparse.py +0 -863
- data/modules/emscripten/third_party/ply/example/calc/calc.py +0 -107
- data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +0 -113
- data/modules/emscripten/third_party/ply/example/classcalc/calc.py +0 -157
- data/modules/emscripten/third_party/ply/example/cleanup.sh +0 -2
- data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +0 -130
- data/modules/emscripten/third_party/ply/example/hedit/hedit.py +0 -48
- data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +0 -160
- data/modules/emscripten/third_party/ply/example/optcalc/README +0 -9
- data/modules/emscripten/third_party/ply/example/optcalc/calc.py +0 -119
- data/modules/emscripten/third_party/ply/example/unicalc/calc.py +0 -117
- data/modules/emscripten/third_party/ply/example/yply/README +0 -41
- data/modules/emscripten/third_party/ply/example/yply/ylex.py +0 -112
- data/modules/emscripten/third_party/ply/example/yply/yparse.py +0 -217
- data/modules/emscripten/third_party/ply/example/yply/yply.py +0 -53
- data/modules/emscripten/third_party/ply/ply/__init__.py +0 -4
- data/modules/emscripten/third_party/ply/ply/cpp.py +0 -898
- data/modules/emscripten/third_party/ply/ply/ctokens.py +0 -133
- data/modules/emscripten/third_party/ply/ply/lex.py +0 -1058
- data/modules/emscripten/third_party/ply/ply/yacc.py +0 -3276
- data/modules/emscripten/third_party/ply/setup.py +0 -31
- data/modules/emscripten/third_party/ply/test/README +0 -7
- data/modules/emscripten/third_party/ply/test/calclex.py +0 -49
- data/modules/emscripten/third_party/ply/test/cleanup.sh +0 -4
- data/modules/emscripten/third_party/ply/test/lex_closure.py +0 -54
- data/modules/emscripten/third_party/ply/test/lex_doc1.py +0 -26
- data/modules/emscripten/third_party/ply/test/lex_dup1.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_dup2.py +0 -33
- data/modules/emscripten/third_party/ply/test/lex_dup3.py +0 -31
- data/modules/emscripten/third_party/ply/test/lex_empty.py +0 -20
- data/modules/emscripten/third_party/ply/test/lex_error1.py +0 -24
- data/modules/emscripten/third_party/ply/test/lex_error2.py +0 -26
- data/modules/emscripten/third_party/ply/test/lex_error3.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_error4.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_hedit.py +0 -47
- data/modules/emscripten/third_party/ply/test/lex_ignore.py +0 -31
- data/modules/emscripten/third_party/ply/test/lex_ignore2.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_literal1.py +0 -25
- data/modules/emscripten/third_party/ply/test/lex_literal2.py +0 -25
- data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_module.py +0 -10
- data/modules/emscripten/third_party/ply/test/lex_module_import.py +0 -42
- data/modules/emscripten/third_party/ply/test/lex_object.py +0 -55
- data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +0 -54
- data/modules/emscripten/third_party/ply/test/lex_optimize.py +0 -50
- data/modules/emscripten/third_party/ply/test/lex_optimize2.py +0 -50
- data/modules/emscripten/third_party/ply/test/lex_optimize3.py +0 -52
- data/modules/emscripten/third_party/ply/test/lex_re1.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_re2.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_re3.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_rule1.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_rule2.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_rule3.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_state1.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state2.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state3.py +0 -42
- data/modules/emscripten/third_party/ply/test/lex_state4.py +0 -41
- data/modules/emscripten/third_party/ply/test/lex_state5.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +0 -39
- data/modules/emscripten/third_party/ply/test/lex_state_norule.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state_try.py +0 -45
- data/modules/emscripten/third_party/ply/test/lex_token1.py +0 -19
- data/modules/emscripten/third_party/ply/test/lex_token2.py +0 -22
- data/modules/emscripten/third_party/ply/test/lex_token3.py +0 -24
- data/modules/emscripten/third_party/ply/test/lex_token4.py +0 -26
- data/modules/emscripten/third_party/ply/test/lex_token5.py +0 -31
- data/modules/emscripten/third_party/ply/test/lex_token_dup.py +0 -29
- data/modules/emscripten/third_party/ply/test/testlex.py +0 -606
- data/modules/emscripten/third_party/ply/test/testyacc.py +0 -347
- data/modules/emscripten/third_party/ply/test/yacc_badargs.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badid.py +0 -77
- data/modules/emscripten/third_party/ply/test/yacc_badprec.py +0 -64
- data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badrule.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badtok.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_dup.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_error1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_error2.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_error3.py +0 -67
- data/modules/emscripten/third_party/ply/test/yacc_error4.py +0 -72
- data/modules/emscripten/third_party/ply/test/yacc_inf.py +0 -56
- data/modules/emscripten/third_party/ply/test/yacc_literal.py +0 -69
- data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_missing1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_nested.py +0 -33
- data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +0 -67
- data/modules/emscripten/third_party/ply/test/yacc_noerror.py +0 -66
- data/modules/emscripten/third_party/ply/test/yacc_nop.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +0 -66
- data/modules/emscripten/third_party/ply/test/yacc_notok.py +0 -67
- data/modules/emscripten/third_party/ply/test/yacc_prec1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_rr.py +0 -72
- data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +0 -30
- data/modules/emscripten/third_party/ply/test/yacc_simple.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_sr.py +0 -63
- data/modules/emscripten/third_party/ply/test/yacc_term1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_unused.py +0 -77
- data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +0 -72
- data/modules/emscripten/third_party/ply/test/yacc_uprec.py +0 -63
- data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +0 -63
- data/modules/emscripten/third_party/readme.txt +0 -7
- data/modules/emscripten/third_party/stb_image.c +0 -4673
- data/modules/emscripten/third_party/websockify/CHANGES.txt +0 -23
- data/modules/emscripten/third_party/websockify/LICENSE.txt +0 -16
- data/modules/emscripten/third_party/websockify/MANIFEST.in +0 -1
- data/modules/emscripten/third_party/websockify/Makefile +0 -11
- data/modules/emscripten/third_party/websockify/README.md +0 -168
- data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +0 -39
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +0 -24
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +0 -61
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +0 -19
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +0 -129
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +0 -36
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +0 -37
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +0 -41
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +0 -75
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +0 -20
- data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +0 -621
- data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +0 -165
- data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +0 -373
- data/modules/emscripten/third_party/websockify/docs/TODO +0 -9
- data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +0 -4
- data/modules/emscripten/third_party/websockify/docs/latency_results.txt +0 -114
- data/modules/emscripten/third_party/websockify/docs/notes +0 -17
- data/modules/emscripten/third_party/websockify/docs/release.txt +0 -9
- data/modules/emscripten/third_party/websockify/docs/websockify.1 +0 -110
- data/modules/emscripten/third_party/websockify/include/VT100.js +0 -919
- data/modules/emscripten/third_party/websockify/include/base64.js +0 -114
- data/modules/emscripten/third_party/websockify/include/keysym.js +0 -99
- data/modules/emscripten/third_party/websockify/include/util.js +0 -359
- data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +0 -109
- data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +0 -4
- data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +0 -391
- data/modules/emscripten/third_party/websockify/include/websock.js +0 -422
- data/modules/emscripten/third_party/websockify/include/webutil.js +0 -216
- data/modules/emscripten/third_party/websockify/include/wsirc.js +0 -235
- data/modules/emscripten/third_party/websockify/include/wstelnet.js +0 -335
- data/modules/emscripten/third_party/websockify/other/Makefile +0 -14
- data/modules/emscripten/third_party/websockify/other/README.md +0 -51
- data/modules/emscripten/third_party/websockify/other/launch.sh +0 -108
- data/modules/emscripten/third_party/websockify/other/project.clj +0 -13
- data/modules/emscripten/third_party/websockify/other/websocket.c +0 -802
- data/modules/emscripten/third_party/websockify/other/websocket.h +0 -84
- data/modules/emscripten/third_party/websockify/other/websocket.rb +0 -456
- data/modules/emscripten/third_party/websockify/other/websockify.c +0 -385
- data/modules/emscripten/third_party/websockify/other/websockify.clj +0 -233
- data/modules/emscripten/third_party/websockify/other/websockify.js +0 -196
- data/modules/emscripten/third_party/websockify/other/websockify.rb +0 -171
- data/modules/emscripten/third_party/websockify/other/wswrap +0 -22
- data/modules/emscripten/third_party/websockify/rebind +0 -18
- data/modules/emscripten/third_party/websockify/rebind.c +0 -94
- data/modules/emscripten/third_party/websockify/run +0 -5
- data/modules/emscripten/third_party/websockify/setup.py +0 -30
- data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +0 -29
- data/modules/emscripten/third_party/websockify/tests/base64.html +0 -91
- data/modules/emscripten/third_party/websockify/tests/base64.js +0 -12
- data/modules/emscripten/third_party/websockify/tests/echo.html +0 -148
- data/modules/emscripten/third_party/websockify/tests/echo.py +0 -75
- data/modules/emscripten/third_party/websockify/tests/echo.rb +0 -62
- data/modules/emscripten/third_party/websockify/tests/latency.html +0 -290
- data/modules/emscripten/third_party/websockify/tests/latency.py +0 -75
- data/modules/emscripten/third_party/websockify/tests/load.html +0 -250
- data/modules/emscripten/third_party/websockify/tests/load.py +0 -167
- data/modules/emscripten/third_party/websockify/tests/plain_echo.html +0 -168
- data/modules/emscripten/third_party/websockify/tests/simple.html +0 -68
- data/modules/emscripten/third_party/websockify/tests/utf8-list.py +0 -22
- data/modules/emscripten/third_party/websockify/websockify/__init__.py +0 -2
- data/modules/emscripten/third_party/websockify/websockify/websocket.py +0 -982
- data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +0 -393
- data/modules/emscripten/third_party/websockify/websockify.py +0 -5
- data/modules/emscripten/third_party/websockify/wsirc.html +0 -99
- data/modules/emscripten/third_party/websockify/wstelnet.html +0 -74
- data/modules/emscripten/tools/__init__.py +0 -0
- data/modules/emscripten/tools/asm_module.py +0 -275
- data/modules/emscripten/tools/autodebugger.py +0 -291
- data/modules/emscripten/tools/autodebugger_c.py +0 -37
- data/modules/emscripten/tools/autodebugger_indenter.py +0 -18
- data/modules/emscripten/tools/autodebugger_js.py +0 -47
- data/modules/emscripten/tools/autodediffer.py +0 -60
- data/modules/emscripten/tools/bindings_generator.py +0 -832
- data/modules/emscripten/tools/bisect_pair.py +0 -88
- data/modules/emscripten/tools/cache.py +0 -196
- data/modules/emscripten/tools/clean_webconsole.py +0 -34
- data/modules/emscripten/tools/crunch-worker.js +0 -124
- data/modules/emscripten/tools/diff_autodebugger.py +0 -15
- data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +0 -307
- data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +0 -382
- data/modules/emscripten/tools/eliminator/eliminator-test-output.js +0 -6136
- data/modules/emscripten/tools/eliminator/eliminator-test.js +0 -8879
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +0 -888
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +0 -463
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +0 -317
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +0 -75
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +0 -75
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +0 -1363
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +0 -2005
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +0 -51
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +0 -22
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +0 -28
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +0 -402
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +0 -6
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +0 -20
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +0 -5
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +0 -10
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +0 -6
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +0 -9
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +0 -16
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +0 -6
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +0 -7
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +0 -9
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +0 -5
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +0 -5
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +0 -2
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +0 -55
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +0 -33
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +0 -97
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +0 -138
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +0 -16
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +0 -17
- data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +0 -85
- data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +0 -103
- data/modules/emscripten/tools/emconfiguren.py +0 -19
- data/modules/emscripten/tools/emmaken.py +0 -230
- data/modules/emscripten/tools/emmakenxx.py +0 -18
- data/modules/emscripten/tools/exec_llvm.py +0 -50
- data/modules/emscripten/tools/file2json.py +0 -49
- data/modules/emscripten/tools/file_packager.py +0 -719
- data/modules/emscripten/tools/find_bigfuncs.py +0 -23
- data/modules/emscripten/tools/find_bigis.py +0 -18
- data/modules/emscripten/tools/find_bigvars.py +0 -24
- data/modules/emscripten/tools/fix_closure.py +0 -88
- data/modules/emscripten/tools/gen_struct_info.py +0 -509
- data/modules/emscripten/tools/ie7_fix.py +0 -14
- data/modules/emscripten/tools/js-optimizer.js +0 -4023
- data/modules/emscripten/tools/js_optimizer.py +0 -357
- data/modules/emscripten/tools/jsrun.py +0 -37
- data/modules/emscripten/tools/ll-strip.py +0 -56
- data/modules/emscripten/tools/make_file.py +0 -19
- data/modules/emscripten/tools/make_minigzip.py +0 -13
- data/modules/emscripten/tools/merge_asm.py +0 -26
- data/modules/emscripten/tools/namespacer.py +0 -95
- data/modules/emscripten/tools/nativize_llvm.py +0 -34
- data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +0 -58
- data/modules/emscripten/tools/node_modules/source-map/LICENSE +0 -28
- data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +0 -166
- data/modules/emscripten/tools/node_modules/source-map/README.md +0 -347
- data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +0 -56
- data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +0 -152
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +0 -20
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +0 -18
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +0 -8
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +0 -6
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +0 -21
- data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +0 -8
- data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +0 -3
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +0 -96
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +0 -144
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +0 -42
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +0 -81
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +0 -430
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +0 -381
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +0 -353
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +0 -117
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +0 -8
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +0 -58
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +0 -119
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +0 -299
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +0 -33
- data/modules/emscripten/tools/node_modules/source-map/package.json +0 -74
- data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +0 -73
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +0 -26
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +0 -71
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +0 -24
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +0 -35
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +0 -54
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +0 -72
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +0 -306
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +0 -391
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +0 -282
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +0 -152
- data/modules/emscripten/tools/reproduceriter.js +0 -216
- data/modules/emscripten/tools/reproduceriter.py +0 -160
- data/modules/emscripten/tools/response_file.py +0 -34
- data/modules/emscripten/tools/scan_js.py +0 -20
- data/modules/emscripten/tools/scan_ll.py +0 -18
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +0 -3
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +0 -46
- data/modules/emscripten/tools/settings_template_readonly.py +0 -49
- data/modules/emscripten/tools/shared.py +0 -1705
- data/modules/emscripten/tools/source-maps/sourcemap2json.js +0 -15
- data/modules/emscripten/tools/source-maps/sourcemapper.js +0 -208
- data/modules/emscripten/tools/split.py +0 -105
- data/modules/emscripten/tools/split_asm.py +0 -30
- data/modules/emscripten/tools/tempfiles.py +0 -41
- data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +0 -75
- data/modules/emscripten/tools/test-js-optimizer-asm-last.js +0 -91
- data/modules/emscripten/tools/test-js-optimizer-asm-minlast-output.js +0 -2
- data/modules/emscripten/tools/test-js-optimizer-asm-minlast.js +0 -8
- data/modules/emscripten/tools/test-js-optimizer-asm-outline1-output.js +0 -929
- data/modules/emscripten/tools/test-js-optimizer-asm-outline1.js +0 -351
- data/modules/emscripten/tools/test-js-optimizer-asm-outline2-output.js +0 -793
- data/modules/emscripten/tools/test-js-optimizer-asm-outline2.js +0 -606
- data/modules/emscripten/tools/test-js-optimizer-asm-outline3-output.js +0 -28
- data/modules/emscripten/tools/test-js-optimizer-asm-outline3.js +0 -30
- data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +0 -522
- data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +0 -533
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +0 -36
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +0 -37
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +0 -106
- data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +0 -110
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +0 -9
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +0 -12
- data/modules/emscripten/tools/test-js-optimizer-output.js +0 -291
- data/modules/emscripten/tools/test-js-optimizer-regs-output.js +0 -232
- data/modules/emscripten/tools/test-js-optimizer-regs.js +0 -237
- data/modules/emscripten/tools/test-js-optimizer-t2-output.js +0 -91
- data/modules/emscripten/tools/test-js-optimizer-t2.js +0 -92
- data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +0 -17
- data/modules/emscripten/tools/test-js-optimizer-t2c.js +0 -18
- data/modules/emscripten/tools/test-js-optimizer-t3-output.js +0 -49
- data/modules/emscripten/tools/test-js-optimizer-t3.js +0 -50
- data/modules/emscripten/tools/test-js-optimizer.js +0 -401
- data/modules/emscripten/tools/validate_asmjs.py +0 -82
- data/modules/mruby/mrblib/print.rb +0 -18
- data/modules/mruby/src/re.h +0 -12
@@ -1,2723 +0,0 @@
|
|
1
|
-
//"use strict";
|
2
|
-
|
3
|
-
// Various tools for parsing LLVM. Utilities of various sorts, that are
|
4
|
-
// specific to Emscripten (and hence not in utility.js).
|
5
|
-
|
6
|
-
// Does simple 'macro' substitution, using Django-like syntax,
|
7
|
-
// {{{ code }}} will be replaced with |eval(code)|.
|
8
|
-
// NOTE: Be careful with that ret check. If ret is |0|, |ret ? ret.toString() : ''| would result in ''!
|
9
|
-
function processMacros(text) {
|
10
|
-
return text.replace(/{{{([^}]|}(?!}))+}}}/g, function(str) {
|
11
|
-
str = str.substr(3, str.length-6);
|
12
|
-
var ret = eval(str);
|
13
|
-
return ret !== null ? ret.toString() : '';
|
14
|
-
});
|
15
|
-
}
|
16
|
-
|
17
|
-
// Simple #if/else/endif preprocessing for a file. Checks if the
|
18
|
-
// ident checked is true in our global.
|
19
|
-
// Also handles #include x.js (similar to C #include <file>)
|
20
|
-
function preprocess(text) {
|
21
|
-
var lines = text.split('\n');
|
22
|
-
var ret = '';
|
23
|
-
var showStack = [];
|
24
|
-
for (var i = 0; i < lines.length; i++) {
|
25
|
-
var line = lines[i];
|
26
|
-
if (line[line.length-1] == '\r') {
|
27
|
-
line = line.substr(0, line.length-1); // Windows will have '\r' left over from splitting over '\r\n'
|
28
|
-
}
|
29
|
-
if (!line[0] || line[0] != '#') {
|
30
|
-
if (showStack.indexOf(false) == -1) {
|
31
|
-
ret += line + '\n';
|
32
|
-
}
|
33
|
-
} else {
|
34
|
-
if (line[1] == 'i') {
|
35
|
-
if (line[2] == 'f') { // if
|
36
|
-
var parts = line.split(' ');
|
37
|
-
var ident = parts[1];
|
38
|
-
var op = parts[2];
|
39
|
-
var value = parts[3];
|
40
|
-
if (op) {
|
41
|
-
if (op === '==') {
|
42
|
-
showStack.push(ident in this && this[ident] == value);
|
43
|
-
} else if (op === '!=') {
|
44
|
-
showStack.push(!(ident in this && this[ident] == value));
|
45
|
-
} else {
|
46
|
-
error('unsupported preprecessor op ' + op);
|
47
|
-
}
|
48
|
-
} else {
|
49
|
-
showStack.push(ident in this && this[ident] > 0);
|
50
|
-
}
|
51
|
-
} else if (line[2] == 'n') { // include
|
52
|
-
var included = read(line.substr(line.indexOf(' ')+1));
|
53
|
-
ret += '\n' + preprocess(included) + '\n'
|
54
|
-
}
|
55
|
-
} else if (line[2] == 'l') { // else
|
56
|
-
showStack.push(!showStack.pop());
|
57
|
-
} else if (line[2] == 'n') { // endif
|
58
|
-
showStack.pop();
|
59
|
-
} else {
|
60
|
-
throw "Unclear preprocessor command: " + line;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
assert(showStack.length == 0);
|
65
|
-
return ret;
|
66
|
-
}
|
67
|
-
|
68
|
-
function addPointing(type) { return type + '*' }
|
69
|
-
function removePointing(type, num) {
|
70
|
-
if (num === 0) return type;
|
71
|
-
assert(type.substr(type.length-(num ? num : 1)).replace(/\*/g, '') === ''); //, 'Error in removePointing with ' + [type, num, type.substr(type.length-(num ? num : 1))]);
|
72
|
-
return type.substr(0, type.length-(num ? num : 1));
|
73
|
-
}
|
74
|
-
|
75
|
-
function pointingLevels(type) {
|
76
|
-
if (!type) return 0;
|
77
|
-
var ret = 0;
|
78
|
-
var len1 = type.length - 1;
|
79
|
-
while (type[len1-ret] && type[len1-ret] === '*') {
|
80
|
-
ret++;
|
81
|
-
}
|
82
|
-
return ret;
|
83
|
-
}
|
84
|
-
|
85
|
-
function removeAllPointing(type) {
|
86
|
-
return removePointing(type, pointingLevels(type));
|
87
|
-
}
|
88
|
-
|
89
|
-
function toNiceIdent(ident) {
|
90
|
-
assert(ident);
|
91
|
-
if (parseFloat(ident) == ident) return ident;
|
92
|
-
if (ident == 'null') return '0'; // see parseNumerical
|
93
|
-
if (ident == 'undef') return '0';
|
94
|
-
return ident.replace('%', '$').replace(/["&\\ \.@:<>,\*\[\]\(\)-]/g, '_');
|
95
|
-
}
|
96
|
-
|
97
|
-
// Kind of a hack. In some cases we have strings that we do not want
|
98
|
-
// to |toNiceIdent|, as they are the output of previous processing. We
|
99
|
-
// should refactor everything into an object, with an explicit flag
|
100
|
-
// saying what has been |toNiceIdent|ed. Until then, this will detect
|
101
|
-
// simple idents that are in need of |toNiceIdent|ation. Or, we should
|
102
|
-
// ensure that processed strings never start with %,@, e.g. by always
|
103
|
-
// enclosing them in ().
|
104
|
-
function toNiceIdentCarefully(ident) {
|
105
|
-
if (ident[0] == '%' || ident[0] == '@') ident = toNiceIdent(ident);
|
106
|
-
return ident;
|
107
|
-
}
|
108
|
-
|
109
|
-
// Returns true if ident is a niceIdent (see toNiceIdent). If loose
|
110
|
-
// is true, then also allow () and spaces.
|
111
|
-
function isNiceIdent(ident, loose) {
|
112
|
-
if (loose) {
|
113
|
-
return /^\(?[$_]+[\w$_\d ]*\)?$/.test(ident);
|
114
|
-
} else {
|
115
|
-
return /^[$_]+[\w$_\d]*$/.test(ident);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
function isJSVar(ident) {
|
120
|
-
if (ident[0] === '(') {
|
121
|
-
if (ident[ident.length-1] !== ')') return false;
|
122
|
-
ident = ident.substr(1, ident.length-2);
|
123
|
-
}
|
124
|
-
return /^[$_]?[\w$_\d]* *$/.test(ident);
|
125
|
-
}
|
126
|
-
|
127
|
-
function isLocalVar(ident) {
|
128
|
-
return ident[0] === '$';
|
129
|
-
}
|
130
|
-
|
131
|
-
// Simple variables or numbers, or things already quoted, do not need to be quoted
|
132
|
-
function needsQuoting(ident) {
|
133
|
-
if (/^[-+]?[$_]?[\w$_\d]*$/.test(ident)) return false; // number or variable
|
134
|
-
if (ident[0] === '(' && ident[ident.length-1] === ')' && ident.indexOf('(', 1) < 0) return false; // already fully quoted
|
135
|
-
return true;
|
136
|
-
}
|
137
|
-
|
138
|
-
function isStructPointerType(type) {
|
139
|
-
// This test is necessary for clang - in llvm-gcc, we
|
140
|
-
// could check for %struct. The downside is that %1 can
|
141
|
-
// be either a variable or a structure, and we guess it is
|
142
|
-
// a struct, which can lead to |call i32 %5()| having
|
143
|
-
// |%5()| as a function call (like |i32 (i8*)| etc.). So
|
144
|
-
// we must check later on, in call(), where we have more
|
145
|
-
// context, to differentiate such cases.
|
146
|
-
// A similar thing happens in isStructType()
|
147
|
-
return !Runtime.isNumberType(type) && type[0] == '%';
|
148
|
-
}
|
149
|
-
|
150
|
-
function isPointerType(type) {
|
151
|
-
return type[type.length-1] == '*';
|
152
|
-
}
|
153
|
-
|
154
|
-
function isArrayType(type) {
|
155
|
-
return /^\[\d+\ x\ (.*)\]/.test(type);
|
156
|
-
}
|
157
|
-
|
158
|
-
function isStructType(type) {
|
159
|
-
if (isPointerType(type)) return false;
|
160
|
-
if (isArrayType(type)) return true;
|
161
|
-
if (/<?{ ?[^}]* ?}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
|
162
|
-
// See comment in isStructPointerType()
|
163
|
-
return type[0] == '%';
|
164
|
-
}
|
165
|
-
|
166
|
-
function isVectorType(type) {
|
167
|
-
return type[type.length-1] === '>';
|
168
|
-
}
|
169
|
-
|
170
|
-
function isStructuralType(type) {
|
171
|
-
return /^{ ?[^}]* ?}$/.test(type); // { i32, i8 } etc. - anonymous struct types
|
172
|
-
}
|
173
|
-
|
174
|
-
function getStructuralTypeParts(type) { // split { i32, i8 } etc. into parts
|
175
|
-
return type.replace(/[ {}]/g, '').split(',');
|
176
|
-
}
|
177
|
-
|
178
|
-
function getStructureTypeParts(type) {
|
179
|
-
if (isStructuralType(type)) {
|
180
|
-
return type.replace(/[ {}]/g, '').split(',');
|
181
|
-
} else {
|
182
|
-
var typeData = Types.types[type];
|
183
|
-
assert(typeData, type);
|
184
|
-
return typeData.fields;
|
185
|
-
}
|
186
|
-
}
|
187
|
-
|
188
|
-
function getStructuralTypePartBits(part) {
|
189
|
-
return Math.ceil((getBits(part) || 32)/32)*32; // simple 32-bit alignment. || 32 is for pointers
|
190
|
-
}
|
191
|
-
|
192
|
-
function isIntImplemented(type) {
|
193
|
-
return type[0] == 'i' || isPointerType(type);
|
194
|
-
}
|
195
|
-
|
196
|
-
// Note: works for iX types and structure types, not pointers (even though they are implemented as ints)
|
197
|
-
function getBits(type, allowPointers) {
|
198
|
-
if (allowPointers && isPointerType(type)) return 32;
|
199
|
-
if (!type) return 0;
|
200
|
-
if (type[0] == 'i') {
|
201
|
-
var left = type.substr(1);
|
202
|
-
if (!isNumber(left)) return 0;
|
203
|
-
return parseInt(left);
|
204
|
-
}
|
205
|
-
if (isStructuralType(type)) {
|
206
|
-
return sum(getStructuralTypeParts(type).map(getStructuralTypePartBits));
|
207
|
-
}
|
208
|
-
if (isStructType(type)) {
|
209
|
-
var typeData = Types.types[type];
|
210
|
-
if (typeData === undefined) return 0;
|
211
|
-
return typeData.flatSize*8;
|
212
|
-
}
|
213
|
-
return 0;
|
214
|
-
}
|
215
|
-
|
216
|
-
function getNumIntChunks(type) {
|
217
|
-
return Math.ceil(getBits(type, true)/32);
|
218
|
-
}
|
219
|
-
|
220
|
-
function isIdenticallyImplemented(type1, type2) {
|
221
|
-
var floats = +(type1 in Runtime.FLOAT_TYPES) + +(type2 in Runtime.FLOAT_TYPES);
|
222
|
-
if (floats == 2) return true;
|
223
|
-
if (floats == 1) return false;
|
224
|
-
return getNumIntChunks(type1) == getNumIntChunks(type2);
|
225
|
-
}
|
226
|
-
|
227
|
-
function isIllegalType(type) {
|
228
|
-
switch (type) {
|
229
|
-
case 'i1':
|
230
|
-
case 'i8':
|
231
|
-
case 'i16':
|
232
|
-
case 'i32':
|
233
|
-
case 'float':
|
234
|
-
case 'double':
|
235
|
-
case 'rawJS':
|
236
|
-
case '<2 x float>':
|
237
|
-
case '<4 x float>':
|
238
|
-
case '<2 x i32>':
|
239
|
-
case '<4 x i32>':
|
240
|
-
case 'void': return false;
|
241
|
-
}
|
242
|
-
if (!type || type[type.length-1] === '*') return false;
|
243
|
-
return true;
|
244
|
-
}
|
245
|
-
|
246
|
-
function isVoidType(type) {
|
247
|
-
return type == 'void';
|
248
|
-
}
|
249
|
-
|
250
|
-
// Detects a function definition, ([...|type,[type,...]])
|
251
|
-
function isFunctionDef(token, out) {
|
252
|
-
var text = token.text;
|
253
|
-
var nonPointing = removeAllPointing(text);
|
254
|
-
if (nonPointing[0] != '(' || nonPointing.substr(-1) != ')')
|
255
|
-
return false;
|
256
|
-
if (nonPointing === '()') return true;
|
257
|
-
if (!token.tokens) return false;
|
258
|
-
var fail = false;
|
259
|
-
var segments = splitTokenList(token.tokens);
|
260
|
-
segments.forEach(function(segment) {
|
261
|
-
var subtext = segment[0].text;
|
262
|
-
fail = fail || segment.length > 1 || !(isType(subtext) || subtext == '...');
|
263
|
-
});
|
264
|
-
if (out) {
|
265
|
-
out.segments = segments;
|
266
|
-
out.numArgs = segments.length;
|
267
|
-
}
|
268
|
-
return !fail;
|
269
|
-
}
|
270
|
-
|
271
|
-
function isPossiblyFunctionType(type) {
|
272
|
-
// A quick but unreliable way to see if something is a function type. Yes is just 'maybe', no is definite.
|
273
|
-
var len = type.length;
|
274
|
-
return type[len-2] == ')' && type[len-1] == '*';
|
275
|
-
}
|
276
|
-
|
277
|
-
function isFunctionType(type, out) {
|
278
|
-
if (!isPossiblyFunctionType(type)) return false;
|
279
|
-
type = type.substr(0, type.length-1); // remove final '*'
|
280
|
-
var firstOpen = type.indexOf('(');
|
281
|
-
if (firstOpen <= 0) return false;
|
282
|
-
type = type.replace(/"[^"]+"/g, '".."');
|
283
|
-
var lastOpen = type.lastIndexOf('(');
|
284
|
-
var returnType;
|
285
|
-
if (firstOpen == lastOpen) {
|
286
|
-
returnType = getReturnType(type);
|
287
|
-
if (!isType(returnType)) return false;
|
288
|
-
} else {
|
289
|
-
returnType = 'i8*'; // some pointer type, no point in analyzing further
|
290
|
-
}
|
291
|
-
if (out) out.returnType = returnType;
|
292
|
-
// find ( that starts the arguments
|
293
|
-
var depth = 0, i = type.length-1, argText = null;
|
294
|
-
while (i >= 0) {
|
295
|
-
var curr = type[i];
|
296
|
-
if (curr == ')') depth++;
|
297
|
-
else if (curr == '(') {
|
298
|
-
depth--;
|
299
|
-
if (depth == 0) {
|
300
|
-
argText = type.substr(i);
|
301
|
-
break;
|
302
|
-
}
|
303
|
-
}
|
304
|
-
i--;
|
305
|
-
}
|
306
|
-
assert(argText);
|
307
|
-
return isFunctionDef({ text: argText, tokens: tokenize(argText.substr(1, argText.length-2)) }, out);
|
308
|
-
}
|
309
|
-
|
310
|
-
function getReturnType(type) {
|
311
|
-
if (pointingLevels(type) > 1) return '*'; // the type of a call can be either the return value, or the entire function. ** or more means it is a return value
|
312
|
-
var lastOpen = type.lastIndexOf('(');
|
313
|
-
if (lastOpen > 0) {
|
314
|
-
// handle things like void (i32)* (i32, void (i32)*)*
|
315
|
-
var closeStar = type.indexOf(')*');
|
316
|
-
if (closeStar > 0 && closeStar < type.length-2) lastOpen = closeStar+3;
|
317
|
-
return type.substr(0, lastOpen-1);
|
318
|
-
}
|
319
|
-
return type;
|
320
|
-
}
|
321
|
-
|
322
|
-
var isTypeCache = {}; // quite hot, optimize as much as possible
|
323
|
-
function isType(type) {
|
324
|
-
if (type in isTypeCache) return isTypeCache[type];
|
325
|
-
var ret = isPointerType(type) || isVoidType(type) || Runtime.isNumberType(type) || isStructType(type) || isFunctionType(type);
|
326
|
-
isTypeCache[type] = ret;
|
327
|
-
return ret;
|
328
|
-
}
|
329
|
-
|
330
|
-
function isVarArgsFunctionType(type) {
|
331
|
-
// assumes this is known to be a function type already
|
332
|
-
var varArgsSuffix = '...)*';
|
333
|
-
return type.substr(-varArgsSuffix.length) == varArgsSuffix;
|
334
|
-
}
|
335
|
-
|
336
|
-
function getNumLegalizedVars(type) { // how many legalized variables are needed to represent this type
|
337
|
-
if (type in Runtime.FLOAT_TYPES) return 1;
|
338
|
-
return Math.max(getNumIntChunks(type), 1);
|
339
|
-
}
|
340
|
-
|
341
|
-
function countNormalArgs(type, out, legalized) {
|
342
|
-
out = out || {};
|
343
|
-
if (!isFunctionType(type, out)) return -1;
|
344
|
-
var ret = 0;
|
345
|
-
if (out.segments) {
|
346
|
-
for (var i = 0; i < out.segments.length; i++) {
|
347
|
-
ret += legalized ? getNumLegalizedVars(out.segments[i][0].text) : 1;
|
348
|
-
}
|
349
|
-
}
|
350
|
-
if (isVarArgsFunctionType(type)) ret--;
|
351
|
-
return ret;
|
352
|
-
}
|
353
|
-
|
354
|
-
function getVectorSize(type) {
|
355
|
-
return parseInt(type.substring(1, type.indexOf(' ')));
|
356
|
-
}
|
357
|
-
|
358
|
-
function getVectorNativeType(type) {
|
359
|
-
Types.usesSIMD = true;
|
360
|
-
switch (type) {
|
361
|
-
case '<2 x float>':
|
362
|
-
case '<4 x float>': return 'float';
|
363
|
-
case '<2 x i32>':
|
364
|
-
case '<4 x i32>': return 'i32';
|
365
|
-
default: throw 'unknown vector type ' + type;
|
366
|
-
}
|
367
|
-
}
|
368
|
-
|
369
|
-
function getSIMDName(type) {
|
370
|
-
switch (type) {
|
371
|
-
case 'i32': return 'int';
|
372
|
-
case 'float': return 'float';
|
373
|
-
default: throw 'getSIMDName ' + type;
|
374
|
-
}
|
375
|
-
}
|
376
|
-
|
377
|
-
function getVectorBaseType(type) {
|
378
|
-
return getSIMDName(getVectorNativeType(type));
|
379
|
-
}
|
380
|
-
|
381
|
-
function addIdent(token) {
|
382
|
-
token.ident = token.text;
|
383
|
-
return token;
|
384
|
-
}
|
385
|
-
|
386
|
-
function combineTokens(tokens) {
|
387
|
-
var ret = {
|
388
|
-
lineNum: tokens[0].lineNum,
|
389
|
-
text: '',
|
390
|
-
tokens: []
|
391
|
-
};
|
392
|
-
tokens.forEach(function(token) {
|
393
|
-
ret.text += token.text;
|
394
|
-
ret.tokens.push(token);
|
395
|
-
});
|
396
|
-
return ret;
|
397
|
-
}
|
398
|
-
|
399
|
-
function compareTokens(a, b) {
|
400
|
-
var aId = a.__uid__;
|
401
|
-
var bId = b.__uid__;
|
402
|
-
a.__uid__ = 0;
|
403
|
-
b.__uid__ = 0;
|
404
|
-
var ret = JSON.stringify(a) == JSON.stringify(b);
|
405
|
-
a.__uid__ = aId;
|
406
|
-
b.__uid__ = bId;
|
407
|
-
return ret;
|
408
|
-
}
|
409
|
-
|
410
|
-
function getTokenIndexByText(tokens, text) {
|
411
|
-
var i = 0;
|
412
|
-
while (tokens[i] && tokens[i].text != text) i++;
|
413
|
-
return i;
|
414
|
-
}
|
415
|
-
|
416
|
-
function findTokenText(item, text) {
|
417
|
-
return findTokenTextAfter(item, text, 0);
|
418
|
-
}
|
419
|
-
|
420
|
-
function findTokenTextAfter(item, text, startAt) {
|
421
|
-
for (var i = startAt; i < item.tokens.length; i++) {
|
422
|
-
if (item.tokens[i].text == text) return i;
|
423
|
-
}
|
424
|
-
return -1;
|
425
|
-
}
|
426
|
-
|
427
|
-
var SPLIT_TOKEN_LIST_SPLITTERS = set(',', 'to'); // 'to' can separate parameters as well...
|
428
|
-
|
429
|
-
// Splits a list of tokens separated by commas. For example, a list of arguments in a function call
|
430
|
-
function splitTokenList(tokens) {
|
431
|
-
if (tokens.length == 0) return [];
|
432
|
-
if (!tokens.slice) tokens = tokens.tokens;
|
433
|
-
var ret = [];
|
434
|
-
var seg = [];
|
435
|
-
for (var i = 0; i < tokens.length; i++) {
|
436
|
-
var token = tokens[i];
|
437
|
-
if (token.text in SPLIT_TOKEN_LIST_SPLITTERS) {
|
438
|
-
ret.push(seg);
|
439
|
-
seg = [];
|
440
|
-
} else if (token.text == ';') {
|
441
|
-
ret.push(seg);
|
442
|
-
return ret;
|
443
|
-
} else {
|
444
|
-
seg.push(token);
|
445
|
-
}
|
446
|
-
}
|
447
|
-
if (seg.length) ret.push(seg);
|
448
|
-
return ret;
|
449
|
-
}
|
450
|
-
|
451
|
-
function parseParamTokens(params) {
|
452
|
-
if (params.length === 0) return [];
|
453
|
-
var ret = [];
|
454
|
-
var anonymousIndex = 0;
|
455
|
-
while (params.length > 0) {
|
456
|
-
var i = 0;
|
457
|
-
while (i < params.length && params[i].text != ',') i++;
|
458
|
-
var segment = params.slice(0, i);
|
459
|
-
params = params.slice(i+1);
|
460
|
-
segment = cleanSegment(segment);
|
461
|
-
var byVal = 0;
|
462
|
-
if (segment[1] && segment[1].text === 'byval') {
|
463
|
-
// handle 'byval' and 'byval align X'. We store the alignment in 'byVal'
|
464
|
-
byVal = QUANTUM_SIZE;
|
465
|
-
segment.splice(1, 1);
|
466
|
-
if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) {
|
467
|
-
segment.splice(1, 1);
|
468
|
-
}
|
469
|
-
if (segment[1] && segment[1].text === 'align') {
|
470
|
-
assert(isNumber(segment[2].text));
|
471
|
-
byVal = parseInt(segment[2].text);
|
472
|
-
segment.splice(1, 2);
|
473
|
-
}
|
474
|
-
}
|
475
|
-
if (segment[1] && (segment[1].text === 'nocapture' || segment[1].text === 'readonly')) {
|
476
|
-
segment.splice(1, 1);
|
477
|
-
}
|
478
|
-
if (segment.length == 1) {
|
479
|
-
if (segment[0].text == '...') {
|
480
|
-
ret.push({
|
481
|
-
intertype: 'varargs',
|
482
|
-
type: 'i8*',
|
483
|
-
ident: 'varrp' // the conventional name we have for this
|
484
|
-
});
|
485
|
-
} else {
|
486
|
-
// Clang sometimes has a parameter with just a type,
|
487
|
-
// no name... the name is implied to be %{the index}
|
488
|
-
ret.push({
|
489
|
-
intertype: 'value',
|
490
|
-
type: segment[0].text,
|
491
|
-
ident: toNiceIdent('%') + anonymousIndex
|
492
|
-
});
|
493
|
-
Types.needAnalysis[ret[ret.length-1].type] = 0;
|
494
|
-
anonymousIndex ++;
|
495
|
-
}
|
496
|
-
} else {
|
497
|
-
if (segment[2] && segment[2].text == 'to') { // part of bitcast params
|
498
|
-
segment = segment.slice(0, 2);
|
499
|
-
}
|
500
|
-
var parsed = parseLLVMSegment(segment);
|
501
|
-
if (parsed.intertype === 'value' && !isIllegalType(parsed.type)) parsed.ident = parseNumerical(parsed.ident, parsed.type);
|
502
|
-
ret.push(parsed);
|
503
|
-
}
|
504
|
-
ret[ret.length-1].byVal = byVal;
|
505
|
-
}
|
506
|
-
return ret;
|
507
|
-
}
|
508
|
-
|
509
|
-
function hasVarArgs(params) {
|
510
|
-
for (var i = 0; i < params.length; i++) {
|
511
|
-
if (params[i].intertype == 'varargs') {
|
512
|
-
return true;
|
513
|
-
}
|
514
|
-
}
|
515
|
-
return false;
|
516
|
-
}
|
517
|
-
|
518
|
-
var UNINDEXABLE_GLOBALS = set(
|
519
|
-
'_llvm_global_ctors' // special-cased
|
520
|
-
);
|
521
|
-
|
522
|
-
function isIndexableGlobal(ident) {
|
523
|
-
if (!(ident in Variables.globals)) return false;
|
524
|
-
if (ident in UNINDEXABLE_GLOBALS) {
|
525
|
-
Variables.globals[ident].unIndexable = true;
|
526
|
-
return false;
|
527
|
-
}
|
528
|
-
var data = Variables.globals[ident];
|
529
|
-
return !data.alias && !data.external;
|
530
|
-
}
|
531
|
-
|
532
|
-
function isBSS(item) {
|
533
|
-
if (!USE_BSS) {
|
534
|
-
return false;
|
535
|
-
}
|
536
|
-
|
537
|
-
if (item.external) return false; // externals are typically implemented in a JS library, and must be accessed by name, explicitly
|
538
|
-
|
539
|
-
// return true if a global is uninitialized or initialized to 0
|
540
|
-
return (item.value && item.value.intertype === 'emptystruct') ||
|
541
|
-
(item.value && item.value.value !== undefined && item.value.value === '0');
|
542
|
-
}
|
543
|
-
|
544
|
-
function makeGlobalDef(ident) {
|
545
|
-
if (!NAMED_GLOBALS && isIndexableGlobal(ident)) return '';
|
546
|
-
return 'var ' + ident + ';';
|
547
|
-
}
|
548
|
-
|
549
|
-
function makeGlobalUse(ident) {
|
550
|
-
if (!NAMED_GLOBALS && isIndexableGlobal(ident)) {
|
551
|
-
var index = Variables.indexedGlobals[ident];
|
552
|
-
if (index === undefined) {
|
553
|
-
// we are accessing this before we index globals, likely from the library. mark as unindexable
|
554
|
-
UNINDEXABLE_GLOBALS[ident] = 1;
|
555
|
-
return ident;
|
556
|
-
}
|
557
|
-
var ret = (Runtime.GLOBAL_BASE + index).toString();
|
558
|
-
if (SIDE_MODULE) ret = '(H_BASE+' + ret + ')';
|
559
|
-
return ret;
|
560
|
-
}
|
561
|
-
return ident;
|
562
|
-
}
|
563
|
-
|
564
|
-
function sortGlobals(globals) {
|
565
|
-
var ks = keys(globals);
|
566
|
-
ks.sort();
|
567
|
-
var inv = invertArray(ks);
|
568
|
-
return values(globals).sort(function(a, b) {
|
569
|
-
// sort globals based on if they need to be explicitly initialized or not (moving
|
570
|
-
// values that don't need to be to the end of the array). if equal, sort by name.
|
571
|
-
return (Number(isBSS(a)) - Number(isBSS(b))) ||
|
572
|
-
(inv[b.ident] - inv[a.ident]);
|
573
|
-
});
|
574
|
-
}
|
575
|
-
|
576
|
-
// Segment ==> Parameter
|
577
|
-
function parseLLVMSegment(segment) {
|
578
|
-
var type;
|
579
|
-
if (segment.length == 1) {
|
580
|
-
if (isType(segment[0].text)) {
|
581
|
-
Types.needAnalysis[segment[0].text] = 0;
|
582
|
-
return {
|
583
|
-
intertype: 'type',
|
584
|
-
ident: toNiceIdent(segment[0].text),
|
585
|
-
type: segment[0].text
|
586
|
-
};
|
587
|
-
} else {
|
588
|
-
return {
|
589
|
-
intertype: 'value',
|
590
|
-
ident: toNiceIdent(segment[0].text),
|
591
|
-
type: 'i32'
|
592
|
-
};
|
593
|
-
}
|
594
|
-
} else if (segment[1].type && segment[1].type == '{') {
|
595
|
-
type = segment[0].text;
|
596
|
-
Types.needAnalysis[type] = 0;
|
597
|
-
return {
|
598
|
-
intertype: 'structvalue',
|
599
|
-
params: splitTokenList(segment[1].tokens).map(parseLLVMSegment),
|
600
|
-
type: type
|
601
|
-
};
|
602
|
-
} else if (segment[0].text in PARSABLE_LLVM_FUNCTIONS) {
|
603
|
-
return parseLLVMFunctionCall([{text: '?'}].concat(segment));
|
604
|
-
} else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {
|
605
|
-
return parseLLVMFunctionCall(segment);
|
606
|
-
} else if (segment[1].text === 'blockaddress') {
|
607
|
-
return parseBlockAddress(segment);
|
608
|
-
} else {
|
609
|
-
type = segment[0].text;
|
610
|
-
if (type[type.length-1] === '>' && segment[1].text[0] === '<') {
|
611
|
-
// vector literal
|
612
|
-
var nativeType = getVectorNativeType(type);
|
613
|
-
return {
|
614
|
-
intertype: 'vector',
|
615
|
-
idents: splitTokenList(segment[1].tokens).map(function(pair) {
|
616
|
-
return parseNumerical(pair[1].text, nativeType);
|
617
|
-
}),
|
618
|
-
type: type
|
619
|
-
};
|
620
|
-
}
|
621
|
-
Types.needAnalysis[type] = 0;
|
622
|
-
return {
|
623
|
-
intertype: 'value',
|
624
|
-
ident: toNiceIdent(segment[1].text),
|
625
|
-
type: type
|
626
|
-
};
|
627
|
-
}
|
628
|
-
}
|
629
|
-
|
630
|
-
function cleanSegment(segment) {
|
631
|
-
while (segment.length >= 2 && ['noalias', 'sret', 'nocapture', 'nest', 'zeroext', 'signext', 'readnone'].indexOf(segment[1].text) != -1) {
|
632
|
-
segment.splice(1, 1);
|
633
|
-
}
|
634
|
-
return segment;
|
635
|
-
}
|
636
|
-
|
637
|
-
var MATHOPS = set(['add', 'sub', 'sdiv', 'udiv', 'mul', 'icmp', 'zext', 'urem', 'srem', 'fadd', 'fsub', 'fmul', 'fdiv', 'fcmp', 'frem', 'uitofp', 'sitofp', 'fpext', 'fptrunc', 'fptoui', 'fptosi', 'trunc', 'sext', 'select', 'shl', 'shr', 'ashl', 'ashr', 'lshr', 'lshl', 'xor', 'or', 'and', 'ptrtoint', 'inttoptr']);
|
638
|
-
|
639
|
-
var JS_MATH_BUILTINS = set(['Math_sin', 'Math_cos', 'Math_tan', 'Math_asin', 'Math_acos', 'Math_atan', 'Math_ceil', 'Math_floor', 'Math_exp', 'Math_log', 'Math_sqrt']);
|
640
|
-
|
641
|
-
var PARSABLE_LLVM_FUNCTIONS = set('getelementptr', 'bitcast');
|
642
|
-
mergeInto(PARSABLE_LLVM_FUNCTIONS, MATHOPS);
|
643
|
-
|
644
|
-
// Parses a function call of form
|
645
|
-
// TYPE functionname MODIFIERS (...)
|
646
|
-
// e.g.
|
647
|
-
// i32* getelementptr inbounds (...)
|
648
|
-
function parseLLVMFunctionCall(segment) {
|
649
|
-
segment = segment.slice(0);
|
650
|
-
segment = cleanSegment(segment);
|
651
|
-
// Remove additional modifiers
|
652
|
-
var variant = null;
|
653
|
-
if (!segment[2] || !segment[2].tokens) {
|
654
|
-
variant = segment.splice(2, 1)[0];
|
655
|
-
if (variant && variant.text) variant = variant.text; // needed for mathops
|
656
|
-
}
|
657
|
-
assertTrue(['inreg', 'byval'].indexOf(segment[1].text) == -1);
|
658
|
-
assert(segment[1].text in PARSABLE_LLVM_FUNCTIONS);
|
659
|
-
while (!segment[2].tokens) {
|
660
|
-
segment.splice(2, 1); // Remove modifiers
|
661
|
-
if (!segment[2]) throw 'Invalid segment!';
|
662
|
-
}
|
663
|
-
var intertype = segment[1].text;
|
664
|
-
var type = segment[0].text;
|
665
|
-
if (type === '?') {
|
666
|
-
if (intertype === 'getelementptr') {
|
667
|
-
type = '*'; // a pointer, we can easily say, this is
|
668
|
-
} else if (segment[2].tokens.slice(-2)[0].text === 'to') {
|
669
|
-
type = segment[2].tokens.slice(-1)[0].text;
|
670
|
-
}
|
671
|
-
}
|
672
|
-
var ret = {
|
673
|
-
intertype: intertype,
|
674
|
-
variant: variant,
|
675
|
-
type: type,
|
676
|
-
params: parseParamTokens(segment[2].tokens)
|
677
|
-
};
|
678
|
-
Types.needAnalysis[ret.type] = 0;
|
679
|
-
ret.ident = toNiceIdent(ret.params[0].ident || 'NOIDENT');
|
680
|
-
return ret;
|
681
|
-
}
|
682
|
-
|
683
|
-
// Gets an array of tokens, we parse out the first
|
684
|
-
// 'ident' - either a simple ident of one token, or
|
685
|
-
// an LLVM internal function that generates an ident.
|
686
|
-
// We shift out of the array list the tokens that
|
687
|
-
// we ate.
|
688
|
-
function eatLLVMIdent(tokens) {
|
689
|
-
var ret;
|
690
|
-
if (tokens[0].text in PARSABLE_LLVM_FUNCTIONS) {
|
691
|
-
var item = parseLLVMFunctionCall([{text: '?'}].concat(tokens.slice(0,2))); // TODO: Handle more cases, return a full object, process it later
|
692
|
-
if (item.intertype == 'bitcast') checkBitcast(item);
|
693
|
-
ret = item.ident;
|
694
|
-
tokens.shift();
|
695
|
-
tokens.shift();
|
696
|
-
} else {
|
697
|
-
ret = tokens[0].text;
|
698
|
-
tokens.shift();
|
699
|
-
}
|
700
|
-
return ret;
|
701
|
-
}
|
702
|
-
|
703
|
-
function cleanOutTokens(filterOut, tokens, indexes) {
|
704
|
-
if (typeof indexes !== 'object') indexes = [indexes];
|
705
|
-
for (var i = indexes.length-1; i >=0; i--) {
|
706
|
-
var index = indexes[i];
|
707
|
-
while (index < tokens.length && tokens[index].text in filterOut) {
|
708
|
-
tokens.splice(index, 1);
|
709
|
-
}
|
710
|
-
}
|
711
|
-
}
|
712
|
-
|
713
|
-
function _IntToHex(x) {
|
714
|
-
assert(x >= 0 && x <= 15);
|
715
|
-
if (x <= 9) {
|
716
|
-
return String.fromCharCode('0'.charCodeAt(0) + x);
|
717
|
-
} else {
|
718
|
-
return String.fromCharCode('A'.charCodeAt(0) + x - 10);
|
719
|
-
}
|
720
|
-
}
|
721
|
-
|
722
|
-
function IEEEUnHex(stringy) {
|
723
|
-
stringy = stringy.substr(2); // leading '0x';
|
724
|
-
if (stringy.replace(/0/g, '') === '') return 0;
|
725
|
-
while (stringy.length < 16) stringy = '0' + stringy;
|
726
|
-
if (FAKE_X86_FP80 && stringy.length > 16) {
|
727
|
-
stringy = stringy.substr(stringy.length-16, 16);
|
728
|
-
assert(TARGET_X86, 'must only see >64 bit floats in x86, as fp80s');
|
729
|
-
warnOnce('.ll contains floating-point values with more than 64 bits. Faking values for them. If they are used, this will almost certainly break horribly!');
|
730
|
-
}
|
731
|
-
assert(stringy.length === 16, 'Can only unhex 16-digit double numbers, nothing platform-specific'); // |long double| can cause x86_fp80 which causes this
|
732
|
-
var top = eval('0x' + stringy[0]);
|
733
|
-
var neg = !!(top & 8); // sign
|
734
|
-
if (neg) {
|
735
|
-
stringy = _IntToHex(top & ~8) + stringy.substr(1);
|
736
|
-
}
|
737
|
-
var a = eval('0x' + stringy.substr(0, 8)); // top half
|
738
|
-
var b = eval('0x' + stringy.substr(8)); // bottom half
|
739
|
-
var e = a >> ((52 - 32) & 0x7ff); // exponent
|
740
|
-
a = a & 0xfffff;
|
741
|
-
if (e === 0x7ff) {
|
742
|
-
if (a == 0 && b == 0) {
|
743
|
-
return neg ? '-Infinity' : 'Infinity';
|
744
|
-
} else {
|
745
|
-
return 'NaN';
|
746
|
-
}
|
747
|
-
}
|
748
|
-
e -= 1023; // offset
|
749
|
-
var absolute = ((((a | 0x100000) * 1.0) / Math.pow(2,52-32)) * Math.pow(2, e)) + (((b * 1.0) / Math.pow(2, 52)) * Math.pow(2, e));
|
750
|
-
return (absolute * (neg ? -1 : 1)).toString();
|
751
|
-
}
|
752
|
-
|
753
|
-
// Given an expression like (VALUE=VALUE*2,VALUE<10?VALUE:t+1) , this will
|
754
|
-
// replace VALUE with value. If value is not a simple identifier of a variable,
|
755
|
-
// value will be replaced with tempVar.
|
756
|
-
function makeInlineCalculation(expression, value, tempVar) {
|
757
|
-
if (!isNiceIdent(value, true)) {
|
758
|
-
expression = tempVar + '=' + value + ',' + expression;
|
759
|
-
value = tempVar;
|
760
|
-
}
|
761
|
-
return '(' + expression.replace(/VALUE/g, value) + ')';
|
762
|
-
}
|
763
|
-
|
764
|
-
// Makes a proper runtime value for a 64-bit value from low and high i32s. low and high are assumed to be unsigned.
|
765
|
-
function makeI64(low, high) {
|
766
|
-
high = high || '0';
|
767
|
-
if (USE_TYPED_ARRAYS == 2) {
|
768
|
-
return '[' + makeSignOp(low, 'i32', 'un', 1, 1) + ',' + makeSignOp(high, 'i32', 'un', 1, 1) + ']';
|
769
|
-
} else {
|
770
|
-
if (high) return RuntimeGenerator.makeBigInt(low, high);
|
771
|
-
return low;
|
772
|
-
}
|
773
|
-
}
|
774
|
-
|
775
|
-
// XXX Make all i64 parts signed
|
776
|
-
|
777
|
-
// Splits a number (an integer in a double, possibly > 32 bits) into an USE_TYPED_ARRAYS == 2 i64 value.
|
778
|
-
// Will suffer from rounding. mergeI64 does the opposite.
|
779
|
-
function splitI64(value, floatConversion) {
|
780
|
-
// general idea:
|
781
|
-
//
|
782
|
-
// $1$0 = ~~$d >>> 0;
|
783
|
-
// $1$1 = Math_abs($d) >= 1 ? (
|
784
|
-
// $d > 0 ? Math.min(Math_floor(($d)/ 4294967296.0), 4294967295.0)
|
785
|
-
// : Math_ceil(Math.min(-4294967296.0, $d - $1$0)/ 4294967296.0)
|
786
|
-
// ) : 0;
|
787
|
-
//
|
788
|
-
// We need to min on positive values here, since our input might be a double, and large values are rounded, so they can
|
789
|
-
// be slightly higher than expected. And if we get 4294967296, that will turn into a 0 if put into a
|
790
|
-
// HEAP32 or |0'd, etc.
|
791
|
-
//
|
792
|
-
// For negatives, we need to ensure a -1 if the value is overall negative, even if not significant negative component
|
793
|
-
|
794
|
-
var lowInput = legalizedI64s ? value : 'VALUE';
|
795
|
-
if (floatConversion && ASM_JS) lowInput = asmFloatToInt(lowInput);
|
796
|
-
var low = lowInput + '>>>0';
|
797
|
-
var high = makeInlineCalculation(
|
798
|
-
asmCoercion('Math_abs(VALUE)', 'double') + ' >= ' + asmEnsureFloat('1', 'double') + ' ? ' +
|
799
|
-
'(VALUE > ' + asmEnsureFloat('0', 'double') + ' ? ' +
|
800
|
-
asmCoercion('Math_min(' + asmCoercion('Math_floor((VALUE)/' + asmEnsureFloat(4294967296, 'double') + ')', 'double') + ', ' + asmEnsureFloat(4294967295, 'double') + ')', 'i32') + '>>>0' +
|
801
|
-
' : ' + asmFloatToInt(asmCoercion('Math_ceil((VALUE - +((' + asmFloatToInt('VALUE') + ')>>>0))/' + asmEnsureFloat(4294967296, 'double') + ')', 'double')) + '>>>0' +
|
802
|
-
')' +
|
803
|
-
' : 0',
|
804
|
-
value,
|
805
|
-
'tempDouble'
|
806
|
-
);
|
807
|
-
if (legalizedI64s) {
|
808
|
-
return [low, high];
|
809
|
-
} else {
|
810
|
-
return makeI64(low, high);
|
811
|
-
}
|
812
|
-
}
|
813
|
-
function mergeI64(value, unsigned) {
|
814
|
-
assert(USE_TYPED_ARRAYS == 2);
|
815
|
-
if (legalizedI64s) {
|
816
|
-
return RuntimeGenerator.makeBigInt(value + '$0', value + '$1', unsigned);
|
817
|
-
} else {
|
818
|
-
return makeInlineCalculation(RuntimeGenerator.makeBigInt('VALUE[0]', 'VALUE[1]', unsigned), value, 'tempI64');
|
819
|
-
}
|
820
|
-
}
|
821
|
-
|
822
|
-
// Takes an i64 value and changes it into the [low, high] form used in i64 mode 1. In that
|
823
|
-
// mode, this is a no-op
|
824
|
-
function ensureI64_1(value) {
|
825
|
-
if (USE_TYPED_ARRAYS == 2) return value;
|
826
|
-
return splitI64(value, 1);
|
827
|
-
}
|
828
|
-
|
829
|
-
function makeCopyI64(value) {
|
830
|
-
assert(USE_TYPED_ARRAYS == 2);
|
831
|
-
return value + '.slice(0)';
|
832
|
-
}
|
833
|
-
|
834
|
-
// Given a string representation of an integer of arbitrary size, return it
|
835
|
-
// split up into 32-bit chunks
|
836
|
-
function parseArbitraryInt(str, bits) {
|
837
|
-
// We parse the string into a vector of digits, base 10. This is convenient to work on.
|
838
|
-
|
839
|
-
assert(bits > 0); // NB: we don't check that the value in str can fit in this amount of bits
|
840
|
-
|
841
|
-
function str2vec(s) { // index 0 is the highest value
|
842
|
-
var ret = [];
|
843
|
-
for (var i = 0; i < s.length; i++) {
|
844
|
-
ret.push(s.charCodeAt(i) - '0'.charCodeAt(0));
|
845
|
-
}
|
846
|
-
return ret;
|
847
|
-
}
|
848
|
-
|
849
|
-
function divide2(v) { // v /= 2
|
850
|
-
for (var i = v.length-1; i >= 0; i--) {
|
851
|
-
var d = v[i];
|
852
|
-
var r = d % 2;
|
853
|
-
d = Math.floor(d/2);
|
854
|
-
v[i] = d;
|
855
|
-
if (r) {
|
856
|
-
assert(i+1 < v.length);
|
857
|
-
var d2 = v[i+1];
|
858
|
-
d2 += 5;
|
859
|
-
if (d2 >= 10) {
|
860
|
-
v[i] = d+1;
|
861
|
-
d2 -= 10;
|
862
|
-
}
|
863
|
-
v[i+1] = d2;
|
864
|
-
}
|
865
|
-
}
|
866
|
-
}
|
867
|
-
|
868
|
-
function mul2(v) { // v *= 2
|
869
|
-
for (var i = v.length-1; i >= 0; i--) {
|
870
|
-
var d = v[i]*2;
|
871
|
-
r = d >= 10;
|
872
|
-
v[i] = d%10;
|
873
|
-
var j = i-1;
|
874
|
-
if (r) {
|
875
|
-
if (j < 0) {
|
876
|
-
v.unshift(1);
|
877
|
-
break;
|
878
|
-
}
|
879
|
-
v[j] += 0.5; // will be multiplied
|
880
|
-
}
|
881
|
-
}
|
882
|
-
}
|
883
|
-
|
884
|
-
function subtract(v, w) { // v -= w. we assume v >= w
|
885
|
-
while (v.length > w.length) w.splice(0, 0, 0);
|
886
|
-
for (var i = 0; i < v.length; i++) {
|
887
|
-
v[i] -= w[i];
|
888
|
-
if (v[i] < 0) {
|
889
|
-
v[i] += 10;
|
890
|
-
// find something to take from
|
891
|
-
var j = i-1;
|
892
|
-
while (v[j] == 0) {
|
893
|
-
v[j] = 9;
|
894
|
-
j--;
|
895
|
-
assert(j >= 0);
|
896
|
-
}
|
897
|
-
v[j]--;
|
898
|
-
}
|
899
|
-
}
|
900
|
-
}
|
901
|
-
|
902
|
-
function isZero(v) {
|
903
|
-
for (var i = 0; i < v.length; i++) {
|
904
|
-
if (v[i] > 0) return false;
|
905
|
-
}
|
906
|
-
return true;
|
907
|
-
}
|
908
|
-
|
909
|
-
var v;
|
910
|
-
|
911
|
-
if (str[0] == '-') {
|
912
|
-
// twos-complement is needed
|
913
|
-
str = str.substr(1);
|
914
|
-
v = str2vec('1');
|
915
|
-
for (var i = 0; i < bits; i++) {
|
916
|
-
mul2(v);
|
917
|
-
}
|
918
|
-
subtract(v, str2vec(str));
|
919
|
-
} else {
|
920
|
-
v = str2vec(str);
|
921
|
-
}
|
922
|
-
|
923
|
-
var bitsv = [];
|
924
|
-
while (!isZero(v)) {
|
925
|
-
bitsv.push((v[v.length-1] % 2 != 0)+0);
|
926
|
-
v[v.length-1] = v[v.length-1] & 0xfe;
|
927
|
-
divide2(v);
|
928
|
-
}
|
929
|
-
|
930
|
-
var ret = zeros(Math.ceil(bits/32));
|
931
|
-
for (var i = 0; i < bitsv.length; i++) {
|
932
|
-
ret[Math.floor(i/32)] += bitsv[i]*Math.pow(2, i % 32);
|
933
|
-
}
|
934
|
-
return ret;
|
935
|
-
}
|
936
|
-
|
937
|
-
function parseI64Constant(str, legalized) {
|
938
|
-
if (!isNumber(str)) {
|
939
|
-
// This is a variable. Copy it, so we do not modify the original
|
940
|
-
return legalizedI64s ? str : makeCopyI64(str);
|
941
|
-
}
|
942
|
-
|
943
|
-
var parsed = parseArbitraryInt(str, 64);
|
944
|
-
if (legalizedI64s || legalized) return parsed;
|
945
|
-
return '[' + parsed[0] + ',' + parsed[1] + ']';
|
946
|
-
}
|
947
|
-
|
948
|
-
function parseNumerical(value, type) {
|
949
|
-
if ((!type || type === 'double' || type === 'float') && /^0x/.test(value)) {
|
950
|
-
// Hexadecimal double value, as the llvm docs say,
|
951
|
-
// "The one non-intuitive notation for constants is the hexadecimal form of floating point constants."
|
952
|
-
value = IEEEUnHex(value);
|
953
|
-
} else if (USE_TYPED_ARRAYS == 2 && isIllegalType(type)) {
|
954
|
-
return value; // do not parseFloat etc., that can lead to loss of precision
|
955
|
-
} else if (value === 'null') {
|
956
|
-
// NULL *is* 0, in C/C++. No JS null! (null == 0 is false, etc.)
|
957
|
-
value = '0';
|
958
|
-
} else if (value === 'true') {
|
959
|
-
return '1';
|
960
|
-
} else if (value === 'false') {
|
961
|
-
return '0';
|
962
|
-
}
|
963
|
-
if (isNumber(value)) {
|
964
|
-
var ret = parseFloat(value); // will change e.g. 5.000000e+01 to 50
|
965
|
-
if (type === 'double' || type === 'float') {
|
966
|
-
if (value[0] === '-' && ret === 0) return '-.0'; // fix negative 0, toString makes it 0
|
967
|
-
if (!RUNNING_JS_OPTS) ret = asmEnsureFloat(ret, type);
|
968
|
-
}
|
969
|
-
return ret.toString();
|
970
|
-
} else {
|
971
|
-
return value;
|
972
|
-
}
|
973
|
-
}
|
974
|
-
|
975
|
-
// \0Dsometext is really '\r', then sometext
|
976
|
-
// This function returns an array of int values
|
977
|
-
function parseLLVMString(str) {
|
978
|
-
var ret = [];
|
979
|
-
var i = 0;
|
980
|
-
while (i < str.length) {
|
981
|
-
var chr = str.charCodeAt(i);
|
982
|
-
if (chr !== 92) { // 92 === '//'.charCodeAt(0)
|
983
|
-
ret.push(chr);
|
984
|
-
i++;
|
985
|
-
} else {
|
986
|
-
ret.push(parseInt(str[i+1]+str[i+2], '16'));
|
987
|
-
i += 3;
|
988
|
-
}
|
989
|
-
}
|
990
|
-
return ret;
|
991
|
-
}
|
992
|
-
|
993
|
-
function expandLLVMString(str) {
|
994
|
-
return str.replace(/\\../g, function(m) {
|
995
|
-
return String.fromCharCode(parseInt(m.substr(1), '16'));
|
996
|
-
});
|
997
|
-
}
|
998
|
-
|
999
|
-
function getLabelIds(labels) {
|
1000
|
-
return labels.map(function(label) { return label.ident });
|
1001
|
-
}
|
1002
|
-
|
1003
|
-
function cleanLabel(label) {
|
1004
|
-
if (label[0] == 'B') {
|
1005
|
-
return label.substr(5);
|
1006
|
-
} else {
|
1007
|
-
return label;
|
1008
|
-
}
|
1009
|
-
}
|
1010
|
-
|
1011
|
-
function getOldLabel(label) {
|
1012
|
-
var parts = label.split('|');
|
1013
|
-
return parts[parts.length-1];
|
1014
|
-
}
|
1015
|
-
|
1016
|
-
function calcAllocatedSize(type) {
|
1017
|
-
var ret = Runtime.getNativeTypeSize(type);
|
1018
|
-
if (ret) return ret;
|
1019
|
-
return Types.types[type].flatSize; // known type
|
1020
|
-
}
|
1021
|
-
|
1022
|
-
// Generates the type signature for a structure, for each byte, the type that is there.
|
1023
|
-
// i32, 0, 0, 0 - for example, an int32 is here, then nothing to do for the 3 next bytes, naturally
|
1024
|
-
function generateStructTypes(type) {
|
1025
|
-
if (isArray(type)) return type; // already in the form of [type, type,...]
|
1026
|
-
if (Runtime.isNumberType(type) || isPointerType(type)) {
|
1027
|
-
if (USE_TYPED_ARRAYS == 2 && type == 'i64') {
|
1028
|
-
return ['i64', 0, 0, 0, 'i32', 0, 0, 0];
|
1029
|
-
}
|
1030
|
-
return [type].concat(zeros(Runtime.getNativeFieldSize(type)-1));
|
1031
|
-
}
|
1032
|
-
|
1033
|
-
// Avoid multiple concats by finding the size first. This is much faster
|
1034
|
-
var typeData = Types.types[type];
|
1035
|
-
var size = typeData.flatSize;
|
1036
|
-
var ret = new Array(size);
|
1037
|
-
var index = 0;
|
1038
|
-
function add(typeData) {
|
1039
|
-
var array = typeData.name_[0] === '['; // arrays just have 2 elements in their fields, see calculateStructAlignment
|
1040
|
-
var num = array ? parseInt(typeData.name_.substr(1)) : typeData.fields.length;
|
1041
|
-
var start = index;
|
1042
|
-
for (var i = 0; i < num; i++) {
|
1043
|
-
var type = array ? typeData.fields[0] : typeData.fields[i];
|
1044
|
-
if (!SAFE_HEAP && isPointerType(type)) type = '*'; // do not include unneeded type names without safe heap
|
1045
|
-
if (Runtime.isNumberType(type) || isPointerType(type)) {
|
1046
|
-
if (USE_TYPED_ARRAYS == 2 && type == 'i64') {
|
1047
|
-
ret[index++] = 'i64';
|
1048
|
-
ret[index++] = 0;
|
1049
|
-
ret[index++] = 0;
|
1050
|
-
ret[index++] = 0;
|
1051
|
-
ret[index++] = 'i32';
|
1052
|
-
ret[index++] = 0;
|
1053
|
-
ret[index++] = 0;
|
1054
|
-
ret[index++] = 0;
|
1055
|
-
continue;
|
1056
|
-
}
|
1057
|
-
ret[index++] = type;
|
1058
|
-
} else {
|
1059
|
-
if (Runtime.isStructType(type) && type[1] === '0') {
|
1060
|
-
// this is [0 x something], which does nothing
|
1061
|
-
// XXX this happens in java_nbody... assert(i === typeData.fields.length-1);
|
1062
|
-
continue;
|
1063
|
-
}
|
1064
|
-
add(Types.types[type]);
|
1065
|
-
}
|
1066
|
-
var more = array ? (i+1)*typeData.flatSize/num : (
|
1067
|
-
(i+1 < typeData.fields.length ? typeData.flatIndexes[i+1] : typeData.flatSize)
|
1068
|
-
);
|
1069
|
-
more -= index - start;
|
1070
|
-
for (var j = 0; j < more; j++) {
|
1071
|
-
ret[index++] = 0;
|
1072
|
-
}
|
1073
|
-
}
|
1074
|
-
}
|
1075
|
-
add(typeData);
|
1076
|
-
assert(index == size);
|
1077
|
-
return ret;
|
1078
|
-
}
|
1079
|
-
|
1080
|
-
// Flow blocks
|
1081
|
-
|
1082
|
-
function recurseBlock(block, func) {
|
1083
|
-
var ret = [];
|
1084
|
-
if (block.type == 'reloop') {
|
1085
|
-
ret.push(func(block.inner));
|
1086
|
-
} else if (block.type == 'multiple') {
|
1087
|
-
block.entryLabels.forEach(function(entryLabel) { ret.push(func(entryLabel.block)) });
|
1088
|
-
}
|
1089
|
-
ret.push(func(block.next));
|
1090
|
-
return ret;
|
1091
|
-
}
|
1092
|
-
|
1093
|
-
function getActualLabelId(labelId) {
|
1094
|
-
return labelId.split('|').slice(-1)[0];
|
1095
|
-
}
|
1096
|
-
|
1097
|
-
// Misc
|
1098
|
-
|
1099
|
-
function indentify(text, indent) {
|
1100
|
-
if (text.length > 1024*1024) return text; // Don't try to indentify huge strings - we may run out of memory
|
1101
|
-
if (typeof indent === 'number') {
|
1102
|
-
var len = indent;
|
1103
|
-
indent = '';
|
1104
|
-
for (var i = 0; i < len; i++) indent += ' ';
|
1105
|
-
}
|
1106
|
-
return text.replace(/\n/g, '\n' + indent);
|
1107
|
-
}
|
1108
|
-
|
1109
|
-
// Correction tools
|
1110
|
-
|
1111
|
-
function correctSpecificSign() {
|
1112
|
-
if (!Framework.currItem) return false;
|
1113
|
-
if (Framework.currItem.funcData.ident.indexOf('emscripten_autodebug') >= 0) return 1; // always correct in the autodebugger code!
|
1114
|
-
return (CORRECT_SIGNS === 2 && Debugging.getIdentifier() in CORRECT_SIGNS_LINES) ||
|
1115
|
-
(CORRECT_SIGNS === 3 && !(Debugging.getIdentifier() in CORRECT_SIGNS_LINES));
|
1116
|
-
}
|
1117
|
-
function correctSigns() {
|
1118
|
-
return CORRECT_SIGNS === 1 || correctSpecificSign();
|
1119
|
-
}
|
1120
|
-
|
1121
|
-
function correctSpecificOverflow() {
|
1122
|
-
if (!Framework.currItem) return false;
|
1123
|
-
return (CORRECT_OVERFLOWS === 2 && Debugging.getIdentifier() in CORRECT_OVERFLOWS_LINES) ||
|
1124
|
-
(CORRECT_OVERFLOWS === 3 && !(Debugging.getIdentifier() in CORRECT_OVERFLOWS_LINES));
|
1125
|
-
}
|
1126
|
-
function correctOverflows() {
|
1127
|
-
return CORRECT_OVERFLOWS === 1 || correctSpecificOverflow();
|
1128
|
-
}
|
1129
|
-
|
1130
|
-
function correctSpecificRounding() {
|
1131
|
-
if (!Framework.currItem) return false;
|
1132
|
-
return (CORRECT_ROUNDINGS === 2 && Debugging.getIdentifier() in CORRECT_ROUNDINGS_LINES) ||
|
1133
|
-
(CORRECT_ROUNDINGS === 3 && !(Debugging.getIdentifier() in CORRECT_ROUNDINGS_LINES));
|
1134
|
-
}
|
1135
|
-
function correctRoundings() {
|
1136
|
-
return CORRECT_ROUNDINGS === 1 || correctSpecificRounding();
|
1137
|
-
}
|
1138
|
-
|
1139
|
-
function checkSpecificSafeHeap() {
|
1140
|
-
if (!Framework.currItem) return false;
|
1141
|
-
return (SAFE_HEAP === 2 && Debugging.getIdentifier() in SAFE_HEAP_LINES) ||
|
1142
|
-
(SAFE_HEAP === 3 && !(Debugging.getIdentifier() in SAFE_HEAP_LINES));
|
1143
|
-
}
|
1144
|
-
function checkSafeHeap() {
|
1145
|
-
return SAFE_HEAP === 1 || checkSpecificSafeHeap();
|
1146
|
-
}
|
1147
|
-
|
1148
|
-
function getHeapOffset(offset, type, forceAsm) {
|
1149
|
-
if (USE_TYPED_ARRAYS !== 2) {
|
1150
|
-
return offset;
|
1151
|
-
}
|
1152
|
-
|
1153
|
-
if (Runtime.getNativeFieldSize(type) > 4) {
|
1154
|
-
if (type == 'i64' || TARGET_X86) {
|
1155
|
-
type = 'i32'; // XXX we emulate 64-bit values as 32 in x86, and also in le32 but only i64, not double
|
1156
|
-
}
|
1157
|
-
}
|
1158
|
-
|
1159
|
-
var sz = Runtime.getNativeTypeSize(type);
|
1160
|
-
var shifts = Math.log(sz)/Math.LN2;
|
1161
|
-
offset = '(' + offset + ')';
|
1162
|
-
if (shifts != 0) {
|
1163
|
-
if (CHECK_HEAP_ALIGN) {
|
1164
|
-
return '((CHECK_ALIGN_' + sz + '(' + offset + '|0)|0)>>' + shifts + ')';
|
1165
|
-
} else {
|
1166
|
-
return '(' + offset + '>>' + shifts + ')';
|
1167
|
-
}
|
1168
|
-
} else {
|
1169
|
-
// we need to guard against overflows here, HEAP[U]8 expects a guaranteed int
|
1170
|
-
return isJSVar(offset) ? offset : '(' + offset + '|0)';
|
1171
|
-
}
|
1172
|
-
}
|
1173
|
-
|
1174
|
-
function makeVarDef(js) {
|
1175
|
-
if (!ASM_JS) js = 'var ' + js;
|
1176
|
-
return js;
|
1177
|
-
}
|
1178
|
-
|
1179
|
-
function ensureDot(value) {
|
1180
|
-
value = value.toString();
|
1181
|
-
// if already dotted, or Infinity or NaN, nothing to do here
|
1182
|
-
// if smaller than 1 and running js opts, we always need to force a coercion (0.001 will turn into 1e-3, which has no .)
|
1183
|
-
if ((value.indexOf('.') >= 0 || /[IN]/.test(value)) && (!RUNNING_JS_OPTS || Math.abs(value) >= 1)) return value;
|
1184
|
-
if (RUNNING_JS_OPTS) return '(+' + value + ')'; // JS optimizer will run, we must do +x, and it will be corrected later
|
1185
|
-
var e = value.indexOf('e');
|
1186
|
-
if (e < 0) return value + '.0';
|
1187
|
-
return value.substr(0, e) + '.0' + value.substr(e);
|
1188
|
-
}
|
1189
|
-
|
1190
|
-
function asmEnsureFloat(value, type) { // ensures that a float type has either 5.5 (clearly a float) or +5 (float due to asm coercion)
|
1191
|
-
if (!ASM_JS) return value;
|
1192
|
-
if (!isNumber(value)) return value;
|
1193
|
-
if (PRECISE_F32 && type === 'float') {
|
1194
|
-
// normally ok to just emit Math_fround(0), but if the constant is large we may need a .0 (if it can't fit in an int)
|
1195
|
-
if (value == 0) return 'Math_fround(0)';
|
1196
|
-
value = ensureDot(value);
|
1197
|
-
return 'Math_fround(' + value + ')';
|
1198
|
-
}
|
1199
|
-
if (type in Runtime.FLOAT_TYPES) {
|
1200
|
-
return ensureDot(value);
|
1201
|
-
} else {
|
1202
|
-
return value;
|
1203
|
-
}
|
1204
|
-
}
|
1205
|
-
|
1206
|
-
function asmInitializer(type) {
|
1207
|
-
if (type in Runtime.FLOAT_TYPES) {
|
1208
|
-
if (PRECISE_F32 && type === 'float') return 'Math_fround(0)';
|
1209
|
-
return RUNNING_JS_OPTS ? '+0' : '.0';
|
1210
|
-
} else {
|
1211
|
-
return '0';
|
1212
|
-
}
|
1213
|
-
}
|
1214
|
-
|
1215
|
-
function asmCoercion(value, type, signedness) {
|
1216
|
-
if (!ASM_JS) return value;
|
1217
|
-
if (type == 'void') {
|
1218
|
-
return value;
|
1219
|
-
} else if (type in Runtime.FLOAT_TYPES) {
|
1220
|
-
if (isNumber(value)) {
|
1221
|
-
return asmEnsureFloat(value, type);
|
1222
|
-
} else {
|
1223
|
-
if (signedness) {
|
1224
|
-
if (signedness == 'u') {
|
1225
|
-
value = '(' + value + ')>>>0';
|
1226
|
-
} else {
|
1227
|
-
value = '(' + value + ')|0';
|
1228
|
-
}
|
1229
|
-
}
|
1230
|
-
if (PRECISE_F32 && type === 'float') {
|
1231
|
-
return 'Math_fround(' + value + ')';
|
1232
|
-
} else {
|
1233
|
-
return '(+(' + value + '))';
|
1234
|
-
}
|
1235
|
-
}
|
1236
|
-
} else {
|
1237
|
-
return '((' + value + ')|0)';
|
1238
|
-
}
|
1239
|
-
}
|
1240
|
-
|
1241
|
-
function asmFloatToInt(x) {
|
1242
|
-
return '(~~(' + x + '))';
|
1243
|
-
}
|
1244
|
-
|
1245
|
-
function makeGetTempDouble(i, type, forSet) { // get an aliased part of the tempDouble temporary storage
|
1246
|
-
// Cannot use makeGetValue because it uses us
|
1247
|
-
// this is a unique case where we *can* use HEAPF64
|
1248
|
-
var slab = type == 'double' ? 'HEAPF64' : makeGetSlabs(null, type)[0];
|
1249
|
-
var ptr = getFastValue('tempDoublePtr', '+', Runtime.getNativeTypeSize(type)*i);
|
1250
|
-
var offset;
|
1251
|
-
if (type == 'double') {
|
1252
|
-
offset = '(' + ptr + ')>>3';
|
1253
|
-
} else {
|
1254
|
-
offset = getHeapOffset(ptr, type);
|
1255
|
-
}
|
1256
|
-
var ret = slab + '[' + offset + ']';
|
1257
|
-
if (!forSet) ret = asmCoercion(ret, type);
|
1258
|
-
return ret;
|
1259
|
-
}
|
1260
|
-
|
1261
|
-
function makeSetTempDouble(i, type, value) {
|
1262
|
-
return makeGetTempDouble(i, type, true) + '=' + asmEnsureFloat(value, type);
|
1263
|
-
}
|
1264
|
-
|
1265
|
-
var asmPrintCounter = 0;
|
1266
|
-
|
1267
|
-
// See makeSetValue
|
1268
|
-
function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSafe, forceAsm) {
|
1269
|
-
if (UNALIGNED_MEMORY) align = 1;
|
1270
|
-
else if (FORCE_ALIGNED_MEMORY && !isIllegalType(type)) align = 8;
|
1271
|
-
|
1272
|
-
if (isStructType(type)) {
|
1273
|
-
var typeData = Types.types[type];
|
1274
|
-
var ret = [];
|
1275
|
-
for (var i = 0; i < typeData.fields.length; i++) {
|
1276
|
-
ret.push('f' + i + ': ' + makeGetValue(ptr, pos + typeData.flatIndexes[i], typeData.fields[i], noNeedFirst, unsigned, 0, 0, noSafe));
|
1277
|
-
}
|
1278
|
-
return '{ ' + ret.join(', ') + ' }';
|
1279
|
-
}
|
1280
|
-
|
1281
|
-
// In double mode 1, in x86 we always assume unaligned because we can't trust that; otherwise in le32
|
1282
|
-
// we need this code path if we are not fully aligned.
|
1283
|
-
if (DOUBLE_MODE == 1 && USE_TYPED_ARRAYS == 2 && type == 'double' && (TARGET_X86 || align < 8)) {
|
1284
|
-
return '(' + makeSetTempDouble(0, 'i32', makeGetValue(ptr, pos, 'i32', noNeedFirst, unsigned, ignore, align, noSafe)) + ',' +
|
1285
|
-
makeSetTempDouble(1, 'i32', makeGetValue(ptr, getFastValue(pos, '+', Runtime.getNativeTypeSize('i32')), 'i32', noNeedFirst, unsigned, ignore, align, noSafe)) + ',' +
|
1286
|
-
makeGetTempDouble(0, 'double') + ')';
|
1287
|
-
}
|
1288
|
-
|
1289
|
-
if (USE_TYPED_ARRAYS == 2 && align) {
|
1290
|
-
// Alignment is important here. May need to split this up
|
1291
|
-
var bytes = Runtime.getNativeTypeSize(type);
|
1292
|
-
if (DOUBLE_MODE == 0 && type == 'double') bytes = 4; // we will really only read 4 bytes here
|
1293
|
-
if (bytes > align) {
|
1294
|
-
var ret = '(';
|
1295
|
-
if (isIntImplemented(type)) {
|
1296
|
-
if (bytes == 4 && align == 2) {
|
1297
|
-
// Special case that we can optimize
|
1298
|
-
ret += makeGetValue(ptr, pos, 'i16', noNeedFirst, 2, ignore, 2, noSafe) + '|' +
|
1299
|
-
'(' + makeGetValue(ptr, getFastValue(pos, '+', 2), 'i16', noNeedFirst, 2, ignore, 2, noSafe) + '<<16)';
|
1300
|
-
} else { // XXX we cannot truly handle > 4... (in x86)
|
1301
|
-
ret = '';
|
1302
|
-
for (var i = 0; i < bytes; i++) {
|
1303
|
-
ret += '(' + makeGetValue(ptr, getFastValue(pos, '+', i), 'i8', noNeedFirst, 1, ignore, 1, noSafe) + (i > 0 ? '<<' + (8*i) : '') + ')';
|
1304
|
-
if (i < bytes-1) ret += '|';
|
1305
|
-
}
|
1306
|
-
ret = '(' + makeSignOp(ret, type, unsigned ? 'un' : 're', true);
|
1307
|
-
}
|
1308
|
-
} else {
|
1309
|
-
if (type == 'float') {
|
1310
|
-
ret += 'copyTempFloat(' + asmCoercion(getFastValue(ptr, '+', pos), 'i32') + '),' + makeGetTempDouble(0, 'float');
|
1311
|
-
} else {
|
1312
|
-
ret += 'copyTempDouble(' + asmCoercion(getFastValue(ptr, '+', pos), 'i32') + '),' + makeGetTempDouble(0, 'double');
|
1313
|
-
}
|
1314
|
-
}
|
1315
|
-
ret += ')';
|
1316
|
-
return ret;
|
1317
|
-
}
|
1318
|
-
}
|
1319
|
-
|
1320
|
-
var offset = calcFastOffset(ptr, pos, noNeedFirst);
|
1321
|
-
if (SAFE_HEAP && !noSafe) {
|
1322
|
-
var printType = type;
|
1323
|
-
if (printType !== 'null' && printType[0] !== '#') printType = '"' + safeQuote(printType) + '"';
|
1324
|
-
if (printType[0] === '#') printType = printType.substr(1);
|
1325
|
-
return asmCoercion('SAFE_HEAP_LOAD(' + asmCoercion(offset, 'i32') + ', ' + (ASM_JS ? 0 : printType) + ', ' + (!!unsigned+0) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')', type);
|
1326
|
-
} else {
|
1327
|
-
var ret = makeGetSlabs(ptr, type, false, unsigned)[0] + '[' + getHeapOffset(offset, type, forceAsm) + ']';
|
1328
|
-
if (ASM_JS && (phase == 'funcs' || forceAsm)) {
|
1329
|
-
ret = asmCoercion(ret, type);
|
1330
|
-
}
|
1331
|
-
if (ASM_HEAP_LOG) {
|
1332
|
-
ret = makeInlineCalculation('(asmPrint' + (type in Runtime.FLOAT_TYPES ? 'Float' : 'Int') + '(' + (asmPrintCounter++) + ',' + asmCoercion('VALUE', type) + '), VALUE)', ret,
|
1333
|
-
'temp' + (type in Runtime.FLOAT_TYPES ? 'Double' : 'Int'));
|
1334
|
-
}
|
1335
|
-
return ret;
|
1336
|
-
}
|
1337
|
-
}
|
1338
|
-
|
1339
|
-
function makeGetValueAsm(ptr, pos, type, unsigned) {
|
1340
|
-
return makeGetValue(ptr, pos, type, null, unsigned, null, null, null, true);
|
1341
|
-
}
|
1342
|
-
|
1343
|
-
function indexizeFunctions(value, type) {
|
1344
|
-
assert((type && type !== '?') || (typeof value === 'string' && value.substr(0, 6) === 'CHECK_'), 'No type given for function indexizing');
|
1345
|
-
assert(value !== type, 'Type set to value');
|
1346
|
-
var out = {};
|
1347
|
-
if (type && isFunctionType(type, out) && value[0] === '_') { // checking for _ differentiates from $ (local vars)
|
1348
|
-
// add signature to library functions that we now know need indexing
|
1349
|
-
var sig = Functions.implementedFunctions[value] || Functions.unimplementedFunctions[value];
|
1350
|
-
if (!sig) {
|
1351
|
-
sig = Functions.unimplementedFunctions[value] = Functions.getSignature(out.returnType, out.segments ? out.segments.map(function(segment) { return segment[0].text }) : [], isVarArgsFunctionType(type));
|
1352
|
-
}
|
1353
|
-
return Functions.getIndex(value, sig);
|
1354
|
-
}
|
1355
|
-
return value;
|
1356
|
-
}
|
1357
|
-
|
1358
|
-
//! @param ptr The pointer. Used to find both the slab and the offset in that slab. If the pointer
|
1359
|
-
//! is just an integer, then this is almost redundant, but in general the pointer type
|
1360
|
-
//! may in the future include information about which slab as well. So, for now it is
|
1361
|
-
//! possible to put |0| here, but if a pointer is available, that is more future-proof.
|
1362
|
-
//! @param pos The position in that slab - the offset. Added to any offset in the pointer itself.
|
1363
|
-
//! @param value The value to set.
|
1364
|
-
//! @param type A string defining the type. Used to find the slab (IHEAP, FHEAP, etc.).
|
1365
|
-
//! 'null' means, in the context of SAFE_HEAP, that we should accept all types;
|
1366
|
-
//! which means we should write to all slabs, ignore type differences if any on reads, etc.
|
1367
|
-
//! @param noNeedFirst Whether to ignore the offset in the pointer itself.
|
1368
|
-
function makeSetValue(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe, sep, forcedAlign, forceAsm) {
|
1369
|
-
if (UNALIGNED_MEMORY && !forcedAlign) align = 1;
|
1370
|
-
else if (FORCE_ALIGNED_MEMORY && !isIllegalType(type)) align = 8;
|
1371
|
-
|
1372
|
-
sep = sep || ';';
|
1373
|
-
if (isStructType(type)) {
|
1374
|
-
var typeData = Types.types[type];
|
1375
|
-
var ret = [];
|
1376
|
-
// We can receive either an object - an object literal that was in the .ll - or a string,
|
1377
|
-
// which is the ident of an aggregate struct
|
1378
|
-
if (typeof value === 'string') {
|
1379
|
-
value = range(typeData.fields.length).map(function(i) { return value + '.f' + i });
|
1380
|
-
}
|
1381
|
-
for (var i = 0; i < typeData.fields.length; i++) {
|
1382
|
-
ret.push(makeSetValue(ptr, getFastValue(pos, '+', typeData.flatIndexes[i]), value[i], typeData.fields[i], noNeedFirst, 0, 0, noSafe));
|
1383
|
-
}
|
1384
|
-
return ret.join('; ');
|
1385
|
-
}
|
1386
|
-
|
1387
|
-
if (DOUBLE_MODE == 1 && USE_TYPED_ARRAYS == 2 && type == 'double' && (TARGET_X86 || align < 8)) {
|
1388
|
-
return '(' + makeSetTempDouble(0, 'double', value) + ',' +
|
1389
|
-
makeSetValue(ptr, pos, makeGetTempDouble(0, 'i32'), 'i32', noNeedFirst, ignore, align, noSafe, ',') + ',' +
|
1390
|
-
makeSetValue(ptr, getFastValue(pos, '+', Runtime.getNativeTypeSize('i32')), makeGetTempDouble(1, 'i32'), 'i32', noNeedFirst, ignore, align, noSafe, ',') + ')';
|
1391
|
-
} else if (USE_TYPED_ARRAYS == 2 && type == 'i64') {
|
1392
|
-
return '(tempI64 = [' + splitI64(value) + '],' +
|
1393
|
-
makeSetValue(ptr, pos, 'tempI64[0]', 'i32', noNeedFirst, ignore, align, noSafe, ',') + ',' +
|
1394
|
-
makeSetValue(ptr, getFastValue(pos, '+', Runtime.getNativeTypeSize('i32')), 'tempI64[1]', 'i32', noNeedFirst, ignore, align, noSafe, ',') + ')';
|
1395
|
-
}
|
1396
|
-
|
1397
|
-
var bits = getBits(type);
|
1398
|
-
var needSplitting = bits > 0 && !isPowerOfTwo(bits); // an unnatural type like i24
|
1399
|
-
if (USE_TYPED_ARRAYS == 2 && (align || needSplitting)) {
|
1400
|
-
// Alignment is important here, or we need to split this up for other reasons.
|
1401
|
-
var bytes = Runtime.getNativeTypeSize(type);
|
1402
|
-
if (DOUBLE_MODE == 0 && type == 'double') bytes = 4; // we will really only read 4 bytes here
|
1403
|
-
if (bytes > align || needSplitting) {
|
1404
|
-
var ret = '';
|
1405
|
-
if (isIntImplemented(type)) {
|
1406
|
-
if (bytes == 4 && align == 2) {
|
1407
|
-
// Special case that we can optimize
|
1408
|
-
ret += 'tempBigInt=' + value + sep;
|
1409
|
-
ret += makeSetValue(ptr, pos, 'tempBigInt&0xffff', 'i16', noNeedFirst, ignore, 2, noSafe) + sep;
|
1410
|
-
ret += makeSetValue(ptr, getFastValue(pos, '+', 2), 'tempBigInt>>16', 'i16', noNeedFirst, ignore, 2, noSafe);
|
1411
|
-
} else {
|
1412
|
-
ret += 'tempBigInt=' + value + sep;
|
1413
|
-
for (var i = 0; i < bytes; i++) {
|
1414
|
-
ret += makeSetValue(ptr, getFastValue(pos, '+', i), 'tempBigInt&0xff', 'i8', noNeedFirst, ignore, 1, noSafe);
|
1415
|
-
if (i < bytes-1) ret += sep + 'tempBigInt = tempBigInt>>8' + sep;
|
1416
|
-
}
|
1417
|
-
}
|
1418
|
-
} else {
|
1419
|
-
ret += makeSetValue('tempDoublePtr', 0, value, type, noNeedFirst, ignore, 8, noSafe, null, true) + sep;
|
1420
|
-
ret += makeCopyValues(getFastValue(ptr, '+', pos), 'tempDoublePtr', Runtime.getNativeTypeSize(type), type, null, align, sep);
|
1421
|
-
}
|
1422
|
-
return ret;
|
1423
|
-
}
|
1424
|
-
}
|
1425
|
-
|
1426
|
-
value = indexizeFunctions(value, type);
|
1427
|
-
var offset = calcFastOffset(ptr, pos, noNeedFirst);
|
1428
|
-
if (phase === 'pre' && isNumber(offset)) offset += ' '; // avoid pure numeric strings, seem to be perf issues with overly-aggressive interning or slt in pre processing of heap inits
|
1429
|
-
if (SAFE_HEAP && !noSafe) {
|
1430
|
-
var printType = type;
|
1431
|
-
if (printType !== 'null' && printType[0] !== '#') printType = '"' + safeQuote(printType) + '"';
|
1432
|
-
if (printType[0] === '#') printType = printType.substr(1);
|
1433
|
-
return 'SAFE_HEAP_STORE(' + asmCoercion(offset, 'i32') + ', ' + asmCoercion(value, type) + ', ' + (ASM_JS ? 0 : printType) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')';
|
1434
|
-
} else {
|
1435
|
-
return makeGetSlabs(ptr, type, true).map(function(slab) { return slab + '[' + getHeapOffset(offset, type, forceAsm) + ']=' + value }).join(sep);
|
1436
|
-
}
|
1437
|
-
}
|
1438
|
-
|
1439
|
-
function makeSetValueAsm(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe, sep, forcedAlign) {
|
1440
|
-
return makeSetValue(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe, sep, forcedAlign, true);
|
1441
|
-
}
|
1442
|
-
|
1443
|
-
var UNROLL_LOOP_MAX = 8;
|
1444
|
-
|
1445
|
-
function makeSetValues(ptr, pos, value, type, num, align) {
|
1446
|
-
function unroll(type, num, jump, value$) {
|
1447
|
-
jump = jump || 1;
|
1448
|
-
value$ = value$ || value;
|
1449
|
-
return range(num).map(function(i) {
|
1450
|
-
return makeSetValue(ptr, getFastValue(pos, '+', i*jump), value$, type);
|
1451
|
-
}).join('; ');
|
1452
|
-
}
|
1453
|
-
if (USE_TYPED_ARRAYS <= 1) {
|
1454
|
-
if (isNumber(num) && parseInt(num) <= UNROLL_LOOP_MAX) {
|
1455
|
-
return unroll(type, num);
|
1456
|
-
}
|
1457
|
-
return 'for (var $$dest = ' + getFastValue(ptr, '+', pos) + ', $$stop = $$dest + ' + num + '; $$dest < $$stop; $$dest++) {\n' +
|
1458
|
-
makeSetValue('$$dest', '0', value, type) + '\n}';
|
1459
|
-
} else { // USE_TYPED_ARRAYS == 2
|
1460
|
-
// If we don't know how to handle this at compile-time, or handling it is best done in a large amount of code, call memset
|
1461
|
-
// TODO: optimize the case of numeric num but non-numeric value
|
1462
|
-
if (!isNumber(num) || !isNumber(value) || (parseInt(num)/align >= UNROLL_LOOP_MAX)) {
|
1463
|
-
return '_memset(' + asmCoercion(getFastValue(ptr, '+', pos), 'i32') + ', ' + asmCoercion(value, 'i32') + ', ' + asmCoercion(num, 'i32') + ')|0';
|
1464
|
-
}
|
1465
|
-
num = parseInt(num);
|
1466
|
-
value = parseInt(value);
|
1467
|
-
if (value < 0) value += 256; // make it unsigned
|
1468
|
-
var values = {
|
1469
|
-
1: value,
|
1470
|
-
2: value | (value << 8),
|
1471
|
-
4: value | (value << 8) | (value << 16) | (value << 24)
|
1472
|
-
};
|
1473
|
-
var ret = [];
|
1474
|
-
[4, 2, 1].forEach(function(possibleAlign) {
|
1475
|
-
if (num == 0) return;
|
1476
|
-
if (align >= possibleAlign) {
|
1477
|
-
ret.push(unroll('i' + (possibleAlign*8), Math.floor(num/possibleAlign), possibleAlign, values[possibleAlign]));
|
1478
|
-
pos = getFastValue(pos, '+', Math.floor(num/possibleAlign)*possibleAlign);
|
1479
|
-
num %= possibleAlign;
|
1480
|
-
}
|
1481
|
-
});
|
1482
|
-
return ret.join('; ');
|
1483
|
-
}
|
1484
|
-
}
|
1485
|
-
|
1486
|
-
var TYPED_ARRAY_SET_MIN = Infinity; // .set() as memcpy seems to just slow us down
|
1487
|
-
|
1488
|
-
function makeCopyValues(dest, src, num, type, modifier, align, sep) {
|
1489
|
-
sep = sep || ';';
|
1490
|
-
function unroll(type, num, jump) {
|
1491
|
-
jump = jump || 1;
|
1492
|
-
return range(num).map(function(i) {
|
1493
|
-
if (USE_TYPED_ARRAYS <= 1 && type === 'null') {
|
1494
|
-
// Null is special-cased: We copy over all heaps
|
1495
|
-
return makeGetSlabs(dest, 'null', true).map(function(slab) {
|
1496
|
-
return slab + '[' + getFastValue(dest, '+', i) + ']=' + slab + '[' + getFastValue(src, '+', i) + ']';
|
1497
|
-
}).join(sep) + (SAFE_HEAP ? sep + 'SAFE_HEAP_COPY_HISTORY(' + getFastValue(dest, '+', i) + ', ' + getFastValue(src, '+', i) + ')' : '');
|
1498
|
-
} else {
|
1499
|
-
return makeSetValue(dest, i*jump, makeGetValue(src, i*jump, type), type);
|
1500
|
-
}
|
1501
|
-
}).join(sep);
|
1502
|
-
}
|
1503
|
-
if (USE_TYPED_ARRAYS <= 1) {
|
1504
|
-
if (isNumber(num) && parseInt(num) <= UNROLL_LOOP_MAX) {
|
1505
|
-
return unroll(type, num);
|
1506
|
-
}
|
1507
|
-
var oldDest = dest, oldSrc = src;
|
1508
|
-
dest = '$$dest';
|
1509
|
-
src = '$$src';
|
1510
|
-
return 'for (var $$src = ' + oldSrc + ', $$dest = ' + oldDest + ', $$stop = $$src + ' + num + '; $$src < $$stop; $$src++, $$dest++) {\n' +
|
1511
|
-
unroll(type, 1) + ' }';
|
1512
|
-
} else { // USE_TYPED_ARRAYS == 2
|
1513
|
-
// If we don't know how to handle this at compile-time, or handling it is best done in a large amount of code, call memset
|
1514
|
-
if (!isNumber(num)) num = stripCorrections(num);
|
1515
|
-
if (!isNumber(align)) align = stripCorrections(align);
|
1516
|
-
if (!isNumber(num) || (parseInt(num)/align >= UNROLL_LOOP_MAX)) {
|
1517
|
-
return '(_memcpy(' + dest + ', ' + src + ', ' + num + ')|0)';
|
1518
|
-
}
|
1519
|
-
num = parseInt(num);
|
1520
|
-
if (ASM_JS) {
|
1521
|
-
dest = stripCorrections(dest); // remove corrections, since we will be correcting after we add anyhow,
|
1522
|
-
src = stripCorrections(src); // and in the heap assignment expression
|
1523
|
-
}
|
1524
|
-
var ret = [];
|
1525
|
-
[4, 2, 1].forEach(function(possibleAlign) {
|
1526
|
-
if (num == 0) return;
|
1527
|
-
if (align >= possibleAlign) {
|
1528
|
-
ret.push(unroll('i' + (possibleAlign*8), Math.floor(num/possibleAlign), possibleAlign));
|
1529
|
-
src = getFastValue(src, '+', Math.floor(num/possibleAlign)*possibleAlign);
|
1530
|
-
dest = getFastValue(dest, '+', Math.floor(num/possibleAlign)*possibleAlign);
|
1531
|
-
num %= possibleAlign;
|
1532
|
-
}
|
1533
|
-
});
|
1534
|
-
return ret.join(sep);
|
1535
|
-
}
|
1536
|
-
}
|
1537
|
-
|
1538
|
-
function makeHEAPView(which, start, end) {
|
1539
|
-
// Assumes USE_TYPED_ARRAYS == 2
|
1540
|
-
var size = parseInt(which.replace('U', '').replace('F', ''))/8;
|
1541
|
-
var mod = size == 1 ? '' : ('>>' + log2(size));
|
1542
|
-
return 'HEAP' + which + '.subarray((' + start + ')' + mod + ',(' + end + ')' + mod + ')';
|
1543
|
-
}
|
1544
|
-
|
1545
|
-
var TWO_TWENTY = Math.pow(2, 20);
|
1546
|
-
|
1547
|
-
// Given two values and an operation, returns the result of that operation.
|
1548
|
-
// Tries to do as much as possible at compile time.
|
1549
|
-
// Leaves overflows etc. unhandled, *except* for integer multiply, in order to be efficient with Math.imul
|
1550
|
-
function getFastValue(a, op, b, type) {
|
1551
|
-
a = a === 'true' ? '1' : (a === 'false' ? '0' : a);
|
1552
|
-
b = b === 'true' ? '1' : (b === 'false' ? '0' : b);
|
1553
|
-
|
1554
|
-
var aNumber = null, bNumber = null;
|
1555
|
-
if (typeof a === 'number') {
|
1556
|
-
aNumber = a;
|
1557
|
-
a = a.toString();
|
1558
|
-
} else if (isNumber(a)) aNumber = parseFloat(a);
|
1559
|
-
if (typeof b === 'number') {
|
1560
|
-
bNumber = b;
|
1561
|
-
b = b.toString();
|
1562
|
-
} else if (isNumber(b)) bNumber = parseFloat(b);
|
1563
|
-
|
1564
|
-
if (aNumber !== null && bNumber !== null) {
|
1565
|
-
switch (op) {
|
1566
|
-
case '+': return (aNumber + bNumber).toString();
|
1567
|
-
case '-': return (aNumber - bNumber).toString();
|
1568
|
-
case '*': return (aNumber * bNumber).toString();
|
1569
|
-
case '/': {
|
1570
|
-
if (type[0] === 'i') {
|
1571
|
-
return ((aNumber / bNumber)|0).toString();
|
1572
|
-
} else {
|
1573
|
-
return (aNumber / bNumber).toString();
|
1574
|
-
}
|
1575
|
-
}
|
1576
|
-
case '%': return (aNumber % bNumber).toString();
|
1577
|
-
case '|': return (aNumber | bNumber).toString();
|
1578
|
-
case '>>>': return (aNumber >>> bNumber).toString();
|
1579
|
-
case '&': return (aNumber & bNumber).toString();
|
1580
|
-
case 'pow': return Math.pow(aNumber, bNumber).toString();
|
1581
|
-
default: throw 'need to implement getFastValue pn ' + op;
|
1582
|
-
}
|
1583
|
-
}
|
1584
|
-
if (op === 'pow') {
|
1585
|
-
if (a === '2' && isIntImplemented(type)) {
|
1586
|
-
return '(1 << (' + b + '))';
|
1587
|
-
}
|
1588
|
-
return 'Math_pow(' + a + ', ' + b + ')';
|
1589
|
-
}
|
1590
|
-
if ((op === '+' || op === '*') && aNumber !== null) { // if one of them is a number, keep it last
|
1591
|
-
var c = b;
|
1592
|
-
b = a;
|
1593
|
-
a = c;
|
1594
|
-
var cNumber = bNumber;
|
1595
|
-
bNumber = aNumber;
|
1596
|
-
aNumber = cNumber;
|
1597
|
-
}
|
1598
|
-
if (op === '*') {
|
1599
|
-
// We can't eliminate where a or b are 0 as that would break things for creating
|
1600
|
-
// a negative 0.
|
1601
|
-
if ((aNumber === 0 || bNumber === 0) && !(type in Runtime.FLOAT_TYPES)) {
|
1602
|
-
return '0';
|
1603
|
-
} else if (aNumber === 1) {
|
1604
|
-
return b;
|
1605
|
-
} else if (bNumber === 1) {
|
1606
|
-
return a;
|
1607
|
-
} else if (bNumber !== null && type && isIntImplemented(type) && Runtime.getNativeTypeSize(type) <= 32) {
|
1608
|
-
var shifts = Math.log(bNumber)/Math.LN2;
|
1609
|
-
if (shifts % 1 === 0) {
|
1610
|
-
return '(' + a + '<<' + shifts + ')';
|
1611
|
-
}
|
1612
|
-
}
|
1613
|
-
if (!(type in Runtime.FLOAT_TYPES)) {
|
1614
|
-
// if guaranteed small enough to not overflow into a double, do a normal multiply
|
1615
|
-
var bits = getBits(type) || 32; // default is 32-bit multiply for things like getelementptr indexes
|
1616
|
-
// Note that we can emit simple multiple in non-asm.js mode, but asm.js will not parse "16-bit" multiple, so must do imul there
|
1617
|
-
if ((aNumber !== null && Math.abs(a) < TWO_TWENTY) || (bNumber !== null && Math.abs(b) < TWO_TWENTY) || (bits < 32 && !ASM_JS)) {
|
1618
|
-
return '(((' + a + ')*(' + b + '))&' + ((Math.pow(2, bits)-1)|0) + ')'; // keep a non-eliminatable coercion directly on this
|
1619
|
-
}
|
1620
|
-
return '(Math_imul(' + a + ',' + b + ')|0)';
|
1621
|
-
}
|
1622
|
-
} else if (op === '/') {
|
1623
|
-
if (a === '0' && !(type in Runtime.FLOAT_TYPES)) { // careful on floats, since 0*NaN is not 0
|
1624
|
-
return '0';
|
1625
|
-
} else if (b === 1) {
|
1626
|
-
return a;
|
1627
|
-
} // Doing shifts for division is problematic, as getting the rounding right on negatives is tricky
|
1628
|
-
} else if (op === '+' || op === '-') {
|
1629
|
-
if (b[0] === '-') {
|
1630
|
-
op = op === '+' ? '-' : '+';
|
1631
|
-
b = b.substr(1);
|
1632
|
-
}
|
1633
|
-
if (aNumber === 0) {
|
1634
|
-
return op === '+' ? b : '(-' + b + ')';
|
1635
|
-
} else if (bNumber === 0) {
|
1636
|
-
return a;
|
1637
|
-
}
|
1638
|
-
}
|
1639
|
-
return '(' + a + ')' + op + '(' + b + ')';
|
1640
|
-
}
|
1641
|
-
|
1642
|
-
function getFastValues(list, op, type) {
|
1643
|
-
assert(op === '+' && type === 'i32');
|
1644
|
-
for (var i = 0; i < list.length; i++) {
|
1645
|
-
if (isNumber(list[i])) list[i] = (list[i]|0) + '';
|
1646
|
-
}
|
1647
|
-
var changed = true;
|
1648
|
-
while (changed) {
|
1649
|
-
changed = false;
|
1650
|
-
for (var i = 0; i < list.length-1; i++) {
|
1651
|
-
var fast = getFastValue(list[i], op, list[i+1], type);
|
1652
|
-
var raw = list[i] + op + list[i+1];
|
1653
|
-
if (fast.length < raw.length || fast.indexOf(op) < 0) {
|
1654
|
-
if (isNumber(fast)) fast = (fast|0) + '';
|
1655
|
-
list[i] = fast;
|
1656
|
-
list.splice(i+1, 1);
|
1657
|
-
i--;
|
1658
|
-
changed = true;
|
1659
|
-
break;
|
1660
|
-
}
|
1661
|
-
}
|
1662
|
-
}
|
1663
|
-
if (list.length == 1) return list[0];
|
1664
|
-
return list.reduce(function(a, b) { return a + op + b });
|
1665
|
-
}
|
1666
|
-
|
1667
|
-
function calcFastOffset(ptr, pos, noNeedFirst) {
|
1668
|
-
assert(!noNeedFirst);
|
1669
|
-
return getFastValue(ptr, '+', pos, 'i32');
|
1670
|
-
}
|
1671
|
-
|
1672
|
-
var IHEAP_FHEAP = set('IHEAP', 'IHEAPU', 'FHEAP');
|
1673
|
-
|
1674
|
-
var temp64f = new Float64Array(1);
|
1675
|
-
var temp32f = new Float32Array(temp64f.buffer);
|
1676
|
-
var temp32 = new Uint32Array(temp64f.buffer);
|
1677
|
-
var temp16 = new Uint16Array(temp64f.buffer);
|
1678
|
-
var temp8 = new Uint8Array(temp64f.buffer);
|
1679
|
-
var memoryInitialization = [];
|
1680
|
-
|
1681
|
-
function writeInt8s(slab, i, value, type) {
|
1682
|
-
var currSize;
|
1683
|
-
switch (type) {
|
1684
|
-
case 'i1':
|
1685
|
-
case 'i8': temp8[0] = value; currSize = 1; break;
|
1686
|
-
case 'i16': temp16[0] = value; currSize = 2; break;
|
1687
|
-
case 'float': temp32f[0] = value; currSize = 4; break;
|
1688
|
-
case 'double': temp64f[0] = value; currSize = 8; break;
|
1689
|
-
case 'i64': // fall through, i64 is two i32 chunks
|
1690
|
-
case 'i32': // fall through, i32 can be a pointer
|
1691
|
-
default: {
|
1692
|
-
if (type == 'i32' || type == 'i64' || type[type.length-1] == '*') {
|
1693
|
-
if (!isNumber(value)) { // function table stuff, etc.
|
1694
|
-
slab[i] = value;
|
1695
|
-
slab[i+1] = slab[i+2] = slab[i+3] = 0;
|
1696
|
-
return 4;
|
1697
|
-
}
|
1698
|
-
temp32[0] = value;
|
1699
|
-
currSize = 4;
|
1700
|
-
} else {
|
1701
|
-
throw 'what? ' + types[i];
|
1702
|
-
}
|
1703
|
-
}
|
1704
|
-
}
|
1705
|
-
for (var j = 0; j < currSize; j++) {
|
1706
|
-
slab[i+j] = temp8[j];
|
1707
|
-
}
|
1708
|
-
return currSize;
|
1709
|
-
}
|
1710
|
-
|
1711
|
-
function makePointer(slab, pos, allocator, type, ptr, finalMemoryInitialization) {
|
1712
|
-
assert(type, 'makePointer requires type info');
|
1713
|
-
if (typeof slab == 'string' && (slab.substr(0, 4) === 'HEAP' || (USE_TYPED_ARRAYS == 1 && slab in IHEAP_FHEAP))) return pos;
|
1714
|
-
var types = generateStructTypes(type);
|
1715
|
-
if (typeof slab == 'object') {
|
1716
|
-
for (var i = 0; i < slab.length; i++) {
|
1717
|
-
var curr = slab[i];
|
1718
|
-
if (isNumber(curr)) {
|
1719
|
-
slab[i] = parseFloat(curr); // fix "5" to 5 etc.
|
1720
|
-
} else if (curr == 'undef') {
|
1721
|
-
slab[i] = 0;
|
1722
|
-
}
|
1723
|
-
}
|
1724
|
-
}
|
1725
|
-
// compress type info and data if possible
|
1726
|
-
if (USE_TYPED_ARRAYS != 2) {
|
1727
|
-
var de;
|
1728
|
-
try {
|
1729
|
-
// compress all-zeros into a number (which will become zeros(..)).
|
1730
|
-
// note that we cannot always eval the slab, e.g., if it contains ident,0,0 etc. In that case, no compression TODO: ensure we get arrays here, not str
|
1731
|
-
var evaled = typeof slab === 'string' ? eval(slab) : slab;
|
1732
|
-
de = dedup(evaled);
|
1733
|
-
if (de.length === 1 && de[0] == 0) {
|
1734
|
-
slab = types.length;
|
1735
|
-
}
|
1736
|
-
// TODO: if not all zeros, at least filter out items with type === 0. requires cleverness to know how to skip at runtime though. also
|
1737
|
-
// be careful of structure padding
|
1738
|
-
} catch(e){}
|
1739
|
-
de = dedup(types);
|
1740
|
-
if (de.length === 1) {
|
1741
|
-
types = de[0];
|
1742
|
-
} else if (de.length === 2 && typeof slab === 'number') {
|
1743
|
-
// If slab is all zeros, we can compress types even if we have i32,0,0,0,i32,0,0,0 etc. - we do not need the zeros
|
1744
|
-
de = de.filter(function(x) { return x !== 0 });
|
1745
|
-
if (de.length === 1) {
|
1746
|
-
types = de[0];
|
1747
|
-
}
|
1748
|
-
}
|
1749
|
-
} else { // USE_TYPED_ARRAYS == 2
|
1750
|
-
if (!finalMemoryInitialization) {
|
1751
|
-
// XXX This heavily assumes the target endianness is the same as our current endianness! XXX
|
1752
|
-
var i = 0;
|
1753
|
-
while (i < slab.length) {
|
1754
|
-
var currType = types[i];
|
1755
|
-
if (!currType) { i++; continue }
|
1756
|
-
i += writeInt8s(slab, i, slab[i], currType);
|
1757
|
-
}
|
1758
|
-
types = 'i8';
|
1759
|
-
}
|
1760
|
-
}
|
1761
|
-
if (allocator == 'ALLOC_NONE' && USE_TYPED_ARRAYS == 2) {
|
1762
|
-
if (!finalMemoryInitialization) {
|
1763
|
-
// writing out into memory, without a normal allocation. We put all of these into a single big chunk.
|
1764
|
-
assert(typeof slab == 'object');
|
1765
|
-
assert(slab.length % QUANTUM_SIZE == 0, slab.length); // must be aligned already
|
1766
|
-
if (SIDE_MODULE && typeof ptr == 'string') {
|
1767
|
-
ptr = parseInt(ptr.substring(ptr.indexOf('+'), ptr.length-1)); // parse into (H_BASE+X)
|
1768
|
-
}
|
1769
|
-
var offset = ptr - Runtime.GLOBAL_BASE;
|
1770
|
-
for (var i = 0; i < slab.length; i++) {
|
1771
|
-
memoryInitialization[offset + i] = slab[i];
|
1772
|
-
}
|
1773
|
-
return '';
|
1774
|
-
}
|
1775
|
-
// This is the final memory initialization
|
1776
|
-
types = 'i8';
|
1777
|
-
}
|
1778
|
-
|
1779
|
-
// JS engines sometimes say array initializers are too large. Work around that by chunking and calling concat to combine at runtime
|
1780
|
-
var chunkSize = JS_CHUNK_SIZE;
|
1781
|
-
function chunkify(array) {
|
1782
|
-
// break very large slabs into parts
|
1783
|
-
var ret = '';
|
1784
|
-
var index = 0;
|
1785
|
-
while (index < array.length) {
|
1786
|
-
ret = (ret ? ret + '.concat(' : '') + '[' + array.slice(index, index + chunkSize).map(JSON.stringify) + ']' + (ret ? ')\n' : '');
|
1787
|
-
index += chunkSize;
|
1788
|
-
}
|
1789
|
-
return ret;
|
1790
|
-
}
|
1791
|
-
if (typeof slab == 'object' && slab.length > chunkSize) {
|
1792
|
-
slab = chunkify(slab);
|
1793
|
-
}
|
1794
|
-
if (typeof types == 'object') {
|
1795
|
-
while (types.length < slab.length) types.push(0);
|
1796
|
-
}
|
1797
|
-
if (typeof types != 'string' && types.length > chunkSize) {
|
1798
|
-
types = chunkify(types);
|
1799
|
-
} else {
|
1800
|
-
types = JSON.stringify(types);
|
1801
|
-
}
|
1802
|
-
if (typeof slab == 'object') slab = '[' + slab.join(',') + ']';
|
1803
|
-
return 'allocate(' + slab + ', ' + types + (allocator ? ', ' + allocator : '') + (allocator == 'ALLOC_NONE' ? ', ' + ptr : '') + ')';
|
1804
|
-
}
|
1805
|
-
|
1806
|
-
function makeGetSlabs(ptr, type, allowMultiple, unsigned) {
|
1807
|
-
assert(type);
|
1808
|
-
if (!USE_TYPED_ARRAYS) {
|
1809
|
-
return ['HEAP'];
|
1810
|
-
} else if (USE_TYPED_ARRAYS == 1) {
|
1811
|
-
if (type in Runtime.FLOAT_TYPES || type === 'int64') { // XXX should be i64, no?
|
1812
|
-
return ['FHEAP']; // If USE_FHEAP is false, will fail at runtime. At compiletime we do need it for library stuff.
|
1813
|
-
} else if (type in Runtime.INT_TYPES || isPointerType(type)) {
|
1814
|
-
return [unsigned ? 'IHEAPU' : 'IHEAP'];
|
1815
|
-
} else {
|
1816
|
-
assert(allowMultiple, 'Unknown slab type and !allowMultiple: ' + type);
|
1817
|
-
if (USE_FHEAP) {
|
1818
|
-
return ['IHEAP', 'FHEAP']; // unknown, so assign to both typed arrays
|
1819
|
-
} else {
|
1820
|
-
return ['IHEAP'];
|
1821
|
-
}
|
1822
|
-
}
|
1823
|
-
} else { // USE_TYPED_ARRAYS == 2)
|
1824
|
-
if (isPointerType(type)) type = 'i32'; // Hardcoded 32-bit
|
1825
|
-
switch(type) {
|
1826
|
-
case 'i1': case 'i8': return [unsigned ? 'HEAPU8' : 'HEAP8']; break;
|
1827
|
-
case 'i16': return [unsigned ? 'HEAPU16' : 'HEAP16']; break;
|
1828
|
-
case '<4 x i32>':
|
1829
|
-
case 'i32': case 'i64': return [unsigned ? 'HEAPU32' : 'HEAP32']; break;
|
1830
|
-
case 'double': {
|
1831
|
-
if (TARGET_LE32) return ['HEAPF64']; // in le32, we do have the ability to assume 64-bit alignment
|
1832
|
-
// otherwise, fall through to float
|
1833
|
-
}
|
1834
|
-
case '<4 x float>':
|
1835
|
-
case 'float': return ['HEAPF32'];
|
1836
|
-
default: {
|
1837
|
-
throw 'what, exactly, can we do for unknown types in TA2?! ' + [new Error().stack, ptr, type, allowMultiple, unsigned];
|
1838
|
-
}
|
1839
|
-
}
|
1840
|
-
}
|
1841
|
-
return [];
|
1842
|
-
}
|
1843
|
-
|
1844
|
-
function checkBitcast(item) {
|
1845
|
-
// Warn about some types of casts, then fall through to the handling code below
|
1846
|
-
var oldType = item.params[0].type;
|
1847
|
-
var newType = item.type;
|
1848
|
-
if (isPossiblyFunctionType(oldType) && isPossiblyFunctionType(newType)) {
|
1849
|
-
var oldInfo = {}, newInfo = {};
|
1850
|
-
var oldCount = countNormalArgs(oldType, oldInfo);
|
1851
|
-
var newCount = countNormalArgs(newType, newInfo);
|
1852
|
-
var warned = false;
|
1853
|
-
function showWarning() {
|
1854
|
-
if (warned) return;
|
1855
|
-
warned = true;
|
1856
|
-
if (VERBOSE) {
|
1857
|
-
warnOnce('Casting potentially incompatible function pointer ' + oldType + ' to ' + newType + ', for ' + item.params[0].ident.slice(1));
|
1858
|
-
} else {
|
1859
|
-
warnOnce('Casting a function pointer type to a potentially incompatible one (use -s VERBOSE=1 to see more)');
|
1860
|
-
}
|
1861
|
-
warnOnce('See https://github.com/kripken/emscripten/wiki/CodeGuidelinesAndLimitations#function-pointer-issues for more information on dangerous function pointer casts');
|
1862
|
-
if (ASM_JS) warnOnce('Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these');
|
1863
|
-
}
|
1864
|
-
if (oldCount != newCount && oldCount && newCount) showWarning();
|
1865
|
-
if (ASM_JS) {
|
1866
|
-
if (oldCount != newCount) showWarning();
|
1867
|
-
else if (!isIdenticallyImplemented(oldInfo.returnType, newInfo.returnType)) {
|
1868
|
-
showWarning();
|
1869
|
-
} else {
|
1870
|
-
for (var i = 0; i < oldCount; i++) {
|
1871
|
-
if (!isIdenticallyImplemented(oldInfo.segments[i][0].text, newInfo.segments[i][0].text)) {
|
1872
|
-
showWarning();
|
1873
|
-
break;
|
1874
|
-
}
|
1875
|
-
}
|
1876
|
-
}
|
1877
|
-
}
|
1878
|
-
}
|
1879
|
-
}
|
1880
|
-
|
1881
|
-
function finalizeLLVMFunctionCall(item, noIndexizeFunctions) {
|
1882
|
-
if (item.intertype == 'getelementptr') { // TODO finalizeLLVMParameter on the ident and the indexes?
|
1883
|
-
return makePointer(makeGetSlabs(item.ident, item.type)[0], getGetElementPtrIndexes(item), null, item.type);
|
1884
|
-
}
|
1885
|
-
if (item.intertype == 'bitcast') checkBitcast(item);
|
1886
|
-
var temp = {
|
1887
|
-
op: item.intertype,
|
1888
|
-
variant: item.variant,
|
1889
|
-
type: item.type,
|
1890
|
-
params: item.params.slice(0) // XXX slice?
|
1891
|
-
};
|
1892
|
-
return processMathop(temp);
|
1893
|
-
}
|
1894
|
-
|
1895
|
-
function getGetElementPtrIndexes(item) {
|
1896
|
-
var type = item.params[0].type;
|
1897
|
-
if (USE_TYPED_ARRAYS == 2) {
|
1898
|
-
// GEP indexes are marked as i64s, but they are just numbers to us
|
1899
|
-
item.params.forEach(function(param) { param.type = 'i32' });
|
1900
|
-
}
|
1901
|
-
item.params = item.params.map(finalizeLLVMParameter);
|
1902
|
-
var ident = item.params[0];
|
1903
|
-
|
1904
|
-
// struct pointer, struct*, and getting a ptr to an element in that struct. Param 1 is which struct, then we have items in that
|
1905
|
-
// struct, and possibly further substructures, all embedded
|
1906
|
-
// can also be to 'blocks': [8 x i32]*, not just structs
|
1907
|
-
type = removePointing(type);
|
1908
|
-
var indexes = [ident];
|
1909
|
-
var offset = item.params[1];
|
1910
|
-
if (offset != 0) {
|
1911
|
-
if (isStructType(type)) {
|
1912
|
-
indexes.push(getFastValue(Types.types[type].flatSize, '*', offset, 'i32'));
|
1913
|
-
} else {
|
1914
|
-
indexes.push(getFastValue(Runtime.getNativeTypeSize(type), '*', offset, 'i32'));
|
1915
|
-
}
|
1916
|
-
}
|
1917
|
-
item.params.slice(2, item.params.length).forEach(function(arg, i) {
|
1918
|
-
var curr = arg;
|
1919
|
-
// TODO: If index is constant, optimize
|
1920
|
-
var typeData = Types.types[type];
|
1921
|
-
assert(typeData || i == item.params.length - 3); // can be null, when we get to the end (a basic type)
|
1922
|
-
if (isStructType(type) && typeData.needsFlattening) {
|
1923
|
-
if (typeData.flatFactor) {
|
1924
|
-
indexes.push(getFastValue(curr, '*', typeData.flatFactor, 'i32'));
|
1925
|
-
} else {
|
1926
|
-
if (isNumber(curr)) {
|
1927
|
-
indexes.push(typeData.flatIndexes[curr]);
|
1928
|
-
} else {
|
1929
|
-
indexes.push(toNiceIdent(type) + '___FLATTENER[' + curr + ']'); // TODO: If curr is constant, optimize out the flattener struct
|
1930
|
-
}
|
1931
|
-
}
|
1932
|
-
} else {
|
1933
|
-
if (curr != 0) {
|
1934
|
-
indexes.push(curr);
|
1935
|
-
}
|
1936
|
-
}
|
1937
|
-
if (typeData) {
|
1938
|
-
if (isArrayType(type)) {
|
1939
|
-
type = typeData.fields[0]; // all the same, so accept even out-of-bounds this way
|
1940
|
-
} else {
|
1941
|
-
assert(isNumber(curr)); // cannot be dynamic
|
1942
|
-
type = typeData.fields[curr];
|
1943
|
-
}
|
1944
|
-
assert(type);
|
1945
|
-
}
|
1946
|
-
});
|
1947
|
-
|
1948
|
-
var ret = getFastValues(indexes, '+', 'i32');
|
1949
|
-
|
1950
|
-
ret = handleOverflow(ret, 32); // XXX - we assume a 32-bit arch here. If you fail on this, change to 64
|
1951
|
-
|
1952
|
-
return ret;
|
1953
|
-
}
|
1954
|
-
|
1955
|
-
function handleOverflow(text, bits) {
|
1956
|
-
// TODO: handle overflows of i64s
|
1957
|
-
if (!bits) return text;
|
1958
|
-
var correct = correctOverflows();
|
1959
|
-
warnOnce(!correct || bits <= 32, 'Cannot correct overflows of this many bits: ' + bits);
|
1960
|
-
if (CHECK_OVERFLOWS) return 'CHECK_OVERFLOW(' + text + ', ' + bits + ', ' + Math.floor(correctSpecificOverflow()) + ')';
|
1961
|
-
if (!correct) return text;
|
1962
|
-
if (bits == 32) {
|
1963
|
-
if (isNumber(text)) return text | 0;
|
1964
|
-
return '((' + text + ')|0)';
|
1965
|
-
} else if (bits < 32) {
|
1966
|
-
if (isNumber(text)) return text & (Math.pow(2, bits) - 1);
|
1967
|
-
return '((' + text + ')&' + (Math.pow(2, bits) - 1) + ')';
|
1968
|
-
} else {
|
1969
|
-
return text; // We warned about this earlier
|
1970
|
-
}
|
1971
|
-
}
|
1972
|
-
|
1973
|
-
function makeLLVMStruct(values) {
|
1974
|
-
if (USE_TYPED_ARRAYS == 2) {
|
1975
|
-
return 'DEPRECATED' + (new Error().stack) + 'XXX';
|
1976
|
-
} else {
|
1977
|
-
return '{ ' + values.map(function(value, i) { return 'f' + i + ': ' + value }).join(', ') + ' }'
|
1978
|
-
}
|
1979
|
-
}
|
1980
|
-
|
1981
|
-
function makeStructuralReturn(values, inAsm) {
|
1982
|
-
if (USE_TYPED_ARRAYS == 2) {
|
1983
|
-
var i = -1;
|
1984
|
-
return 'return ' + asmCoercion(values.slice(1).map(function(value) {
|
1985
|
-
i++;
|
1986
|
-
return ASM_JS ? (inAsm ? 'tempRet' + i + ' = ' + value : 'asm["setTempRet' + i + '"](' + value + ')')
|
1987
|
-
: 'tempRet' + i + ' = ' + value;
|
1988
|
-
}).concat([values[0]]).join(','), 'i32');
|
1989
|
-
} else {
|
1990
|
-
var i = 0;
|
1991
|
-
return 'return { ' + values.map(function(value) {
|
1992
|
-
return 'f' + (i++) + ': ' + value;
|
1993
|
-
}).join(', ') + ' }';
|
1994
|
-
}
|
1995
|
-
}
|
1996
|
-
|
1997
|
-
function makeStructuralAccess(ident, i) {
|
1998
|
-
if (USE_TYPED_ARRAYS == 2) {
|
1999
|
-
return ident + '$' + i;
|
2000
|
-
} else {
|
2001
|
-
return ident + '.f' + i;
|
2002
|
-
}
|
2003
|
-
}
|
2004
|
-
|
2005
|
-
function makeThrow(what) {
|
2006
|
-
return 'throw ' + what + (DISABLE_EXCEPTION_CATCHING == 1 ? ' + " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."' : '') + ';';
|
2007
|
-
}
|
2008
|
-
|
2009
|
-
// From parseLLVMSegment
|
2010
|
-
function finalizeLLVMParameter(param, noIndexizeFunctions) {
|
2011
|
-
var ret;
|
2012
|
-
if (isNumber(param)) {
|
2013
|
-
return param;
|
2014
|
-
} else if (typeof param === 'string') {
|
2015
|
-
return toNiceIdentCarefully(param);
|
2016
|
-
} else if (param.intertype in PARSABLE_LLVM_FUNCTIONS) {
|
2017
|
-
ret = finalizeLLVMFunctionCall(param, noIndexizeFunctions);
|
2018
|
-
} else if (param.ident == 'zeroinitializer') {
|
2019
|
-
if (isStructType(param.type)) {
|
2020
|
-
return makeLLVMStruct(zeros(Types.types[param.type].fields.length));
|
2021
|
-
} else if (isVectorType(param.type)) {
|
2022
|
-
return ensureVector(0, getVectorBaseType(param.type));
|
2023
|
-
} else {
|
2024
|
-
return '0';
|
2025
|
-
}
|
2026
|
-
} else if (param.intertype == 'value') {
|
2027
|
-
ret = param.ident;
|
2028
|
-
if (ret in Variables.globals) {
|
2029
|
-
ret = makeGlobalUse(ret);
|
2030
|
-
}
|
2031
|
-
if (param.type == 'i64' && USE_TYPED_ARRAYS == 2) {
|
2032
|
-
ret = parseI64Constant(ret);
|
2033
|
-
}
|
2034
|
-
ret = parseNumerical(ret, param.type);
|
2035
|
-
ret = asmEnsureFloat(ret, param.type);
|
2036
|
-
} else if (param.intertype == 'structvalue') {
|
2037
|
-
ret = makeLLVMStruct(param.params.map(function(value) { return finalizeLLVMParameter(value, noIndexizeFunctions) }));
|
2038
|
-
} else if (param.intertype === 'blockaddress') {
|
2039
|
-
return finalizeBlockAddress(param);
|
2040
|
-
} else if (param.intertype === 'type') {
|
2041
|
-
return param.ident; // we don't really want the type here
|
2042
|
-
} else if (param.intertype == 'mathop') {
|
2043
|
-
return processMathop(param);
|
2044
|
-
} else if (param.intertype === 'vector') {
|
2045
|
-
return getVectorBaseType(param.type) + '32x4(' + param.idents.join(',') + ')';
|
2046
|
-
} else {
|
2047
|
-
throw 'invalid llvm parameter: ' + param.intertype;
|
2048
|
-
}
|
2049
|
-
assert(param.type || (typeof param === 'string' && param.substr(0, 6) === 'CHECK_'), 'Missing type for param!');
|
2050
|
-
if (!noIndexizeFunctions) ret = indexizeFunctions(ret, param.type);
|
2051
|
-
return ret;
|
2052
|
-
}
|
2053
|
-
|
2054
|
-
function makeComparison(a, op, b, type) {
|
2055
|
-
assert(type);
|
2056
|
-
if (!isIllegalType(type)) {
|
2057
|
-
return asmCoercion(a, type) + op + asmCoercion(b, type);
|
2058
|
-
} else {
|
2059
|
-
assert(type == 'i64');
|
2060
|
-
return asmCoercion(a + '$0', 'i32') + op + asmCoercion(b + '$0', 'i32') + '&' +
|
2061
|
-
asmCoercion(a + '$1', 'i32') + op + asmCoercion(b + '$1', 'i32');
|
2062
|
-
}
|
2063
|
-
}
|
2064
|
-
|
2065
|
-
function makeSignOp(value, type, op, force, ignore) {
|
2066
|
-
if (USE_TYPED_ARRAYS == 2 && type == 'i64') {
|
2067
|
-
return value; // these are always assumed to be two 32-bit unsigneds.
|
2068
|
-
}
|
2069
|
-
if (isPointerType(type)) type = 'i32'; // Pointers are treated as 32-bit ints
|
2070
|
-
if (!value) return value;
|
2071
|
-
var bits, full;
|
2072
|
-
if (type[0] === 'i') {
|
2073
|
-
bits = parseInt(type.substr(1));
|
2074
|
-
full = op + 'Sign(' + value + ', ' + bits + ', ' + Math.floor(ignore || correctSpecificSign()) + ')';
|
2075
|
-
// Always sign/unsign constants at compile time, regardless of CHECK/CORRECT
|
2076
|
-
if (isNumber(value)) {
|
2077
|
-
return eval(full).toString();
|
2078
|
-
}
|
2079
|
-
}
|
2080
|
-
if ((ignore || !correctSigns()) && !CHECK_SIGNS && !force) return value;
|
2081
|
-
if (type[0] === 'i') {
|
2082
|
-
// this is an integer, but not a number (or we would have already handled it)
|
2083
|
-
// shortcuts
|
2084
|
-
if (!CHECK_SIGNS || ignore) {
|
2085
|
-
if (value === 'true') {
|
2086
|
-
value = '1';
|
2087
|
-
} else if (value === 'false') {
|
2088
|
-
value = '0';
|
2089
|
-
} else if (needsQuoting(value)) value = '(' + value + ')';
|
2090
|
-
if (bits === 32) {
|
2091
|
-
if (op === 're') {
|
2092
|
-
return '(' + value + '|0)';
|
2093
|
-
} else {
|
2094
|
-
return '(' + value + '>>>0)';
|
2095
|
-
}
|
2096
|
-
} else if (bits < 32) {
|
2097
|
-
if (op === 're') {
|
2098
|
-
return '((' + value + '<<' + (32-bits) + ')>>' + (32-bits) + ')';
|
2099
|
-
} else {
|
2100
|
-
return '(' + value + '&' + (Math.pow(2, bits)-1) + ')';
|
2101
|
-
}
|
2102
|
-
} else { // bits > 32
|
2103
|
-
if (op === 're') {
|
2104
|
-
return makeInlineCalculation('VALUE >= ' + Math.pow(2, bits-1) + ' ? VALUE-' + Math.pow(2, bits) + ' : VALUE', value, 'tempBigIntS');
|
2105
|
-
} else {
|
2106
|
-
return makeInlineCalculation('VALUE >= 0 ? VALUE : ' + Math.pow(2, bits) + '+VALUE', value, 'tempBigIntS');
|
2107
|
-
}
|
2108
|
-
}
|
2109
|
-
}
|
2110
|
-
return full;
|
2111
|
-
}
|
2112
|
-
return value;
|
2113
|
-
}
|
2114
|
-
|
2115
|
-
// @param floatConversion Means that we are receiving a float and rounding it to
|
2116
|
-
// an integer. We must be careful here, the input has *not*
|
2117
|
-
// already been converted to a signed/unsigned value (that
|
2118
|
-
// would already do rounding, before us!)
|
2119
|
-
function makeRounding(value, bits, signed, floatConversion) {
|
2120
|
-
// TODO: handle roundings of i64s
|
2121
|
-
assert(bits);
|
2122
|
-
if (!ASM_JS) {
|
2123
|
-
// C rounds to 0 (-5.5 to -5, +5.5 to 5), while JS has no direct way to do that.
|
2124
|
-
if (bits <= 32 && signed) return '((' + value + ')&-1)'; // This is fast and even correct, for all cases. Note that it is the same
|
2125
|
-
// as |0, but &-1 hints to the js optimizer that this is a rounding correction
|
2126
|
-
// Do Math.floor, which is reasonably fast, if we either don't care, or if we can be sure
|
2127
|
-
// the value is non-negative
|
2128
|
-
if (!correctRoundings() || (!signed && !floatConversion)) return 'Math_floor(' + value + ')';
|
2129
|
-
// We are left with >32 bits signed, or a float conversion. Check and correct inline
|
2130
|
-
// Note that if converting a float, we may have the wrong sign at this point! But, we have
|
2131
|
-
// been rounded properly regardless, and we will be sign-corrected later when actually used, if
|
2132
|
-
// necessary.
|
2133
|
-
return makeInlineCalculation(makeComparison('VALUE', '>=', '0', 'float') + ' ? Math_floor(VALUE) : Math_ceil(VALUE)', value, 'tempBigIntR');
|
2134
|
-
} else {
|
2135
|
-
// asm.js mode, cleaner refactoring of this function as well. TODO: use in non-asm case, most of this
|
2136
|
-
if (floatConversion && bits <= 32) {
|
2137
|
-
return '(~~(' + value + '))'; // explicit float-to-int conversion
|
2138
|
-
}
|
2139
|
-
|
2140
|
-
if (bits <= 32) {
|
2141
|
-
if (signed) {
|
2142
|
-
return '((' + value + ')&-1)'; // &-1 (instead of |0) hints to the js optimizer that this is a rounding correction
|
2143
|
-
} else {
|
2144
|
-
return '((' + value + ')>>>0)';
|
2145
|
-
}
|
2146
|
-
}
|
2147
|
-
// Math.floor is reasonably fast if we don't care about corrections (and even correct if unsigned)
|
2148
|
-
if (!correctRoundings() || !signed) return 'Math_floor(' + value + ')';
|
2149
|
-
// We are left with >32 bits
|
2150
|
-
return makeInlineCalculation(makeComparison('VALUE', '>=', '0', 'float') + ' ? Math_floor(VALUE) : Math_ceil(VALUE)', value, 'tempBigIntR');
|
2151
|
-
}
|
2152
|
-
}
|
2153
|
-
|
2154
|
-
function makeIsNaN(value, type) {
|
2155
|
-
if (ASM_JS) return makeInlineCalculation('((VALUE) != (VALUE))', value, type === 'float' ? 'tempFloat' : 'tempDouble');
|
2156
|
-
return 'isNaN(' + value + ')';
|
2157
|
-
}
|
2158
|
-
|
2159
|
-
function makeFloat(value, type) {
|
2160
|
-
if (PRECISE_F32 && type == 'float') {
|
2161
|
-
return 'Math_fround(' + value + ')';
|
2162
|
-
}
|
2163
|
-
return value;
|
2164
|
-
}
|
2165
|
-
|
2166
|
-
// fptoui and fptosi are not in these, because we need to be careful about what we do there. We can't
|
2167
|
-
// just sign/unsign the input first.
|
2168
|
-
var UNSIGNED_OP = set('udiv', 'urem', 'uitofp', 'zext', 'lshr');
|
2169
|
-
var SIGNED_OP = set('sdiv', 'srem', 'sitofp', 'sext', 'ashr');
|
2170
|
-
|
2171
|
-
function isUnsignedOp(op, variant) {
|
2172
|
-
return op in UNSIGNED_OP || (variant && variant[0] == 'u');
|
2173
|
-
}
|
2174
|
-
function isSignedOp(op, variant) {
|
2175
|
-
return op in SIGNED_OP || (variant && variant[0] == 's');
|
2176
|
-
}
|
2177
|
-
|
2178
|
-
var legalizedI64s = USE_TYPED_ARRAYS == 2; // We do not legalize globals, but do legalize function lines. This will be true in the latter case
|
2179
|
-
|
2180
|
-
function processMathop(item) {
|
2181
|
-
var op = item.op;
|
2182
|
-
var variant = item.variant;
|
2183
|
-
var type = item.type;
|
2184
|
-
var paramTypes = ['', '', '', ''];
|
2185
|
-
var idents = [];
|
2186
|
-
for (var i = 0; i < 3; i++) {
|
2187
|
-
if (item.params[i]) {
|
2188
|
-
paramTypes[i] = item.params[i].type || type;
|
2189
|
-
idents[i] = finalizeLLVMParameter(item.params[i]);
|
2190
|
-
if (needsQuoting(idents[i])) {
|
2191
|
-
idents[i] = '(' + idents[i] + ')'; // we may have nested expressions. So enforce the order of operations we want
|
2192
|
-
}
|
2193
|
-
} else {
|
2194
|
-
idents[i] = null; // just so it exists for purposes of reading idents[1] etc. later on, and no exception is thrown
|
2195
|
-
}
|
2196
|
-
}
|
2197
|
-
var originalIdents = idents.slice(0);
|
2198
|
-
if (isUnsignedOp(op, variant)) {
|
2199
|
-
idents[0] = makeSignOp(idents[0], paramTypes[0], 'un');
|
2200
|
-
idents[1] = makeSignOp(idents[1], paramTypes[1], 'un');
|
2201
|
-
} else if (isSignedOp(op, variant)) {
|
2202
|
-
idents[0] = makeSignOp(idents[0], paramTypes[0], 're');
|
2203
|
-
idents[1] = makeSignOp(idents[1], paramTypes[1], 're');
|
2204
|
-
}
|
2205
|
-
var bits = null;
|
2206
|
-
if (item.type[0] === 'i') {
|
2207
|
-
bits = parseInt(item.type.substr(1));
|
2208
|
-
}
|
2209
|
-
var bitsBefore = parseInt((item.params[0] ? item.params[0].type : item.type).substr(1)); // remove i to leave the number of bits left after this
|
2210
|
-
var bitsLeft = parseInt(((item.params[1] && item.params[1].ident) ? item.params[1].ident : item.type).substr(1)); // remove i to leave the number of bits left after this operation
|
2211
|
-
var rawBits = getBits(item.type);
|
2212
|
-
assert(rawBits <= 64);
|
2213
|
-
|
2214
|
-
function integerizeBignum(value) {
|
2215
|
-
return makeInlineCalculation('VALUE-VALUE%1', value, 'tempBigIntI');
|
2216
|
-
}
|
2217
|
-
|
2218
|
-
if ((type == 'i64' || paramTypes[0] == 'i64' || paramTypes[1] == 'i64' || idents[1] == '(i64)' || rawBits > 32) && USE_TYPED_ARRAYS == 2) {
|
2219
|
-
// this code assumes i64 for the most part
|
2220
|
-
if (ASSERTIONS && rawBits > 1 && rawBits < 64) {
|
2221
|
-
warnOnce('processMathop processing illegal non-i64 value');
|
2222
|
-
if (VERBOSE) printErr([op, item.type, rawBits, type, paramTypes, idents]);
|
2223
|
-
}
|
2224
|
-
|
2225
|
-
var warnI64_1 = function() {
|
2226
|
-
warnOnce('Arithmetic on 64-bit integers in mode 1 is rounded and flaky, like mode 0!');
|
2227
|
-
};
|
2228
|
-
// In ops that can be either legalized or not, we need to differentiate how we access low and high parts
|
2229
|
-
var low1 = idents[0] + (legalizedI64s ? '$0' : '[0]');
|
2230
|
-
var high1 = idents[0] + (legalizedI64s ? '$1' : '[1]');
|
2231
|
-
var low2 = idents[1] + (legalizedI64s ? '$0' : '[0]');
|
2232
|
-
var high2 = idents[1] + (legalizedI64s ? '$1' : '[1]');
|
2233
|
-
function finish(result) {
|
2234
|
-
// If this is in legalization mode, steal the assign and assign into two vars
|
2235
|
-
if (legalizedI64s) {
|
2236
|
-
assert(item.assignTo);
|
2237
|
-
if (ASM_JS) {
|
2238
|
-
var ret = item.assignTo + '$0=' + result[0] + ';' + item.assignTo + '$1=' + result[1] + ';';
|
2239
|
-
addVariable(item.assignTo + '$0', 'i32');
|
2240
|
-
addVariable(item.assignTo + '$1', 'i32');
|
2241
|
-
} else {
|
2242
|
-
var ret = 'var ' + item.assignTo + '$0=' + result[0] + ';var ' + item.assignTo + '$1=' + result[1] + ';';
|
2243
|
-
}
|
2244
|
-
item.assignTo = null;
|
2245
|
-
return ret;
|
2246
|
-
} else {
|
2247
|
-
return result;
|
2248
|
-
}
|
2249
|
-
}
|
2250
|
-
function i64PreciseOp(type, lastArg) {
|
2251
|
-
Types.preciseI64MathUsed = true;
|
2252
|
-
return finish(['(i64Math' + (ASM_JS ? '_' : '.') + type + '(' + asmCoercion(low1, 'i32') + ',' + asmCoercion(high1, 'i32') + ',' + asmCoercion(low2, 'i32') + ',' + asmCoercion(high2, 'i32') +
|
2253
|
-
(lastArg ? ',' + asmCoercion(+lastArg, 'i32') : '') + '),' + makeGetValue('tempDoublePtr', 0, 'i32') + ')', makeGetValue('tempDoublePtr', Runtime.getNativeTypeSize('i32'), 'i32')]);
|
2254
|
-
}
|
2255
|
-
function preciseCall(name) {
|
2256
|
-
Types.preciseI64MathUsed = true;
|
2257
|
-
return finish([asmCoercion(name + '(' + low1 + ',' + high1 + ',' + low2 + ',' + high2 + ')', 'i32'), 'tempRet0']);
|
2258
|
-
}
|
2259
|
-
function i64PreciseLib(type) {
|
2260
|
-
return preciseCall('_i64' + type[0].toUpperCase() + type.substr(1));
|
2261
|
-
}
|
2262
|
-
switch (op) {
|
2263
|
-
// basic integer ops
|
2264
|
-
case 'or': {
|
2265
|
-
return '[' + idents[0] + '[0] | ' + idents[1] + '[0], ' + idents[0] + '[1] | ' + idents[1] + '[1]]';
|
2266
|
-
}
|
2267
|
-
case 'and': {
|
2268
|
-
return '[' + idents[0] + '[0] & ' + idents[1] + '[0], ' + idents[0] + '[1] & ' + idents[1] + '[1]]';
|
2269
|
-
}
|
2270
|
-
case 'xor': {
|
2271
|
-
return '[' + idents[0] + '[0] ^ ' + idents[1] + '[0], ' + idents[0] + '[1] ^ ' + idents[1] + '[1]]';
|
2272
|
-
}
|
2273
|
-
case 'shl':
|
2274
|
-
case 'ashr':
|
2275
|
-
case 'lshr': {
|
2276
|
-
throw 'shifts should have been legalized!';
|
2277
|
-
}
|
2278
|
-
case 'uitofp': case 'sitofp': return makeFloat(RuntimeGenerator.makeBigInt(low1, high1, op[0] == 'u'), item.type);
|
2279
|
-
case 'fptoui': case 'fptosi': return finish(splitI64(asmCoercion(idents[0], 'double'), true)); // coerce to double before conversion to i64
|
2280
|
-
case 'icmp': {
|
2281
|
-
switch (variant) {
|
2282
|
-
case 'uge': return '((' + high1 + '>>>0) >= (' + high2 + '>>>0)) & ((((' + high1 + '>>>0) > (' + high2 + '>>>0)) | ' +
|
2283
|
-
'(' + low1 + '>>>0) >= (' + low2 + '>>>0)))';
|
2284
|
-
case 'sge': return '((' + high1 + '|0) >= (' + high2 + '|0)) & ((((' + high1 + '|0) > (' + high2 + '|0)) | ' +
|
2285
|
-
'(' + low1 + '>>>0) >= (' + low2 + '>>>0)))';
|
2286
|
-
case 'ule': return '((' + high1 + '>>>0) <= (' + high2 + '>>>0)) & ((((' + high1 + '>>>0) < (' + high2 + '>>>0)) | ' +
|
2287
|
-
'(' + low1 + '>>>0) <= (' + low2 + '>>>0)))';
|
2288
|
-
case 'sle': return '((' + high1 + '|0) <= (' + high2 + '|0)) & ((((' + high1 + '|0) < (' + high2 + '|0)) | ' +
|
2289
|
-
'(' + low1 + '>>>0) <= (' + low2 + '>>>0)))';
|
2290
|
-
case 'ugt': return '((' + high1 + '>>>0) > (' + high2 + '>>>0)) | ((((' + high1 + '>>>0) == (' + high2 + '>>>0) & ' +
|
2291
|
-
'(' + low1 + '>>>0) > (' + low2 + '>>>0))))';
|
2292
|
-
case 'sgt': return '((' + high1 + '|0) > (' + high2 + '|0)) | ((((' + high1 + '|0) == (' + high2 + '|0) & ' +
|
2293
|
-
'(' + low1 + '>>>0) > (' + low2 + '>>>0))))';
|
2294
|
-
case 'ult': return '((' + high1 + '>>>0) < (' + high2 + '>>>0)) | ((((' + high1 + '>>>0) == (' + high2 + '>>>0) & ' +
|
2295
|
-
'(' + low1 + '>>>0) < (' + low2 + '>>>0))))';
|
2296
|
-
case 'slt': return '((' + high1 + '|0) < (' + high2 + '|0)) | ((((' + high1 + '|0) == (' + high2 + '|0) & ' +
|
2297
|
-
'(' + low1 + '>>>0) < (' + low2 + '>>>0))))';
|
2298
|
-
case 'ne': return '((' + low1 + '|0) != (' + low2 + '|0)) | ((' + high1 + '|0) != (' + high2 + '|0))';
|
2299
|
-
case 'eq': return '((' + low1 + '|0) == (' + low2 + '|0)) & ((' + high1 + '|0) == (' + high2 + '|0))';
|
2300
|
-
default: throw 'Unknown icmp variant: ' + variant;
|
2301
|
-
}
|
2302
|
-
}
|
2303
|
-
case 'zext': return makeI64(idents[0], 0);
|
2304
|
-
case 'sext': return makeInlineCalculation(makeI64('VALUE', 'VALUE<0 ? 4294967295 : 0'), idents[0], 'tempBigIntD');
|
2305
|
-
case 'trunc': {
|
2306
|
-
return '((' + idents[0] + '[0]) & ' + (Math.pow(2, bitsLeft)-1) + ')';
|
2307
|
-
}
|
2308
|
-
case 'select': return '(' + idents[0] + ' ? ' + makeCopyI64(idents[1]) + ' : ' + makeCopyI64(idents[2]) + ')';;
|
2309
|
-
case 'ptrtoint': return makeI64(idents[0], 0);
|
2310
|
-
case 'inttoptr': {
|
2311
|
-
var m = /\(?\[(\d+),\d+\]\)?/.exec(idents[0]);
|
2312
|
-
if (m) return m[1]; // constant, can just parse it right now
|
2313
|
-
return '(' + idents[0] + '[0])'; // just directly truncate the i64 to a 'pointer', which is an i32
|
2314
|
-
}
|
2315
|
-
// Dangerous, rounded operations. TODO: Fully emulate
|
2316
|
-
case 'add': {
|
2317
|
-
if (PRECISE_I64_MATH) {
|
2318
|
-
return i64PreciseLib('add');
|
2319
|
-
} else {
|
2320
|
-
warnI64_1();
|
2321
|
-
return finish(splitI64(mergeI64(idents[0]) + '+' + mergeI64(idents[1]), true));
|
2322
|
-
}
|
2323
|
-
}
|
2324
|
-
case 'sub': {
|
2325
|
-
if (PRECISE_I64_MATH) {
|
2326
|
-
return i64PreciseLib('subtract');
|
2327
|
-
} else {
|
2328
|
-
warnI64_1();
|
2329
|
-
return finish(splitI64(mergeI64(idents[0]) + '-' + mergeI64(idents[1]), true));
|
2330
|
-
}
|
2331
|
-
}
|
2332
|
-
case 'sdiv': case 'udiv': {
|
2333
|
-
if (PRECISE_I64_MATH) {
|
2334
|
-
return preciseCall(op[0] === 'u' ? '___udivdi3' : '___divdi3');
|
2335
|
-
} else {
|
2336
|
-
warnI64_1();
|
2337
|
-
return finish(splitI64(makeRounding(mergeI64(idents[0], op[0] === 'u') + '/' + mergeI64(idents[1], op[0] === 'u'), bits, op[0] === 's'), true));
|
2338
|
-
}
|
2339
|
-
}
|
2340
|
-
case 'mul': {
|
2341
|
-
if (PRECISE_I64_MATH) {
|
2342
|
-
return preciseCall('___muldi3');
|
2343
|
-
} else {
|
2344
|
-
warnI64_1();
|
2345
|
-
return finish(splitI64(mergeI64(idents[0], op[0] === 'u') + '*' + mergeI64(idents[1], op[0] === 'u'), true));
|
2346
|
-
}
|
2347
|
-
}
|
2348
|
-
case 'urem': case 'srem': {
|
2349
|
-
if (PRECISE_I64_MATH) {
|
2350
|
-
return preciseCall(op[0] === 'u' ? '___uremdi3' : '___remdi3');
|
2351
|
-
} else {
|
2352
|
-
warnI64_1();
|
2353
|
-
return finish(splitI64(mergeI64(idents[0], op[0] === 'u') + '%' + mergeI64(idents[1], op[0] === 'u'), true));
|
2354
|
-
}
|
2355
|
-
}
|
2356
|
-
case 'bitcast': {
|
2357
|
-
// Pointers are not 64-bit, so there is really only one possible type of bitcast here, int to float or vice versa
|
2358
|
-
assert(USE_TYPED_ARRAYS == 2, 'Can only bitcast ints <-> floats with typed arrays mode 2');
|
2359
|
-
var inType = item.params[0].type;
|
2360
|
-
var outType = item.type;
|
2361
|
-
if (inType in Runtime.INT_TYPES && outType in Runtime.FLOAT_TYPES) {
|
2362
|
-
if (legalizedI64s) {
|
2363
|
-
return '(' + makeSetTempDouble(0, 'i32', idents[0] + '$0') + ', ' + makeSetTempDouble(1, 'i32', idents[0] + '$1') + ', ' + makeGetTempDouble(0, 'double') + ')';
|
2364
|
-
} else {
|
2365
|
-
return makeInlineCalculation(makeSetTempDouble(0, 'i32', 'VALUE[0]') + ',' + makeSetTempDouble(1, 'i32', 'VALUE[1]') + ',' + makeGetTempDouble(0, 'double'), idents[0], 'tempI64');
|
2366
|
-
}
|
2367
|
-
} else if (inType in Runtime.FLOAT_TYPES && outType in Runtime.INT_TYPES) {
|
2368
|
-
if (legalizedI64s) {
|
2369
|
-
return makeSetTempDouble(0, 'double', idents[0]) + '; ' + finish([makeGetTempDouble(0, 'i32'), makeGetTempDouble(1, 'i32')]);
|
2370
|
-
} else {
|
2371
|
-
return '(' + makeSetTempDouble(0, 'double', idents[0]) + ',[' + makeGetTempDouble(0, 'i32') + ',' + makeGetTempDouble(1, 'i32') + '])';
|
2372
|
-
}
|
2373
|
-
} else {
|
2374
|
-
throw 'Invalid USE_TYPED_ARRAYS == 2 bitcast: ' + dump(item) + ' : ' + item.params[0].type;
|
2375
|
-
}
|
2376
|
-
}
|
2377
|
-
default: throw 'Unsupported i64 mode 1 op: ' + item.op + ' : ' + dump(item);
|
2378
|
-
}
|
2379
|
-
}
|
2380
|
-
|
2381
|
-
if (type[0] === '<' && type[type.length-1] !== '*') {
|
2382
|
-
// vector/SIMD operation
|
2383
|
-
Types.usesSIMD = true;
|
2384
|
-
switch (op) {
|
2385
|
-
case 'fadd': return 'SIMD.float32x4.add(' + idents[0] + ',' + idents[1] + ')';
|
2386
|
-
case 'fsub': return 'SIMD.float32x4.sub(' + idents[0] + ',' + idents[1] + ')';
|
2387
|
-
case 'fmul': return 'SIMD.float32x4.mul(' + idents[0] + ',' + idents[1] + ')';
|
2388
|
-
case 'fdiv': return 'SIMD.float32x4.div(' + idents[0] + ',' + idents[1] + ')';
|
2389
|
-
case 'add' : return 'SIMD.int32x4.add(' + idents[0] + ',' + idents[1] + ')';
|
2390
|
-
case 'sub' : return 'SIMD.int32x4.sub(' + idents[0] + ',' + idents[1] + ')';
|
2391
|
-
case 'mul' : return 'SIMD.int32x4.mul(' + idents[0] + ',' + idents[1] + ')';
|
2392
|
-
case 'bitcast': {
|
2393
|
-
var inType = item.params[0].type;
|
2394
|
-
var outType = item.type;
|
2395
|
-
if (inType === '<4 x float>') {
|
2396
|
-
assert(outType === '<4 x i32>');
|
2397
|
-
return 'SIMD.float32x4.bitsToInt32x4(' + idents[0] + ')';
|
2398
|
-
} else {
|
2399
|
-
assert(inType === '<4 x i32>');
|
2400
|
-
assert(outType === '<4 x float>');
|
2401
|
-
return 'SIMD.int32x4.bitsToFloat32x4(' + idents[0] + ')';
|
2402
|
-
}
|
2403
|
-
}
|
2404
|
-
case 'and': return 'SIMD.int32x4.and(' + idents[0] + ',' + idents[1] + ')';
|
2405
|
-
case 'or': return 'SIMD.int32x4.or(' + idents[0] + ',' + idents[1] + ')';
|
2406
|
-
case 'xor': return 'SIMD.int32x4.xor(' + idents[0] + ',' + idents[1] + ')';
|
2407
|
-
default: throw 'vector op todo: ' + dump(item);
|
2408
|
-
}
|
2409
|
-
}
|
2410
|
-
|
2411
|
-
switch (op) {
|
2412
|
-
// basic integer ops
|
2413
|
-
case 'add': return handleOverflow(getFastValue(idents[0], '+', idents[1], item.type), bits);
|
2414
|
-
case 'sub': return handleOverflow(getFastValue(idents[0], '-', idents[1], item.type), bits);
|
2415
|
-
case 'sdiv': case 'udiv': return makeRounding(getFastValue(idents[0], '/', idents[1], item.type), bits, true);
|
2416
|
-
case 'mul': return getFastValue(idents[0], '*', idents[1], item.type); // overflow handling is already done in getFastValue for '*'
|
2417
|
-
case 'urem': case 'srem': return makeRounding(getFastValue(idents[0], '%', idents[1], item.type), bits, true);
|
2418
|
-
case 'or': {
|
2419
|
-
if (bits > 32) {
|
2420
|
-
assert(bits === 64, 'Too many bits for or: ' + bits);
|
2421
|
-
dprint('Warning: 64 bit OR - precision limit may be hit on llvm line ' + item.lineNum);
|
2422
|
-
return 'Runtime.or64(' + idents[0] + ', ' + idents[1] + ')';
|
2423
|
-
}
|
2424
|
-
return idents[0] + '|' + idents[1];
|
2425
|
-
}
|
2426
|
-
case 'and': {
|
2427
|
-
if (bits > 32) {
|
2428
|
-
assert(bits === 64, 'Too many bits for and: ' + bits);
|
2429
|
-
dprint('Warning: 64 bit AND - precision limit may be hit on llvm line ' + item.lineNum);
|
2430
|
-
return 'Runtime.and64(' + idents[0] + ', ' + idents[1] + ')';
|
2431
|
-
}
|
2432
|
-
return idents[0] + '&' + idents[1];
|
2433
|
-
}
|
2434
|
-
case 'xor': {
|
2435
|
-
if (bits > 32) {
|
2436
|
-
assert(bits === 64, 'Too many bits for xor: ' + bits);
|
2437
|
-
dprint('Warning: 64 bit XOR - precision limit may be hit on llvm line ' + item.lineNum);
|
2438
|
-
return 'Runtime.xor64(' + idents[0] + ', ' + idents[1] + ')';
|
2439
|
-
}
|
2440
|
-
return idents[0] + '^' + idents[1];
|
2441
|
-
}
|
2442
|
-
case 'shl': {
|
2443
|
-
if (bits > 32) return idents[0] + '*' + getFastValue(2, 'pow', idents[1]);
|
2444
|
-
return idents[0] + '<<' + idents[1];
|
2445
|
-
}
|
2446
|
-
case 'ashr': {
|
2447
|
-
if (bits > 32) return integerizeBignum(idents[0] + '/' + getFastValue(2, 'pow', idents[1]));
|
2448
|
-
if (bits === 32) return originalIdents[0] + '>>' + idents[1]; // No need to reSign in this case
|
2449
|
-
return idents[0] + '>>' + idents[1];
|
2450
|
-
}
|
2451
|
-
case 'lshr': {
|
2452
|
-
if (bits > 32) return integerizeBignum(idents[0] + '/' + getFastValue(2, 'pow', idents[1]));
|
2453
|
-
if (bits === 32) return originalIdents[0] + '>>>' + idents[1]; // No need to unSign in this case
|
2454
|
-
return idents[0] + '>>>' + idents[1];
|
2455
|
-
}
|
2456
|
-
// basic float ops
|
2457
|
-
case 'fadd': return makeFloat(getFastValue(idents[0], '+', idents[1], item.type), item.type);
|
2458
|
-
case 'fsub': return makeFloat(getFastValue(idents[0], '-', idents[1], item.type), item.type);
|
2459
|
-
case 'fdiv': return makeFloat(getFastValue(idents[0], '/', idents[1], item.type), item.type);
|
2460
|
-
case 'fmul': return makeFloat(getFastValue(idents[0], '*', idents[1], item.type), item.type);
|
2461
|
-
case 'frem': return makeFloat(getFastValue(idents[0], '%', idents[1], item.type), item.type);
|
2462
|
-
case 'uitofp': case 'sitofp': return asmCoercion(idents[0], item.type, op[0]);
|
2463
|
-
case 'fptoui': case 'fptosi': return makeRounding(idents[0], bitsLeft, op === 'fptosi', true);
|
2464
|
-
|
2465
|
-
// TODO: We sometimes generate false instead of 0, etc., in the *cmps. It seemed slightly faster before, but worth rechecking
|
2466
|
-
// Note that with typed arrays, these become 0 when written. So that is a potential difference with non-typed array runs.
|
2467
|
-
case 'icmp': {
|
2468
|
-
// unsigned coercions can be (X&Y), which is not a valid asm coercion for comparisons
|
2469
|
-
if (ASM_JS && variant[0] === 'u') {
|
2470
|
-
if (idents[0].indexOf('>>>') < 0) idents[0] = '((' + idents[0] + ')>>>0)';
|
2471
|
-
if (idents[1].indexOf('>>>') < 0) idents[1] = '((' + idents[1] + ')>>>0)';
|
2472
|
-
}
|
2473
|
-
switch (variant) {
|
2474
|
-
case 'uge': case 'sge': return idents[0] + '>=' + idents[1];
|
2475
|
-
case 'ule': case 'sle': return idents[0] + '<=' + idents[1];
|
2476
|
-
case 'ugt': case 'sgt': return idents[0] + '>' + idents[1];
|
2477
|
-
case 'ult': case 'slt': return idents[0] + '<' + idents[1];
|
2478
|
-
// We use loose comparisons, which allows false == 0 to be true, etc. Ditto in fcmp
|
2479
|
-
case 'ne': case 'eq': {
|
2480
|
-
// We must sign them, so we do not compare -1 to 255 (could have unsigned them both too)
|
2481
|
-
// since LLVM tells us if <=, >= etc. comparisons are signed, but not == and !=.
|
2482
|
-
idents[0] = makeSignOp(idents[0], paramTypes[0], 're');
|
2483
|
-
idents[1] = makeSignOp(idents[1], paramTypes[1], 're');
|
2484
|
-
return idents[0] + (variant === 'eq' ? '==' : '!=') + idents[1];
|
2485
|
-
}
|
2486
|
-
default: throw 'Unknown icmp variant: ' + variant;
|
2487
|
-
}
|
2488
|
-
}
|
2489
|
-
case 'fcmp': {
|
2490
|
-
switch (variant) {
|
2491
|
-
// TODO 'o' ones should be 'ordered (no NaN) and',
|
2492
|
-
// 'u' ones should be 'unordered or'.
|
2493
|
-
case 'uge': case 'oge': return idents[0] + '>=' + idents[1];
|
2494
|
-
case 'ule': case 'ole': return idents[0] + '<=' + idents[1];
|
2495
|
-
case 'ugt': case 'ogt': return idents[0] + '>' + idents[1];
|
2496
|
-
case 'ult': case 'olt': return idents[0] + '<' + idents[1];
|
2497
|
-
case 'une': case 'one': return idents[0] + '!=' + idents[1];
|
2498
|
-
case 'ueq': case 'oeq': return idents[0] + '==' + idents[1];
|
2499
|
-
case 'ord': return '!' + makeIsNaN(idents[0], paramTypes[0]) + '&!' + makeIsNaN(idents[1], paramTypes[0]);
|
2500
|
-
case 'uno': return makeIsNaN(idents[0], paramTypes[0]) + '|' + makeIsNaN(idents[1], paramTypes[0]);
|
2501
|
-
case 'true': return '1';
|
2502
|
-
default: throw 'Unknown fcmp variant: ' + variant;
|
2503
|
-
}
|
2504
|
-
}
|
2505
|
-
// Note that zext has sign checking, see above. We must guard against -33 in i8 turning into -33 in i32
|
2506
|
-
// then unsigning that i32... which would give something huge.
|
2507
|
-
case 'zext': {
|
2508
|
-
if (EXPLICIT_ZEXT && bitsBefore == 1 && bitsLeft > 1) {
|
2509
|
-
return '(' + originalIdents[0] + '?1:0)'; // explicit bool-to-int conversion, work around v8 issue 2513
|
2510
|
-
break;
|
2511
|
-
}
|
2512
|
-
// otherwise, fall through
|
2513
|
-
}
|
2514
|
-
case 'sext': return idents[0];
|
2515
|
-
case 'fpext': {
|
2516
|
-
if (PRECISE_F32) return '+(' + idents[0] + ')';
|
2517
|
-
return idents[0];
|
2518
|
-
}
|
2519
|
-
case 'fptrunc': {
|
2520
|
-
if (PRECISE_F32) return 'Math_fround(' + idents[0] + ')';
|
2521
|
-
return idents[0];
|
2522
|
-
}
|
2523
|
-
case 'select': return '(' + idents[0] + '?' + asmEnsureFloat(idents[1], item.type) + ':' + asmEnsureFloat(idents[2], item.type) + ')';
|
2524
|
-
case 'ptrtoint': case 'inttoptr': {
|
2525
|
-
var ret = '';
|
2526
|
-
if (QUANTUM_SIZE == 1) {
|
2527
|
-
warnOnce('.ll contains ptrtoint and/or inttoptr. These may be dangerous in QUANTUM == 1. ' +
|
2528
|
-
'The safest thing is to investigate every appearance, and modify the source code to avoid this. ' +
|
2529
|
-
'Emscripten will print a list of the .ll lines, and also annotate the .js.');
|
2530
|
-
dprint(' ' + op + ' on .ll line ' + item.lineNum);
|
2531
|
-
idents[0] += ' /* Warning: ' + op + ', .ll line ' + item.lineNum + ' */';
|
2532
|
-
}
|
2533
|
-
if (op == 'inttoptr' || bitsLeft >= 32) return idents[0];
|
2534
|
-
// For ptrtoint and <32 bits, fall through into trunc since we need to truncate here
|
2535
|
-
}
|
2536
|
-
case 'trunc': {
|
2537
|
-
// Unlike extending, which we just 'do' (by doing nothing),
|
2538
|
-
// truncating can change the number, e.g. by truncating to an i1
|
2539
|
-
// in order to get the first bit
|
2540
|
-
assert(bitsLeft <= 32, 'Cannot truncate to more than 32 bits, since we use a native & op');
|
2541
|
-
return '((' + idents[0] + ')&' + (Math.pow(2, bitsLeft)-1) + ')';
|
2542
|
-
}
|
2543
|
-
case 'bitcast': {
|
2544
|
-
// Most bitcasts are no-ops for us. However, the exception is int to float and float to int
|
2545
|
-
var inType = item.params[0].type;
|
2546
|
-
var outType = item.type;
|
2547
|
-
if ((inType in Runtime.INT_TYPES && outType in Runtime.FLOAT_TYPES) ||
|
2548
|
-
(inType in Runtime.FLOAT_TYPES && outType in Runtime.INT_TYPES)) {
|
2549
|
-
assert(USE_TYPED_ARRAYS == 2, 'Can only bitcast ints <-> floats with typed arrays mode 2');
|
2550
|
-
if (inType in Runtime.INT_TYPES) {
|
2551
|
-
return '(' + makeSetTempDouble(0, 'i32', idents[0]) + ',' + makeGetTempDouble(0, 'float') + ')';
|
2552
|
-
} else {
|
2553
|
-
return '(' + makeSetTempDouble(0, 'float', idents[0]) + ',' + makeGetTempDouble(0, 'i32') + ')';
|
2554
|
-
}
|
2555
|
-
}
|
2556
|
-
return idents[0];
|
2557
|
-
}
|
2558
|
-
default: throw 'Unknown mathcmp op: ' + item.op;
|
2559
|
-
}
|
2560
|
-
}
|
2561
|
-
|
2562
|
-
// Walks through some intertype data, calling a function at every item. If
|
2563
|
-
// the function returns true, will stop the walk.
|
2564
|
-
// TODO: Use this more in analyzer, possibly also in jsifier
|
2565
|
-
function walkInterdata(item, pre, post, obj) {
|
2566
|
-
if (!item || !item.intertype) return false;
|
2567
|
-
if (pre && pre(item, obj)) return true;
|
2568
|
-
var originalObj = obj;
|
2569
|
-
if (obj && obj.replaceWith) obj = obj.replaceWith; // allow pre to replace the object we pass to all its children
|
2570
|
-
if (item.value && walkInterdata(item.value, pre, post, obj)) return true;
|
2571
|
-
// TODO if (item.pointer && walkInterdata(item.pointer, pre, post, obj)) return true;
|
2572
|
-
if (item.dependent && walkInterdata(item.dependent, pre, post, obj)) return true;
|
2573
|
-
var i;
|
2574
|
-
if (item.params) {
|
2575
|
-
for (i = 0; i <= item.params.length; i++) {
|
2576
|
-
if (walkInterdata(item.params[i], pre, post, obj)) return true;
|
2577
|
-
}
|
2578
|
-
}
|
2579
|
-
return post && post(item, originalObj, obj);
|
2580
|
-
}
|
2581
|
-
|
2582
|
-
// Separate from walkInterdata so that the former is as fast as possible
|
2583
|
-
// If the callback returns a value, we replace the current item with that
|
2584
|
-
// value, and do *not* walk the children.
|
2585
|
-
function walkAndModifyInterdata(item, pre) {
|
2586
|
-
if (!item || !item.intertype) return false;
|
2587
|
-
var ret = pre(item);
|
2588
|
-
if (ret) return ret;
|
2589
|
-
var repl;
|
2590
|
-
if (item.value && (repl = walkAndModifyInterdata(item.value, pre))) item.value = repl;
|
2591
|
-
if (item.pointer && (repl = walkAndModifyInterdata(item.pointer, pre))) item.pointer = repl;
|
2592
|
-
if (item.dependent && (repl = walkAndModifyInterdata(item.dependent, pre))) item.dependent = repl;
|
2593
|
-
if (item.params) {
|
2594
|
-
for (var i = 0; i <= item.params.length; i++) {
|
2595
|
-
if (repl = walkAndModifyInterdata(item.params[i], pre)) item.params[i] = repl;
|
2596
|
-
}
|
2597
|
-
}
|
2598
|
-
}
|
2599
|
-
|
2600
|
-
function parseBlockAddress(segment) {
|
2601
|
-
return { intertype: 'blockaddress', func: toNiceIdent(segment[2].tokens[0].text), label: toNiceIdent(segment[2].tokens[2].text), type: 'i32' };
|
2602
|
-
}
|
2603
|
-
|
2604
|
-
function finalizeBlockAddress(param) {
|
2605
|
-
return '{{{ BA_' + param.func + '|' + param.label + ' }}}'; // something python will replace later
|
2606
|
-
}
|
2607
|
-
|
2608
|
-
function stripCorrections(param) {
|
2609
|
-
var m;
|
2610
|
-
while (true) {
|
2611
|
-
if (m = /^\((.*)\)$/.exec(param)) {
|
2612
|
-
param = m[1];
|
2613
|
-
continue;
|
2614
|
-
}
|
2615
|
-
if (m = /^\(([$_\w]+)\)&\d+$/.exec(param)) {
|
2616
|
-
param = m[1];
|
2617
|
-
continue;
|
2618
|
-
}
|
2619
|
-
if (m = /^\(([$_\w()]+)\)\|0$/.exec(param)) {
|
2620
|
-
param = m[1];
|
2621
|
-
continue;
|
2622
|
-
}
|
2623
|
-
if (m = /^\(([$_\w()]+)\)\>>>0$/.exec(param)) {
|
2624
|
-
param = m[1];
|
2625
|
-
continue;
|
2626
|
-
}
|
2627
|
-
if (m = /CHECK_OVERFLOW\(([^,)]*),.*/.exec(param)) {
|
2628
|
-
param = m[1];
|
2629
|
-
continue;
|
2630
|
-
}
|
2631
|
-
break;
|
2632
|
-
}
|
2633
|
-
return param;
|
2634
|
-
}
|
2635
|
-
|
2636
|
-
function getImplementationType(varInfo) {
|
2637
|
-
if (varInfo.impl == 'nativized') {
|
2638
|
-
return removePointing(varInfo.type);
|
2639
|
-
}
|
2640
|
-
return varInfo.type;
|
2641
|
-
}
|
2642
|
-
|
2643
|
-
function charCode(char) {
|
2644
|
-
return char.charCodeAt(0);
|
2645
|
-
}
|
2646
|
-
|
2647
|
-
function getTypeFromHeap(suffix) {
|
2648
|
-
switch (suffix) {
|
2649
|
-
case '8': return 'i8';
|
2650
|
-
case '16': return 'i16';
|
2651
|
-
case '32': return 'i32';
|
2652
|
-
case 'F32': return 'float';
|
2653
|
-
case 'F64': return 'double';
|
2654
|
-
default: throw 'getTypeFromHeap? ' + suffix;
|
2655
|
-
}
|
2656
|
-
}
|
2657
|
-
|
2658
|
-
// Generates code that prints without printf(), but just putchar (so can be directly inline in asm.js)
|
2659
|
-
function makePrintChars(s, sep) {
|
2660
|
-
sep = sep || ';';
|
2661
|
-
var ret = '';
|
2662
|
-
for (var i = 0; i < s.length; i++) {
|
2663
|
-
ret += '_putchar(' + s.charCodeAt(i) + ')' + sep;
|
2664
|
-
}
|
2665
|
-
ret += '_putchar(10)';
|
2666
|
-
return ret;
|
2667
|
-
}
|
2668
|
-
|
2669
|
-
function parseAlign(text) { // parse ", align \d+"
|
2670
|
-
if (!text) return QUANTUM_SIZE;
|
2671
|
-
return parseInt(text.substr(8));
|
2672
|
-
}
|
2673
|
-
|
2674
|
-
function deParen(text) {
|
2675
|
-
if (text[0] === '(') return text.substr(1, text.length-2);
|
2676
|
-
return text;
|
2677
|
-
}
|
2678
|
-
|
2679
|
-
function deParenCarefully(text) {
|
2680
|
-
if (text[0] === '(' && text.indexOf('(', 1) < 0 && text[text.length-1] === ')') return text.substr(1, text.length-2);
|
2681
|
-
return text;
|
2682
|
-
}
|
2683
|
-
|
2684
|
-
function addVariable(ident, type, funcData) {
|
2685
|
-
funcData = funcData || Framework.currItem.funcData;
|
2686
|
-
assert(type);
|
2687
|
-
var old = funcData.variables[ident];
|
2688
|
-
if (old) {
|
2689
|
-
assert(old.type === type);
|
2690
|
-
} else {
|
2691
|
-
funcData.variables[ident] = {
|
2692
|
-
ident: ident,
|
2693
|
-
type: type,
|
2694
|
-
origin: 'added',
|
2695
|
-
lineNum: 0,
|
2696
|
-
rawLinesIndex: 0,
|
2697
|
-
hasValueTaken: false,
|
2698
|
-
pointingLevels: 0,
|
2699
|
-
uses: 0,
|
2700
|
-
impl: VAR_EMULATED
|
2701
|
-
};
|
2702
|
-
}
|
2703
|
-
}
|
2704
|
-
|
2705
|
-
var SIMDLane = ['X', 'Y', 'Z', 'W'];
|
2706
|
-
var simdLane = ['x', 'y', 'z', 'w'];
|
2707
|
-
|
2708
|
-
function ensureVector(ident, base) {
|
2709
|
-
Types.usesSIMD = true;
|
2710
|
-
return ident == 0 ? base + '32x4.splat(0)' : ident;
|
2711
|
-
}
|
2712
|
-
|
2713
|
-
function ensureValidFFIType(type) {
|
2714
|
-
return type === 'float' ? 'double' : type; // ffi does not tolerate float XXX
|
2715
|
-
}
|
2716
|
-
|
2717
|
-
// FFI return values must arrive as doubles, and we can force them to floats afterwards
|
2718
|
-
function asmFFICoercion(value, type) {
|
2719
|
-
value = asmCoercion(value, ensureValidFFIType(type));
|
2720
|
-
if (PRECISE_F32 && type === 'float') value = asmCoercion(value, 'float');
|
2721
|
-
return value;
|
2722
|
-
}
|
2723
|
-
|