Skip to content

Commit

Permalink
feat: remove LEB128 opt
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed Jul 16, 2018
1 parent f744c4a commit b310b9b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lib/wasm/WebAssemblyGenerator.js
Expand Up @@ -9,7 +9,6 @@ const Template = require("../Template");
const WebAssemblyUtils = require("./WebAssemblyUtils");
const { RawSource } = require("webpack-sources");

const { shrinkPaddedLEB128 } = require("@webassemblyjs/wasm-opt");
const { editWithAST, addWithAST } = require("@webassemblyjs/wasm-edit");
const { decode } = require("@webassemblyjs/wasm-parser");
const t = require("@webassemblyjs/ast");
Expand All @@ -26,17 +25,6 @@ const WebAssemblyExportImportedDependency = require("../dependencies/WebAssembly
* @typedef {(ArrayBuffer) => ArrayBuffer} ArrayBufferTransform
*/

/**
* Run some preprocessing on the binary before wasm-edit
*
* @param {ArrayBuffer} ab - original binary
* @returns {ArrayBufferTransform} transform
*/
const preprocess = ab => {
const optBin = shrinkPaddedLEB128(new Uint8Array(ab));
return optBin.buffer;
};

/**
* @template T
* @param {Function[]} fns transforms
Expand Down Expand Up @@ -368,7 +356,6 @@ class WebAssemblyGenerator extends Generator {

generate(module) {
let bin = module.originalSource().source();
bin = preprocess(bin);

const initFuncId = t.identifier(
Array.isArray(module.usedExports)
Expand Down

0 comments on commit b310b9b

Please sign in to comment.