Skip to content

Commit

Permalink
chore: remove no-simd wasm of llhttp
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Feb 28, 2024
1 parent 5600aa1 commit a596585
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 27 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# The wasm files are stored as base64 strings in the corresponding .js files
lib/llhttp/llhttp_simd.wasm
lib/llhttp/llhttp.wasm

!types/**/*
!index.d.ts
Expand Down
9 changes: 0 additions & 9 deletions build/wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ module.exports = fs.readFileSync(require.resolve('./${basename(path)}'))
`)
}

// Build wasm binary
execSync(`${WASM_CC} ${WASM_CFLAGS} ${WASM_LDFLAGS} \
${join(WASM_SRC, 'src')}/*.c \
-I${join(WASM_SRC, 'include')} \
-o ${join(WASM_OUT, 'llhttp.wasm')} \
${WASM_LDLIBS}`, { stdio: 'inherit' })

writeWasmChunk('llhttp.wasm', 'llhttp-wasm.js')

// Build wasm simd binary
execSync(`${WASM_CC} ${WASM_CFLAGS} -msimd128 ${WASM_LDFLAGS} \
${join(WASM_SRC, 'src')}/*.c \
Expand Down
15 changes: 1 addition & 14 deletions lib/dispatcher/client-h1.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,7 @@ function removeAllListeners (obj) {
}

async function lazyllhttp () {
const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined

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

// 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
// got me to remove that check to avoid breaking Node 12.
mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))
}
const mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))

return await WebAssembly.instantiate(mod, {
env: {
Expand Down
3 changes: 0 additions & 3 deletions lib/llhttp/llhttp-wasm.js

This file was deleted.

Binary file removed lib/llhttp/llhttp.wasm
Binary file not shown.

0 comments on commit a596585

Please sign in to comment.