OLD | NEW |
1 // Modified embenchen to direct to asm-wasm. | 1 // Modified embenchen to direct to asm-wasm. |
2 // Flags: --expose-wasm | 2 // Flags: --expose-wasm |
3 | 3 |
4 var EXPECTED_OUTPUT = 'sizes: 100000,25906\nok.\n'; | 4 var EXPECTED_OUTPUT = 'sizes: 100000,25906\nok.\n'; |
5 var Module = { | 5 var Module = { |
6 arguments: [1], | 6 arguments: [1], |
7 print: function(x) {Module.printBuffer += x + '\n';}, | 7 print: function(x) {Module.printBuffer += x + '\n';}, |
8 preRun: [function() {Module.printBuffer = ''}], | 8 preRun: [function() {Module.printBuffer = ''}], |
9 postRun: [function() { | 9 postRun: [function() { |
10 assertEquals(EXPECTED_OUTPUT, Module.printBuffer); | 10 assertEquals(EXPECTED_OUTPUT, Module.printBuffer); |
(...skipping 5669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5680 } | 5680 } |
5681 } | 5681 } |
5682 | 5682 |
5683 function asmPrintInt(x, y) { | 5683 function asmPrintInt(x, y) { |
5684 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); | 5684 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); |
5685 } | 5685 } |
5686 function asmPrintFloat(x, y) { | 5686 function asmPrintFloat(x, y) { |
5687 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); | 5687 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); |
5688 } | 5688 } |
5689 // EMSCRIPTEN_START_ASM | 5689 // EMSCRIPTEN_START_ASM |
5690 var asm = _WASMEXP_.instantiateModuleFromAsm((function Module(global, env, buffe
r) { | 5690 var asm = Wasm.instantiateModuleFromAsm((function Module(global, env, buffer) { |
5691 'use asm'; | 5691 'use asm'; |
5692 var HEAP8 = new global.Int8Array(buffer); | 5692 var HEAP8 = new global.Int8Array(buffer); |
5693 var HEAP16 = new global.Int16Array(buffer); | 5693 var HEAP16 = new global.Int16Array(buffer); |
5694 var HEAP32 = new global.Int32Array(buffer); | 5694 var HEAP32 = new global.Int32Array(buffer); |
5695 var HEAPU8 = new global.Uint8Array(buffer); | 5695 var HEAPU8 = new global.Uint8Array(buffer); |
5696 var HEAPU16 = new global.Uint16Array(buffer); | 5696 var HEAPU16 = new global.Uint16Array(buffer); |
5697 var HEAPU32 = new global.Uint32Array(buffer); | 5697 var HEAPU32 = new global.Uint32Array(buffer); |
5698 var HEAPF32 = new global.Float32Array(buffer); | 5698 var HEAPF32 = new global.Float32Array(buffer); |
5699 var HEAPF64 = new global.Float64Array(buffer); | 5699 var HEAPF64 = new global.Float64Array(buffer); |
5700 | 5700 |
(...skipping 9045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14746 } | 14746 } |
14747 | 14747 |
14748 // shouldRunNow refers to calling main(), not run(). | 14748 // shouldRunNow refers to calling main(), not run(). |
14749 var shouldRunNow = true; | 14749 var shouldRunNow = true; |
14750 if (Module['noInitialRun']) { | 14750 if (Module['noInitialRun']) { |
14751 shouldRunNow = false; | 14751 shouldRunNow = false; |
14752 } | 14752 } |
14753 | 14753 |
14754 | 14754 |
14755 run([].concat(Module["arguments"])); | 14755 run([].concat(Module["arguments"])); |
OLD | NEW |