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 = 'final: 840.\n'; | 4 var EXPECTED_OUTPUT = 'final: 840.\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 5595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5606 | 5606 |
5607 | 5607 |
5608 var Math_min = Math.min; | 5608 var Math_min = Math.min; |
5609 function asmPrintInt(x, y) { | 5609 function asmPrintInt(x, y) { |
5610 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); | 5610 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); |
5611 } | 5611 } |
5612 function asmPrintFloat(x, y) { | 5612 function asmPrintFloat(x, y) { |
5613 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); | 5613 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); |
5614 } | 5614 } |
5615 // EMSCRIPTEN_START_ASM | 5615 // EMSCRIPTEN_START_ASM |
5616 var asm = _WASMEXP_.instantiateModuleFromAsm((function Module(global, env, buffe
r) { | 5616 var asm = Wasm.instantiateModuleFromAsm((function Module(global, env, buffer) { |
5617 'use asm'; | 5617 'use asm'; |
5618 var HEAP8 = new global.Int8Array(buffer); | 5618 var HEAP8 = new global.Int8Array(buffer); |
5619 var HEAP16 = new global.Int16Array(buffer); | 5619 var HEAP16 = new global.Int16Array(buffer); |
5620 var HEAP32 = new global.Int32Array(buffer); | 5620 var HEAP32 = new global.Int32Array(buffer); |
5621 var HEAPU8 = new global.Uint8Array(buffer); | 5621 var HEAPU8 = new global.Uint8Array(buffer); |
5622 var HEAPU16 = new global.Uint16Array(buffer); | 5622 var HEAPU16 = new global.Uint16Array(buffer); |
5623 var HEAPU32 = new global.Uint32Array(buffer); | 5623 var HEAPU32 = new global.Uint32Array(buffer); |
5624 var HEAPF32 = new global.Float32Array(buffer); | 5624 var HEAPF32 = new global.Float32Array(buffer); |
5625 var HEAPF64 = new global.Float64Array(buffer); | 5625 var HEAPF64 = new global.Float64Array(buffer); |
5626 | 5626 |
(...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8081 } | 8081 } |
8082 | 8082 |
8083 // shouldRunNow refers to calling main(), not run(). | 8083 // shouldRunNow refers to calling main(), not run(). |
8084 var shouldRunNow = true; | 8084 var shouldRunNow = true; |
8085 if (Module['noInitialRun']) { | 8085 if (Module['noInitialRun']) { |
8086 shouldRunNow = false; | 8086 shouldRunNow = false; |
8087 } | 8087 } |
8088 | 8088 |
8089 | 8089 |
8090 run([].concat(Module["arguments"])); | 8090 run([].concat(Module["arguments"])); |
OLD | NEW |