Skip to content

Commit 3b2df8e

Browse files
authored
chore: remove no-simd wasm of llhttp (nodejs#2871)
1 parent ed89b45 commit 3b2df8e

File tree

5 files changed

+1
-27
lines changed

5 files changed

+1
-27
lines changed

.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
# The wasm files are stored as base64 strings in the corresponding .js files
77
lib/llhttp/llhttp_simd.wasm
8-
lib/llhttp/llhttp.wasm
98

109
!types/**/*
1110
!index.d.ts

build/wasm.js

-9
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,6 @@ module.exports = fs.readFileSync(require.resolve('./${basename(path)}'))
7979
`)
8080
}
8181

82-
// Build wasm binary
83-
execSync(`${WASM_CC} ${WASM_CFLAGS} ${WASM_LDFLAGS} \
84-
${join(WASM_SRC, 'src')}/*.c \
85-
-I${join(WASM_SRC, 'include')} \
86-
-o ${join(WASM_OUT, 'llhttp.wasm')} \
87-
${WASM_LDLIBS}`, { stdio: 'inherit' })
88-
89-
writeWasmChunk('llhttp.wasm', 'llhttp-wasm.js')
90-
9182
// Build wasm simd binary
9283
execSync(`${WASM_CC} ${WASM_CFLAGS} -msimd128 ${WASM_LDFLAGS} \
9384
${join(WASM_SRC, 'src')}/*.c \

lib/dispatcher/client-h1.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,7 @@ function removeAllListeners (obj) {
7474
}
7575

7676
async function lazyllhttp () {
77-
const llhttpWasmData = process.env.JEST_WORKER_ID ? require('../llhttp/llhttp-wasm.js') : undefined
78-
79-
let mod
80-
try {
81-
mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))
82-
} catch (e) {
83-
/* istanbul ignore next */
84-
85-
// We could check if the error was caused by the simd option not
86-
// being enabled, but the occurring of this other error
87-
// * https://github.com/emscripten-core/emscripten/issues/11495
88-
// got me to remove that check to avoid breaking Node 12.
89-
mod = await WebAssembly.compile(llhttpWasmData || require('../llhttp/llhttp-wasm.js'))
90-
}
77+
const mod = await WebAssembly.compile(require('../llhttp/llhttp_simd-wasm.js'))
9178

9279
return await WebAssembly.instantiate(mod, {
9380
env: {

lib/llhttp/llhttp-wasm.js

-3
This file was deleted.

lib/llhttp/llhttp.wasm

-54.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)