diff --git a/assembly/test.ts b/assembly/test.ts index 1c80f64..d1166fb 100644 --- a/assembly/test.ts +++ b/assembly/test.ts @@ -47,7 +47,7 @@ const item: Item = { } }; -bs.ensureSize(2048); +// bs.ensureSize(2048); console.log(JSON.stringify(vec)); -bs.ensureSize(2048); +// bs.ensureSize(2048); console.log(JSON.stringify(item)); \ No newline at end of file diff --git a/package.json b/package.json index 590cc17..227ff29 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "scripts": { "test": "rm -rf ./build/ && ast test", "build:bench": "rm -rf ./build/ && asc assembly/__benches__/misc.bench.ts -o ./build/bench.wasm --textFile ./build/bench.wat --transform ./transform --optimizeLevel 3 --shrinkLevel 0 --converge --noAssert --uncheckedBehavior always --runtime incremental --enable simd --enable bulk-memory", - "build:test": "rm -rf ./build/ && JSON_DEBUG=true asc assembly/test.ts --transform ./transform -o ./build/test.wasm --textFile ./build/test.wat -O3 --enable simd --runtime stub", + "build:test": "rm -rf ./build/ && JSON_DEBUG=true asc assembly/test.ts --transform ./transform -o ./build/test.wasm --textFile ./build/test.wat --optimizeLevel 3 --shrinkLevel 0 --enable simd --runtime stub", "build:transform": "tsc -p ./transform", "test:wasmtime": "wasmtime ./build/test.wasm", "test:wasmer": "wasmer ./build/test.wasm", diff --git a/transform/lib/index.js b/transform/lib/index.js index af504ac..70fdc08 100644 --- a/transform/lib/index.js +++ b/transform/lib/index.js @@ -15,7 +15,7 @@ class JSONTransform extends Visitor { imports = []; jsonImport = null; bsImport = null; - newStmts = []; + newStmts = { simd: [] }; visitClassDeclaration(node) { if (!node.decorators?.length) return; @@ -148,7 +148,7 @@ class JSONTransform extends Visitor { if (isRegular && isPure) { const keyPart = (isFirst ? "{" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += strToStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), ${isPrimitive(member.type)});\n`; if (isFirst) isFirst = false; @@ -156,7 +156,7 @@ class JSONTransform extends Visitor { else if (isRegular && !isPure) { const keyPart = (isFirst ? "" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += strToStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; if (isFirst) isFirst = false; @@ -167,7 +167,7 @@ class JSONTransform extends Visitor { indentInc(); const keyPart = aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += strToStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; if (!isLast) { this.schema.byteSize += 2; @@ -181,7 +181,7 @@ class JSONTransform extends Visitor { else if (member.flags.has(PropertyFlags.OmitIf)) { SERIALIZE_BS += indent + `if (${toString}) !== 0) {\n`; indentInc(); - SERIALIZE_BS += strToStores(aliasName + ":").map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(aliasName + ":").map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; if (!isLast) { this.schema.byteSize += 2; @@ -277,6 +277,35 @@ class JSONTransform extends Visitor { } } } + getStores(data, simd = true) { + const out = []; + const sizes = strToNum(data, simd); + let offset = 0; + for (const [size, num] of sizes) { + if (size == "v128") { + let index = this.newStmts.simd.findIndex(v => v.includes(num)); + let name = "SIMD_" + (index == -1 ? this.newStmts.simd.length : index); + if (index) + this.newStmts.simd.push(`const ${name} = ${num};`); + out.push("store(bs.offset, " + name + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 8)); + offset += 16; + } + if (size == "u64") { + out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 4)); + offset += 8; + } + else if (size == "u32") { + out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 2)); + offset += 4; + } + else if (size == "u16") { + out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 1)); + offset += 2; + } + } + out.push("bs.offset += " + offset + ";"); + return out; + } } export default class Transformer extends Transform { afterParse(parser) { @@ -299,6 +328,14 @@ export default class Transformer extends Transform { transformer.imports = []; transformer.currentSource = source; transformer.visit(source); + if (transformer.newStmts.simd) { + const tokenizer = new Tokenizer(new Source(0, source.normalizedPath, transformer.newStmts.simd.join("\n"))); + parser.currentSource = tokenizer.source; + for (let i = 0; i < transformer.newStmts.simd.length; i++) + source.statements.unshift(parser.parseTopLevelStatement(tokenizer)); + parser.currentSource = source; + transformer.newStmts.simd = []; + } if (transformer.jsonImport) { const tokenizer = new Tokenizer(new Source(0, source.normalizedPath, transformer.jsonImport)); parser.currentSource = tokenizer.source; @@ -407,31 +444,6 @@ function strToNum(data, simd = false, offset = 0) { } return out; } -function strToStores(data, simd = true) { - const out = []; - const nums = strToNum(data, simd); - let offset = 0; - for (const [size, num] of nums) { - if (size == "v128") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 8)); - offset += 16; - } - if (size == "u64") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 4)); - offset += 8; - } - else if (size == "u32") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 2)); - offset += 4; - } - else if (size == "u16") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 1)); - offset += 2; - } - } - out.push("bs.offset += " + offset + ";"); - return out; -} function isPrimitive(type) { const primitiveTypes = [ "u8", "u16", "u32", "u64", diff --git a/transform/lib/index.js.map b/transform/lib/index.js.map index 994c9d7..cc87024 100644 --- a/transform/lib/index.js.map +++ b/transform/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,oBAAoB,EAAU,MAAM,EAAqC,uBAAuB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAA0E,SAAS,EAA8J,MAAM,uCAAuC,CAAC;AAC/gB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE3D,IAAI,MAAM,GAAG,IAAI,CAAC;AAElB,MAAM,aAAc,SAAQ,OAAO;IAC1B,MAAM,CAAU;IAChB,OAAO,GAAa,EAAE,CAAC;IACvB,MAAM,CAAU;IAChB,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5B,OAAO,GAAsB,EAAE,CAAC;IAEhC,UAAU,GAAkB,IAAI,CAAC;IACjC,QAAQ,GAAkB,IAAI,CAAC;IAC/B,QAAQ,GAAgB,EAAE,CAAC;IAElC,qBAAqB,CAAC,IAAsB;QAC1C,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM;YAAE,OAAO;QAErC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAA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IAAI,IAAI,IAAI,KAAK;QAAE,OAAO,EAAE,CAAC;SAC7B,IAAI,IAAI,IAAI,KAAK;QAAE,OAAO,EAAE,CAAC;SAC7B,IAAI,IAAI,IAAI,KAAK;QAAE,OAAO,EAAE,CAAC;SAC7B,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,SAAS;QAAE,OAAO,EAAE,CAAC;;QACnD,OAAO,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;AACpD,CAAC"} \ No newline at end of file diff --git a/transform/src/index.ts b/transform/src/index.ts index 7bc4321..7570593 100644 --- a/transform/src/index.ts +++ b/transform/src/index.ts @@ -18,7 +18,9 @@ class JSONTransform extends Visitor { public jsonImport: string | null = null; public bsImport: string | null = null; - public newStmts: Statement[] = []; + public newStmts: { + simd: string[] + } = { simd: [] }; visitClassDeclaration(node: ClassDeclaration): void { if (!node.decorators?.length) return; @@ -168,13 +170,13 @@ class JSONTransform extends Visitor { if (isRegular && isPure) { const keyPart = (isFirst ? "{" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += strToStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), ${isPrimitive(member.type)});\n`; if (isFirst) isFirst = false; } else if (isRegular && !isPure) { const keyPart = (isFirst ? "" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += strToStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; if (isFirst) isFirst = false; } else { @@ -183,7 +185,7 @@ class JSONTransform extends Visitor { indentInc(); const keyPart = aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += strToStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; if (!isLast) { @@ -198,7 +200,7 @@ class JSONTransform extends Visitor { } else if (member.flags.has(PropertyFlags.OmitIf)) { SERIALIZE_BS += indent + `if (${toString}) !== 0) {\n`; indentInc(); - SERIALIZE_BS += strToStores(aliasName + ":").map(v => indent + v + "\n").join(""); + SERIALIZE_BS += this.getStores(aliasName + ":").map(v => indent + v + "\n").join(""); SERIALIZE_BS += indent + `JSON.serialize_simple<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; if (!isLast) { @@ -335,6 +337,34 @@ class JSONTransform extends Visitor { } } } + + getStores(data: string, simd: boolean = true): string[] { + const out: string[] = []; + const sizes = strToNum(data, simd); + let offset = 0; + for (const [size, num] of sizes) { + if (size == "v128") { + // This could be put in its own file + let index = this.newStmts.simd.findIndex(v => v.includes(num)); + let name = "SIMD_" + (index == -1 ? this.newStmts.simd.length : index); + if (index) this.newStmts.simd.push(`const ${name} = ${num};`); + out.push("store(bs.offset, " + name + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 8)); + offset += 16; + } + if (size == "u64") { + out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 4)); + offset += 8; + } else if (size == "u32") { + out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 2)); + offset += 4; + } else if (size == "u16") { + out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 1)); + offset += 2; + } + } + out.push("bs.offset += " + offset + ";"); + return out; + } } export default class Transformer extends Transform { @@ -364,6 +394,14 @@ export default class Transformer extends Transform { // Ignore all lib and std. Visit everything else. transformer.visit(source); + if (transformer.newStmts.simd) { + const tokenizer = new Tokenizer(new Source(SourceKind.User, source.normalizedPath, transformer.newStmts.simd.join("\n"))); + parser.currentSource = tokenizer.source; + for (let i = 0; i < transformer.newStmts.simd.length; i++) source.statements.unshift(parser.parseTopLevelStatement(tokenizer)!); + parser.currentSource = source; + transformer.newStmts.simd = []; + } + if (transformer.jsonImport) { const tokenizer = new Tokenizer(new Source(SourceKind.User, source.normalizedPath, transformer.jsonImport)); parser.currentSource = tokenizer.source; @@ -479,31 +517,6 @@ function strToNum(data: string, simd: boolean = false, offset: number = 0): stri return out; } -function strToStores(data: string, simd: boolean = true): string[] { - // console.log(data); - const out: string[] = []; - const nums = strToNum(data, simd); - let offset = 0; - for (const [size, num] of nums) { - if (size == "v128") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 8)); - offset += 16; - } - if (size == "u64") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 4)); - offset += 8; - } else if (size == "u32") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 2)); - offset += 4; - } else if (size == "u16") { - out.push("store(bs.offset, " + num + ", " + offset + "); // " + data.slice((offset >> 1), (offset >> 1) + 1)); - offset += 2; - } - } - out.push("bs.offset += " + offset + ";"); - return out; -} - function isPrimitive(type: string): boolean { const primitiveTypes = [ "u8", "u16", "u32", "u64",