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 = | 4 var EXPECTED_OUTPUT = |
5 /frame averages: .+ \+- .+, range: .+ to .+ \n/; | 5 /frame averages: .+ \+- .+, range: .+ to .+ \n/; |
6 var Module = { | 6 var Module = { |
7 arguments: [1], | 7 arguments: [1], |
8 print: function(x) {Module.printBuffer += x + '\n';}, | 8 print: function(x) {Module.printBuffer += x + '\n';}, |
9 preRun: [function() {Module.printBuffer = ''}], | 9 preRun: [function() {Module.printBuffer = ''}], |
10 postRun: [function() { | 10 postRun: [function() { |
(...skipping 6020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6031 } | 6031 } |
6032 } | 6032 } |
6033 | 6033 |
6034 function asmPrintInt(x, y) { | 6034 function asmPrintInt(x, y) { |
6035 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); | 6035 Module.print('int ' + x + ',' + y);// + ' ' + new Error().stack); |
6036 } | 6036 } |
6037 function asmPrintFloat(x, y) { | 6037 function asmPrintFloat(x, y) { |
6038 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); | 6038 Module.print('float ' + x + ',' + y);// + ' ' + new Error().stack); |
6039 } | 6039 } |
6040 // EMSCRIPTEN_START_ASM | 6040 // EMSCRIPTEN_START_ASM |
6041 var asm = _WASMEXP_.instantiateModuleFromAsm((function Module(global, env, buffe
r) { | 6041 var asm = Wasm.instantiateModuleFromAsm((function Module(global, env, buffer) { |
6042 'use asm'; | 6042 'use asm'; |
6043 var HEAP8 = new global.Int8Array(buffer); | 6043 var HEAP8 = new global.Int8Array(buffer); |
6044 var HEAP16 = new global.Int16Array(buffer); | 6044 var HEAP16 = new global.Int16Array(buffer); |
6045 var HEAP32 = new global.Int32Array(buffer); | 6045 var HEAP32 = new global.Int32Array(buffer); |
6046 var HEAPU8 = new global.Uint8Array(buffer); | 6046 var HEAPU8 = new global.Uint8Array(buffer); |
6047 var HEAPU16 = new global.Uint16Array(buffer); | 6047 var HEAPU16 = new global.Uint16Array(buffer); |
6048 var HEAPU32 = new global.Uint32Array(buffer); | 6048 var HEAPU32 = new global.Uint32Array(buffer); |
6049 var HEAPF32 = new global.Float32Array(buffer); | 6049 var HEAPF32 = new global.Float32Array(buffer); |
6050 var HEAPF64 = new global.Float64Array(buffer); | 6050 var HEAPF64 = new global.Float64Array(buffer); |
6051 | 6051 |
(...skipping 14264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20316 } | 20316 } |
20317 | 20317 |
20318 // shouldRunNow refers to calling main(), not run(). | 20318 // shouldRunNow refers to calling main(), not run(). |
20319 var shouldRunNow = true; | 20319 var shouldRunNow = true; |
20320 if (Module['noInitialRun']) { | 20320 if (Module['noInitialRun']) { |
20321 shouldRunNow = false; | 20321 shouldRunNow = false; |
20322 } | 20322 } |
20323 | 20323 |
20324 | 20324 |
20325 run([].concat(Module["arguments"])); | 20325 run([].concat(Module["arguments"])); |
OLD | NEW |