Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions lib/dispatcher/client-h1.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,27 @@
const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined

let mod
try {
mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js'))
} catch {
/* istanbul ignore next */

// We disable wasm SIMD on ppc64 as it seems to be broken on Power 9 architectures.
let useWasmSIMD = process.arch !== 'ppc64'

Check failure on line 70 in lib/dispatcher/client-h1.js

View workflow job for this annotation

GitHub Actions / Lint

Trailing spaces not allowed
Comment thread
Uzlopak marked this conversation as resolved.
Outdated
// The Env Variable UNDICI_NO_WASM_SIMD allows explicitly overriding the default behavior
if (process.env.UNDICI_NO_WASM_SIMD === '1') {
useWasmSIMD = true
} else if (process.env.UNDICI_NO_WASM_SIMD === '0') {

Check failure on line 74 in lib/dispatcher/client-h1.js

View workflow job for this annotation

GitHub Actions / Lint

Multiple spaces found before '('
Comment thread
Uzlopak marked this conversation as resolved.
Outdated
useWasmSIMD = false

Check failure on line 75 in lib/dispatcher/client-h1.js

View workflow job for this annotation

GitHub Actions / Lint

'useWasmSIMD' is assigned a value but never used
}

if (useSIMD) {

Check failure on line 78 in lib/dispatcher/client-h1.js

View workflow job for this annotation

GitHub Actions / Lint

'useSIMD' is not defined
Comment thread
Uzlopak marked this conversation as resolved.
Outdated
try {
mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js'))
/* istanbul ignore next */
} catch {
}
}

/* istanbul ignore next */
if (!mod) {
// We could check if the error was caused by the simd option not
// being enabled, but the occurring of this other error
// * https://github.com/emscripten-core/emscripten/issues/11495
Expand Down
Loading