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: 40006013:58243.\n'; | 4 var EXPECTED_OUTPUT = 'final: 40006013:58243.\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 5434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5445 | 5445 |
5446 | 5446 |
5447 var Math_min = Math.min; | 5447 var Math_min = Math.min; |
5448 function asmPrintInt(x, y) { | 5448 function asmPrintInt(x, y) { |
5449 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); | 5449 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); |
5450 } | 5450 } |
5451 function asmPrintFloat(x, y) { | 5451 function asmPrintFloat(x, y) { |
5452 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); | 5452 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); |
5453 } | 5453 } |
5454 // EMSCRIPTEN_START_ASM | 5454 // EMSCRIPTEN_START_ASM |
5455 var asm = _WASMEXP_.instantiateModuleFromAsm((function Module(global, env, buffe
r) { | 5455 var asm = Wasm.instantiateModuleFromAsm((function Module(global, env, buffer) { |
5456 'use asm'; | 5456 'use asm'; |
5457 var HEAP8 = new global.Int8Array(buffer); | 5457 var HEAP8 = new global.Int8Array(buffer); |
5458 var HEAP16 = new global.Int16Array(buffer); | 5458 var HEAP16 = new global.Int16Array(buffer); |
5459 var HEAP32 = new global.Int32Array(buffer); | 5459 var HEAP32 = new global.Int32Array(buffer); |
5460 var HEAPU8 = new global.Uint8Array(buffer); | 5460 var HEAPU8 = new global.Uint8Array(buffer); |
5461 var HEAPU16 = new global.Uint16Array(buffer); | 5461 var HEAPU16 = new global.Uint16Array(buffer); |
5462 var HEAPU32 = new global.Uint32Array(buffer); | 5462 var HEAPU32 = new global.Uint32Array(buffer); |
5463 var HEAPF32 = new global.Float32Array(buffer); | 5463 var HEAPF32 = new global.Float32Array(buffer); |
5464 var HEAPF64 = new global.Float64Array(buffer); | 5464 var HEAPF64 = new global.Float64Array(buffer); |
5465 | 5465 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5977 } | 5977 } |
5978 | 5978 |
5979 // shouldRunNow refers to calling main(), not run(). | 5979 // shouldRunNow refers to calling main(), not run(). |
5980 var shouldRunNow = true; | 5980 var shouldRunNow = true; |
5981 if (Module['noInitialRun']) { | 5981 if (Module['noInitialRun']) { |
5982 shouldRunNow = false; | 5982 shouldRunNow = false; |
5983 } | 5983 } |
5984 | 5984 |
5985 | 5985 |
5986 run([].concat(Module["arguments"])); | 5986 run([].concat(Module["arguments"])); |
OLD | NEW |