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