From c97f121bce9d0ae7224f2672cafcdfc90fa570c2 Mon Sep 17 00:00:00 2001 From: Jairus Date: Wed, 15 Jan 2025 20:57:09 -0500 Subject: [PATCH] __DESERIALIZE should take in pointer --- assembly/deserialize/simple/array.ts | 7 +- assembly/deserialize/simple/array/array.ts | 36 ++-- assembly/deserialize/simple/array/float.ts | 4 +- assembly/deserialize/simple/array/map.ts | 13 +- assembly/deserialize/simple/array/object.ts | 30 ++- assembly/deserialize/simple/bool.ts | 19 +- assembly/deserialize/simple/float.ts | 21 +- assembly/deserialize/simple/object.ts | 37 ++-- assembly/index.ts | 59 ++++-- assembly/serialize/simd/string.ts | 20 +- assembly/serialize/simple/object.ts | 7 +- assembly/serialize/simple/string.ts | 9 +- assembly/test.ts | 16 +- assembly/types.ts | 2 +- transform/lib/index.js | 111 ++++++----- transform/lib/index.js.map | 2 +- transform/src/index.ts | 201 ++++++-------------- 17 files changed, 262 insertions(+), 332 deletions(-) diff --git a/assembly/deserialize/simple/array.ts b/assembly/deserialize/simple/array.ts index 07074f8..e20ab82 100644 --- a/assembly/deserialize/simple/array.ts +++ b/assembly/deserialize/simple/array.ts @@ -1,5 +1,3 @@ -import { BRACKET_LEFT } from "../../custom/chars"; -import { isMap } from "../../custom/util"; import { deserializeArrayArray } from "./array/array"; import { deserializeBooleanArray } from "./array/bool"; import { deserializeFloatArray } from "./array/float"; @@ -37,3 +35,8 @@ export function deserializeArray(srcStart: usize, srcEnd: u throw new Error("Could not parse array of type " + nameof() + "!"); } } + +function isMap(): boolean { + let type: T = changetype(0); + return type instanceof Map; +} \ No newline at end of file diff --git a/assembly/deserialize/simple/array/array.ts b/assembly/deserialize/simple/array/array.ts index ab3af9a..5acbbfd 100644 --- a/assembly/deserialize/simple/array/array.ts +++ b/assembly/deserialize/simple/array/array.ts @@ -1,30 +1,18 @@ import { BRACKET_LEFT, BRACKET_RIGHT } from "../../../custom/chars"; import { JSON } from "../../../"; -import { unsafeCharCodeAt } from "../../../custom/util"; -export function deserializeArrayArray(data: string): T { - const result = instantiate(); - let lastPos = 0; - let depth = 0; - let i = 1; - // Find start of bracket - //for (; unsafeCharCodeAt(data, i) !== leftBracketCode; i++) {} - //i++; - for (; i < data.length - 1; i++) { - const char = unsafeCharCodeAt(data, i); - if (char == BRACKET_LEFT) { - if (depth == 0) { - lastPos = i; - } - // Shifting is 6% faster than incrementing - depth++; - } else if (char == BRACKET_RIGHT) { - depth--; - if (depth == 0) { - i++; - result.push(JSON.parse>(data.slice(lastPos, i))); - } +export function deserializeArrayArray(srcStart: usize, srcEnd: usize, dst: usize): T { + const out = changetype(dst); + let lastIndex: usize = 0; + let depth: u32 = 0; + while (srcStart < srcEnd) { + const code = load(srcStart); + if (code == BRACKET_LEFT && depth++ == 0) { + lastIndex = srcStart; + } else if (code == BRACKET_RIGHT && --depth == 0) { + out.push(JSON.__deserialize>(lastIndex, srcStart)); } + srcStart += 2; } - return result; + return out; } diff --git a/assembly/deserialize/simple/array/float.ts b/assembly/deserialize/simple/array/float.ts index fa58c48..472b284 100644 --- a/assembly/deserialize/simple/array/float.ts +++ b/assembly/deserialize/simple/array/float.ts @@ -1,7 +1,5 @@ import { isSpace } from "../../../util"; -import { unsafeCharCodeAt } from "../../../custom/util"; -import { COMMA, BRACKET_RIGHT, BRACE_RIGHT } from "../../../custom/chars"; -import { deserializeFloat } from "../float"; +import { COMMA, BRACE_RIGHT } from "../../../custom/chars"; import { JSON } from "../../.."; // @ts-ignore: Decorator valid here diff --git a/assembly/deserialize/simple/array/map.ts b/assembly/deserialize/simple/array/map.ts index d16abca..cac93a9 100644 --- a/assembly/deserialize/simple/array/map.ts +++ b/assembly/deserialize/simple/array/map.ts @@ -1,13 +1,18 @@ import { BRACE_LEFT, BRACE_RIGHT } from "../../../custom/chars"; import { JSON } from "../../.."; -import { unsafeCharCodeAt } from "../../../custom/util"; export function deserializeMapArray[]>(srcStart: usize, srcEnd: usize, dst: usize): T { - const out = instantiate(); - let lastPos: usize = 2; + const out = changetype(dst); + let lastIndex: usize = 0; let depth: u32 = 0; while (srcStart < srcEnd) { - + const code = load(srcStart); + if (code == BRACE_LEFT && depth++ == 0) { + lastIndex = srcStart; + } else if (code == BRACE_RIGHT && --depth == 0) { + out.push(JSON.__deserialize>(lastIndex, srcStart)); + } + srcStart += 2; } return out; } diff --git a/assembly/deserialize/simple/array/object.ts b/assembly/deserialize/simple/array/object.ts index d8da9a8..28e293c 100644 --- a/assembly/deserialize/simple/array/object.ts +++ b/assembly/deserialize/simple/array/object.ts @@ -1,26 +1,18 @@ import { BRACE_LEFT, BRACE_RIGHT } from "../../../custom/chars"; import { JSON } from "../../.."; -import { unsafeCharCodeAt } from "../../../custom/util"; -export function deserializeObjectArray(data: string): T { - const result = instantiate(); - let lastPos: u32 = 1; +export function deserializeObjectArray(srcStart: usize, srcEnd: usize, dst: usize): T { + const out = changetype(dst); + let lastIndex: usize = 0; let depth: u32 = 0; - for (let pos: u32 = 0; pos < data.length; pos++) { - const char = unsafeCharCodeAt(data, pos); - if (char == BRACE_LEFT) { - if (depth == 0) { - lastPos = pos; - } - depth++; - } else if (char == BRACE_RIGHT) { - depth--; - if (depth == 0) { - pos++; - result.push(JSON.parse>(data.slice(lastPos, pos))); - //lastPos = pos + 2; - } + while (srcStart < srcEnd) { + const code = load(srcStart); + if (code == BRACE_LEFT && depth++ == 0) { + lastIndex = srcStart; + } else if (code == BRACE_RIGHT && --depth == 0) { + out.push(JSON.__deserialize>(lastIndex, srcStart)); } + srcStart += 2; } - return result; + return out; } diff --git a/assembly/deserialize/simple/bool.ts b/assembly/deserialize/simple/bool.ts index 84938a8..ea222ff 100644 --- a/assembly/deserialize/simple/bool.ts +++ b/assembly/deserialize/simple/bool.ts @@ -1,24 +1,7 @@ import { CHAR_F, CHAR_T } from "../../custom/chars"; -import { unsafeCharCodeAt } from "../../custom/util"; -/** - * Deserialize a string to type boolean - * @param data data to parse - * @returns boolean - */ // @ts-ignore: Decorator valid here -@inline export function deserializeBoolean(data: string, start: i32 = 0, end: i32 = 0): boolean { - if (!end) end = data.length; - const len = end - start; - const ptr = changetype(data) + (start << 1); - const firstChar = unsafeCharCodeAt(data, start); - if (len == 4 && firstChar == CHAR_T && load(ptr) == 28429475166421108) return true; - else if (len == 5 && firstChar == CHAR_F && load(ptr, 2) == 28429466576093281) return false; - return false; //ERROR(`Expected to find boolean, but found "${data.slice(0, 100)}" instead!`); -} - -// @ts-ignore: Decorator valid here -@inline export function deserializeBoolean_NEW(srcStart: usize, srcEnd: usize): boolean { +@inline export function deserializeBoolean(srcStart: usize, srcEnd: usize): boolean { const srcSize = srcEnd - srcStart; const firstChar = load(srcStart); if (srcSize == 4 && firstChar == CHAR_T && load(srcStart) == 28429475166421108) return true; diff --git a/assembly/deserialize/simple/float.ts b/assembly/deserialize/simple/float.ts index ced0057..b4b93af 100644 --- a/assembly/deserialize/simple/float.ts +++ b/assembly/deserialize/simple/float.ts @@ -1,26 +1,11 @@ -// @ts-ignore: Decorator valid here -@inline export function deserializeFloat(data: string): T { - // @ts-ignore - const type: T = 0; - // @ts-ignore - if (type instanceof f64) return f64.parse(data); - // @ts-ignore - return f32.parse(data); -} +import { ptrToStr } from "../../util/ptrToStr"; // @ts-ignore: Decorator valid here -@inline export function deserializeFloat_NEW(srcStart: usize, srcEnd: usize): T { +@inline export function deserializeFloat(srcStart: usize, srcEnd: usize): T { // @ts-ignore const type: T = 0; // @ts-ignore - if (type instanceof f64) return f64.parse(str(srcStart, srcEnd)); + if (type instanceof f64) return f64.parse(ptrToStr(srcStart, srcEnd)); // @ts-ignore return f32.parse(str(srcStart, srcEnd)); -} - -function str(start: usize, end: usize): string { - const size = end - start; - const out = __new(size, idof()); - memory.copy(out, start, size); - return changetype(out); } \ No newline at end of file diff --git a/assembly/deserialize/simple/object.ts b/assembly/deserialize/simple/object.ts index 479de5b..96960de 100644 --- a/assembly/deserialize/simple/object.ts +++ b/assembly/deserialize/simple/object.ts @@ -1,7 +1,9 @@ import { BACK_SLASH, COMMA, CHAR_F, BRACE_LEFT, BRACKET_LEFT, CHAR_N, QUOTE, BRACE_RIGHT, BRACKET_RIGHT, CHAR_T, COLON } from "../../custom/chars"; import { isSpace } from "../../util"; +import { ptrToStr } from "../../util/ptrToStr"; export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize): T { + const out = changetype(dst); const srcPtr = srcStart; let keyStart: usize = 0; @@ -20,7 +22,7 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) if (isKey) { keyStart = lastIndex; keyEnd = srcStart; - console.log("Key: " + str(lastIndex, srcStart)); + console.log("Key: " + ptrToStr(lastIndex, srcStart)); while (isSpace((code = load((srcStart += 2))))) { /* empty */ } @@ -43,9 +45,9 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) while (isSpace(load((srcStart += 2)))) { /* empty */ } - console.log("Value (string): " + str(lastIndex, srcStart)); + console.log("Value (string): " + ptrToStr(lastIndex, srcStart)); // @ts-ignore: exists - dst.__DESERIALIZE(keyStart, keyEnd, lastIndex, srcStart); + out.__DESERIALIZE(keyStart, keyEnd, lastIndex, srcStart, dst); keyStart = 0; break; } @@ -58,8 +60,8 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) const code = load(srcStart); if (code == COMMA || code == BRACE_RIGHT || isSpace(code)) { // @ts-ignore: exists - dst.__DESERIALIZE(keyStart, keyEnd, lastIndex, srcStart); - console.log("Value (number): " + str(lastIndex, srcStart)); + out.__DESERIALIZE(keyStart, keyEnd, lastIndex, srcStart, dst); + console.log("Value (number): " + ptrToStr(lastIndex, srcStart)); while (isSpace(load((srcStart += 2)))) { /* empty */ } @@ -77,8 +79,8 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) if (((code ^ BRACE_RIGHT) | (code ^ BRACKET_RIGHT)) == 32) { if (--depth == 0) { // @ts-ignore: exists - dst.__DESERIALIZE(keyStart, keyEnd, lastIndex, srcStart); - console.log("Value (object): " + str(lastIndex, srcStart)); + out.__DESERIALIZE(keyStart, keyEnd, lastIndex, srcStart, dst); + console.log("Value (object): " + ptrToStr(lastIndex, srcStart)); keyStart = 0; while (isSpace(load((srcStart += 2)))) { /* empty */ @@ -91,8 +93,8 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) } else if (code == CHAR_T) { if (load(srcStart) == 28429475166421108) { // @ts-ignore: exists - dst.__DESERIALIZE(keyStart, keyEnd, srcStart, (srcStart += 8)); - console.log("Value (bool): " + str(srcStart - 8, srcStart)); + out.__DESERIALIZE(keyStart, keyEnd, srcStart, (srcStart += 8), dst); + console.log("Value (bool): " + ptrToStr(srcStart - 8, srcStart)); while (isSpace(load((srcStart += 2)))) { /* empty */ } @@ -101,8 +103,8 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) } else if (code == CHAR_F) { if (load(srcStart, 2) == 28429466576093281) { // @ts-ignore: exists - dst.__DESERIALIZE(keyStart, keyEnd, srcStart, (srcStart += 10)); - console.log("Value (bool): " + str(srcStart - 10, srcStart)); + out.__DESERIALIZE(keyStart, keyEnd, srcStart, (srcStart += 10), dst); + console.log("Value (bool): " + ptrToStr(srcStart - 10, srcStart)); while (isSpace(load((srcStart += 2)))) { /* empty */ } @@ -111,8 +113,8 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) } else if (code == CHAR_N) { if (load(srcStart) == 30399761348886638) { // @ts-ignore: exists - dst.__DESERIALIZE(keyStart, keyEnd, srcStart, (srcStart += 8)); - console.log("Value (null): " + str(srcStart - 8, srcStart)); + out.__DESERIALIZE(keyStart, keyEnd, srcStart, (srcStart += 8), dst); + console.log("Value (null): " + ptrToStr(srcStart - 8, srcStart)); while (isSpace(load((srcStart += 2)))) { /* empty */ } @@ -120,12 +122,5 @@ export function deserializeObject(srcStart: usize, srcEnd: usize, dst: usize) } } } - return dst; -} - -function str(start: usize, end: usize): string { - const size = end - start; - const out = __new(size, idof()); - memory.copy(out, start, size); - return changetype(out); + return out; } diff --git a/assembly/index.ts b/assembly/index.ts index 14dcdd7..88a3789 100644 --- a/assembly/index.ts +++ b/assembly/index.ts @@ -4,14 +4,14 @@ import { bs } from "as-bs"; import { serializeString } from "./serialize/simple/string"; import { serializeArray } from "./serialize/simple/array"; import { serializeMap } from "./serialize/simple/map"; -import { deserializeBoolean, deserializeBoolean_NEW } from "./deserialize/simple/bool"; +import { deserializeBoolean } from "./deserialize/simple/bool"; import { deserializeArray } from "./deserialize/simple/array"; -import { deserializeFloat, deserializeFloat_NEW } from "./deserialize/simple/float"; +import { deserializeFloat } from "./deserialize/simple/float"; import { deserializeObject } from "./deserialize/simple/object"; import { deserializeMap } from "./deserialize/simple/map"; import { deserializeDate } from "./deserialize/simple/date"; -import { deserializeInteger, deserializeInteger_NEW } from "./deserialize/simple/integer"; -import { deserializeString} from "./deserialize/simple/string"; +import { deserializeInteger } from "./deserialize/simple/integer"; +import { deserializeString } from "./deserialize/simple/string"; import { serializeArbitrary } from "./serialize/simple/arbitrary"; import { Sink } from "./custom/sink"; @@ -22,6 +22,8 @@ import { serializeInteger } from "./serialize/simple/integer"; import { serializeFloat } from "./serialize/simple/float"; import { serializeObject } from "./serialize/simple/object"; import { ptrToStr } from "./util/ptrToStr"; +import { bytes } from "./util"; +import { serializeString_SIMD } from "./serialize/simd/string"; class Nullable { } @@ -94,14 +96,25 @@ export namespace JSON { return NULL_WORD; // @ts-ignore } else if (isString>()) { + if (out) { + out = changetype(__renew(changetype(out), bytes(data) + 4)); + // const oldSize = bs.byteLength; + const oldBuf = bs.buffer; + const newSize = bytes(data) + 4; + const newBuf = __new(newSize, idof()); + bs.setBuffer(newBuf); + serializeString(changetype(data)); + bs.setBuffer(oldBuf); + return changetype(newBuf); + } serializeString(changetype(data)); return bs.shrinkTo(); // @ts-ignore: Supplied by transform - } else if (isDefined(data.__SERIALIZE_BS) && isDefined(data.__ALLOCATE)) { + } else if (isDefined(data.__SERIALIZE) && isDefined(data.__ALLOCATE)) { // @ts-ignore data.__ALLOCATE(); // @ts-ignore - data.__SERIALIZE_BS(changetype(data), false); + data.__SERIALIZE(changetype(data)); return bs.out(); // @ts-ignore: Supplied by transform } else if (isDefined(data.__SERIALIZE)) { @@ -338,35 +351,39 @@ export namespace JSON { } } - export function __serialize(src: T, staticSize: bool = false): void { + export function __serialize(src: T): void { if (isBoolean()) { - serializeBool(src as bool, staticSize); + serializeBool(src as bool); } else if (isInteger()) { // @ts-ignore - serializeInteger(src, staticSize); + serializeInteger(src); } else if (isFloat(src)) { // @ts-ignore - serializeFloat(src, staticSize); + serializeFloat(src); // @ts-ignore: Function is generated by transform } else if (changetype(src) == 0) { - if (!staticSize) bs.ensureSize(8); + bs.ensureSize(8); store(bs.offset, 30399761348886638); bs.offset += 8; } else if (isString>()) { - serializeString(src as string, staticSize); + if (ASC_FEATURE_SIMD) { + serializeString_SIMD(src as string); + } else { + serializeString(src as string); + } // @ts-ignore: Supplied by transform - } else if (isDefined(src.__SERIALIZE_BS)) { + } else if (isDefined(src.__SERIALIZE)) { // @ts-ignore - serializeObject(changetype>(src), staticSize); + serializeObject(changetype>(src)); } else if (src instanceof Date) { // @ts-ignore - serializeDate(changetype>(src), staticSize); + serializeDate(changetype>(src)); } else if (src instanceof Array) { // @ts-ignore - serializeArray(changetype>(src), staticSize); + serializeArray(changetype>(src)); } else if (src instanceof Map) { // @ts-ignore - serializeMap(changetype>(src), staticSize); + serializeMap(changetype>(src)); } else if (src instanceof JSON.Value) { serializeArbitrary(src); } else { @@ -376,11 +393,11 @@ export namespace JSON { export function __deserialize(srcStart: usize, srcEnd: usize, dst: usize = 0): T { if (isBoolean()) { // @ts-ignore: type - return deserializeBoolean_NEW(srcStart, srcEnd); + return deserializeBoolean(srcStart, srcEnd); } else if (isInteger()) { - return deserializeInteger_NEW(srcStart, srcEnd); + return deserializeInteger(srcStart, srcEnd); } else if (isFloat()) { - return deserializeFloat_NEW(srcStart, srcEnd); + return deserializeFloat(srcStart, srcEnd); } else if (isString()) { // @ts-ignore: type return deserializeString(srcStart, srcEnd, dst); @@ -388,7 +405,7 @@ export namespace JSON { let type: nonnull = changetype>(0); // @ts-ignore: declared by transform if (isDefined(type.__DESERIALIZE)) { - return deserializeObject(srcStart, srcEnd); + return deserializeObject(srcStart, srcEnd, dst); } else if (type instanceof Map) { // @ts-ignore: type return deserializeMap(srcStart, srcEnd, dst); diff --git a/assembly/serialize/simd/string.ts b/assembly/serialize/simd/string.ts index 284f1c5..b9c6ed4 100644 --- a/assembly/serialize/simd/string.ts +++ b/assembly/serialize/simd/string.ts @@ -1,6 +1,7 @@ import { bs } from "as-bs"; import { BACK_SLASH } from "../../custom/chars"; import { SERIALIZE_ESCAPE_TABLE } from "../../globals/tables"; +import { OBJECT, TOTAL_OVERHEAD } from "rt/common"; const SPLAT_34 = i16x8.splat(34); /* " */ const SPLAT_92 = i16x8.splat(92); /* \ */ @@ -12,12 +13,13 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ * Serializes strings into their JSON counterparts using SIMD operations * @param srcStart pointer to begin serializing at * @param srcEnd pointer to end serialization at - * @param bs.offset pointer to write to */ // @ts-ignore: Decorator valid here -@inline export function serializeString_SIMD(srcStart: usize, srcEnd: usize, staticSize: bool): void { - const srcSize = srcEnd - srcStart; - if (!staticSize) bs.ensureSize(srcSize + 4); +@inline export function serializeString_SIMD(src: string): void { + const srcSize = changetype(changetype(src) - TOTAL_OVERHEAD).rtSize; + let srcStart = changetype(src); + const srcEnd = srcStart + srcSize; + bs.ensureSize(srcSize + 4); const srcEnd16 = srcEnd - 15; store(changetype(bs.offset), 34); /* " */ @@ -44,11 +46,13 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ mask &= mask - 1; if ((escaped & 0xffff) != BACK_SLASH) { + bs.ensureSize(10); store(dst_offset, 13511005048209500); store(dst_offset, escaped, 8); v128.store(dst_offset, v128.load(src_offset, 2), 12); bs.offset += 10; } else { + bs.ensureSize(2); store(dst_offset, escaped); v128.store(dst_offset, v128.load(src_offset, 2), 4); bs.offset += 2; @@ -81,6 +85,7 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ mask &= mask - 1; if ((escaped & 0xffff) != BACK_SLASH) { + bs.ensureSize(10); store(dst_offset, 13511005048209500); store(dst_offset, escaped, 8); while (lane_index < 6) { @@ -89,6 +94,7 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ } bs.offset += 10; } else { + bs.ensureSize(2); store(dst_offset, escaped); while (lane_index < 6) { @@ -111,10 +117,12 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ const escaped = load(SERIALIZE_ESCAPE_TABLE + (codeA << 2)); if ((escaped & 0xffff) != BACK_SLASH) { + bs.ensureSize(10); store(bs.offset, 13511005048209500); store(bs.offset, escaped, 8); bs.offset += 12; } else { + bs.ensureSize(2); store(bs.offset, escaped); bs.offset += 4; } @@ -127,10 +135,12 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ const escaped = load(SERIALIZE_ESCAPE_TABLE + (codeB << 2)); if ((escaped & 0xffff) != BACK_SLASH) { + bs.ensureSize(10); store(bs.offset, 13511005048209500); store(bs.offset, escaped, 8); bs.offset += 12; } else { + bs.ensureSize(2); store(bs.offset, escaped); bs.offset += 4; } @@ -147,10 +157,12 @@ const SPLAT_0 = i16x8.splat(0); /* 0 */ const escaped = load(SERIALIZE_ESCAPE_TABLE + (code << 2)); if ((escaped & 0xffff) != BACK_SLASH) { + bs.ensureSize(10); store(bs.offset, 13511005048209500); store(bs.offset, escaped, 8); bs.offset += 12; } else { + bs.ensureSize(2); store(bs.offset, escaped); bs.offset += 4; } diff --git a/assembly/serialize/simple/object.ts b/assembly/serialize/simple/object.ts index f8f8c84..b1885c3 100644 --- a/assembly/serialize/simple/object.ts +++ b/assembly/serialize/simple/object.ts @@ -1,8 +1,7 @@ interface GeneratedInterface { - __SERIALIZE(ptr: usize): string; - __SERIALIZE_BS(ptr: usize, staticSize: bool): void; + __SERIALIZE(ptr: usize, staticSize: bool): string; } -export function serializeObject(data: T, staticSize: bool = false): void { - return changetype>(data).__SERIALIZE_BS(changetype(data), staticSize); +export function serializeObject(data: T, staticSize: bool): void { + changetype>(data).__SERIALIZE(changetype(data), staticSize); } diff --git a/assembly/serialize/simple/string.ts b/assembly/serialize/simple/string.ts index f7ac883..7232a3a 100644 --- a/assembly/serialize/simple/string.ts +++ b/assembly/serialize/simple/string.ts @@ -10,10 +10,9 @@ import { SERIALIZE_ESCAPE_TABLE } from "../../globals/tables"; * @returns void */ // @ts-ignore: Decorator -@inline export function serializeString(src: string, staticSize: bool): void { +@inline export function serializeString(src: string): void { const srcSize = bytes(src); - if (!staticSize) bs.ensureSize(srcSize + 4); - + bs.ensureSize(srcSize + 4); let srcPtr = changetype(src); const srcEnd = srcPtr + srcSize; @@ -30,12 +29,12 @@ import { SERIALIZE_ESCAPE_TABLE } from "../../globals/tables"; bs.offset += remBytes; const escaped = load(SERIALIZE_ESCAPE_TABLE + (code << 2)); if ((escaped & 0xffff) != BACK_SLASH) { - if (!staticSize) bs.ensureSize(12); + bs.ensureSize(10); store(bs.offset, 13511005048209500, 0); store(bs.offset, escaped, 8); bs.offset += 12; } else { - if (!staticSize) bs.ensureSize(2); + bs.ensureSize(2); store(bs.offset, escaped, 0); bs.offset += 4; } diff --git a/assembly/test.ts b/assembly/test.ts index f76df5c..a5a8175 100644 --- a/assembly/test.ts +++ b/assembly/test.ts @@ -1,6 +1,14 @@ -function cups(n: i32): void { - let i = 0; - while (++i <= n) console.log(i.toString() + " cups of coffee on the wall"); +import { JSON } from "."; +import { deserializeObject } from "./deserialize/simple/object"; +import { bytes } from "./util"; +@json +class Vec3 { + x: i16 = 1 + y: i16 = 2; + z: i16 = 3; } -cups(99); \ No newline at end of file +const serialized = JSON.stringify(new Vec3()); +console.log("Serialized: " + serialized); +const deserialized = deserializeObject(changetype(serialized), changetype(serialized) + bytes(serialized), changetype(new Vec3())); +console.log("Deserialized: " + JSON.stringify(deserialized)); \ No newline at end of file diff --git a/assembly/types.ts b/assembly/types.ts index da92092..4f7e63c 100644 --- a/assembly/types.ts +++ b/assembly/types.ts @@ -7,7 +7,7 @@ export class VecBase { bs.ensureSize(4); } - @inline __SERIALIZE_BS(ptr: usize, staticSize: bool): void { + @inline __SERIALIZE(ptr: usize, staticSize: bool): void { store(bs.offset, 8192123); bs.offset += 4; } diff --git a/transform/lib/index.js b/transform/lib/index.js index e990141..a108126 100644 --- a/transform/lib/index.js +++ b/transform/lib/index.js @@ -121,19 +121,18 @@ class JSONTransform extends Visitor { } if (!this.schema.static) this.schema.members = sortMembers(this.schema.members); - let SERIALIZE = "@inline __SERIALIZE(ptr: usize = changetype(this)): string {\n"; - let SERIALIZE_BS = "__SERIALIZE_BS(ptr: usize, staticSize: bool): void {\n"; + let SERIALIZE = "__SERIALIZE(ptr: usize): void {\n"; let INITIALIZE = "@inline __INITIALIZE(): this {\n"; - let DESERIALIZE = "__DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize): void {\n const keySize = keyEnd - keyStart;"; + let DESERIALIZE = "__DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize, ptr: usize): void {\n switch (keyEnd - keyStart) {\n"; let ALLOCATE = "@inline __ALLOCATE(): void {\n"; indent = " "; if (this.schema.static == false) { if (this.schema.members.some(v => v.flags.has(PropertyFlags.OmitNull))) { - SERIALIZE_BS += indent + "let block: usize = 0;\n"; + SERIALIZE += indent + "let block: usize = 0;\n"; } this.schema.byteSize += 2; - SERIALIZE_BS += indent + "store(bs.offset, 123, 0); // {\n"; - SERIALIZE_BS += indent + "bs.offset += 2;\n"; + SERIALIZE += indent + "store(bs.offset, 123, 0); // {\n"; + SERIALIZE += indent + "bs.offset += 2;\n"; } let isPure = this.schema.static; let isRegular = isPure; @@ -143,61 +142,57 @@ class JSONTransform extends Visitor { const aliasName = JSON.stringify(member.alias || member.name); const realName = member.name; const isLast = i == this.schema.members.length - 1; - DESERIALIZE += " if (keySize == " + ((aliasName.length - 2) << 1) + " && memory.compare(keyStart, changetype(" + aliasName + "), " + ((aliasName.length - 2) << 1) + ") == 0) {\n"; - DESERIALIZE += " this." + realName + " = JSON.__deserialize<" + member.type + ">(valStart, valEnd);\n"; - DESERIALIZE += " return;\n"; - DESERIALIZE += " }\n"; if (!isRegular && !member.flags.has(PropertyFlags.OmitIf) && !member.flags.has(PropertyFlags.OmitNull)) isRegular = true; if (isRegular && isPure) { const keyPart = (isFirst ? "{" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), ${isPrimitive(member.type)});\n`; + SERIALIZE += this.getStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (isFirst) isFirst = false; } else if (isRegular && !isPure) { const keyPart = (isFirst ? "" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; + SERIALIZE += this.getStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (isFirst) isFirst = false; } else { if (member.flags.has(PropertyFlags.OmitNull)) { - SERIALIZE_BS += indent + `if ((block = load(ptr, offsetof("${realName}"))) !== 0) {\n`; + SERIALIZE += indent + `if ((block = load(ptr, offsetof(${JSON.stringify(realName)}))) !== 0) {\n`; indentInc(); const keyPart = aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; + SERIALIZE += this.getStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (!isLast) { this.schema.byteSize += 2; - SERIALIZE_BS += indent + `store(bs.offset, 44, 0); // ,\n`; - SERIALIZE_BS += indent + `bs.offset += 2;\n`; + SERIALIZE += indent + `store(bs.offset, 44, 0); // ,\n`; + SERIALIZE += indent + `bs.offset += 2;\n`; } indentDec(); this.schema.byteSize += 2; - SERIALIZE_BS += indent + `}\n`; + SERIALIZE += indent + `}\n`; } else if (member.flags.has(PropertyFlags.OmitIf)) { - SERIALIZE_BS += indent + `if (${toString}) !== 0) {\n`; + SERIALIZE += indent + `if (${toString}) !== 0) {\n`; indentInc(); - SERIALIZE_BS += this.getStores(aliasName + ":").map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; + SERIALIZE += this.getStores(aliasName + ":").map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (!isLast) { this.schema.byteSize += 2; - SERIALIZE_BS += indent + `store(bs.offset, 44, 0); // ,\n`; - SERIALIZE_BS += indent + `bs.offset += 2;\n`; + SERIALIZE += indent + `store(bs.offset, 44, 0); // ,\n`; + SERIALIZE += indent + `bs.offset += 2;\n`; } indentDec(); - SERIALIZE_BS += indent + `}\n`; + SERIALIZE += indent + `}\n`; } } } - const sortedMembers = []; + let sortedMembers = []; let len = -1; this.schema.members .slice() @@ -212,37 +207,65 @@ class JSONTransform extends Visitor { len = _nameLength; } }); - const groups = sortedMembers.length; + sortedMembers = sortedMembers.sort((a, b) => b.length - a.length); + indentInc(); for (const memberGroup of sortedMembers) { + const memberLen = (memberGroup[0].alias || memberGroup[0].name).length << 1; + DESERIALIZE += `${indent}case ${memberLen}: {\n`; + indentInc(); + if (memberLen == 2) + DESERIALIZE += `${indent}switch (load(keyStart)) {\n`; + if (memberLen == 4) + DESERIALIZE += `${indent}switch (load(keyStart)) {\n`; + if (memberLen == 8) + DESERIALIZE += `${indent}switch (load(keyStart)) {\n`; + for (let i = 0; i < memberGroup.length; i++) { + const member = memberGroup[i]; + const memberName = member.alias || member.name; + if (memberLen == 2) { + DESERIALIZE += `${indent} case ${memberName.charCodeAt(0)}: { // ${memberName}\n`; + DESERIALIZE += `${indent} store<${member.type}>(ptr, JSON.__deserialize<${member.type}>(valStart, valEnd), offsetof(${JSON.stringify(member.name)}));\n`; + DESERIALIZE += `${indent} return;\n`; + DESERIALIZE += `${indent} }\n`; + } + else if (memberLen == 4) { + DESERIALIZE += `${indent} case ${strToNum(memberName)[1]}: { // ${memberName}\n`; + DESERIALIZE += `${indent} store<${member.type}>(ptr, JSON.__deserialize<${member.type}>(valStart, valEnd), offsetof(${JSON.stringify(member.name)}));\n`; + DESERIALIZE += `${indent} return;\n`; + DESERIALIZE += `${indent} }\n`; + } + else if (memberLen == 8) { + DESERIALIZE += `${indent} case ${strToNum(memberName)[1]}: { // ${memberName}\n`; + DESERIALIZE += `${indent} store<${member.type}>(ptr, JSON.__deserialize<${member.type}>(valStart, valEnd), offsetof(${JSON.stringify(member.name)}));\n`; + DESERIALIZE += `${indent} return;\n`; + DESERIALIZE += `${indent} }\n`; + } + } + DESERIALIZE += `${indent}}\n`; + indentDec(); } - DESERIALIZE += "}"; + DESERIALIZE += `${indent}}\n`; + indentDec(); + DESERIALIZE += `${indent}}\n`; + indentDec(); + DESERIALIZE += `${indent}}\n`; indent = " "; this.schema.byteSize += 2; - SERIALIZE_BS += indent + "store(bs.offset, 125, 0); // }\n"; - SERIALIZE_BS += indent + "bs.offset += 2;\n"; - SERIALIZE_BS += "}"; - SERIALIZE += indent + `this.__ALLOCATE();\n`; - SERIALIZE += indent + `this.__SERIALIZE_BS(ptr, true);\n`; - SERIALIZE += indent + `return bs.out();\n`; + SERIALIZE += indent + "store(bs.offset, 125, 0); // }\n"; + SERIALIZE += indent + "bs.offset += 2;\n"; SERIALIZE += "}"; - indentDec(); - indentInc(); ALLOCATE += indent + "bs.ensureSize(" + this.schema.byteSize + ");\n"; ALLOCATE += "}"; if (process.env["JSON_DEBUG"]) { console.log(SERIALIZE); - console.log(SERIALIZE_BS); console.log(DESERIALIZE); console.log(ALLOCATE); } const SERIALIZE_METHOD = SimpleParser.parseClassMember(SERIALIZE, node); - const SERIALIZE_BS_METHOD = SimpleParser.parseClassMember(SERIALIZE_BS, node); const DESERIALIZE_METHOD = SimpleParser.parseClassMember(DESERIALIZE, node); const ALLOCATE_METHOD = SimpleParser.parseClassMember(ALLOCATE, node); if (!node.members.find((v) => v.name.text == "__SERIALIZE")) node.members.push(SERIALIZE_METHOD); - if (!node.members.find((v) => v.name.text == "__SERIALIZE_BS")) - node.members.push(SERIALIZE_BS_METHOD); if (!node.members.find((v) => v.name.text == "__DESERIALIZE")) node.members.push(DESERIALIZE_METHOD); if (!node.members.find((v) => v.name.text == "__ALLOCATE")) @@ -251,9 +274,9 @@ class JSONTransform extends Visitor { } generateEmptyMethods(node) { let SERIALIZE_RAW_EMPTY = '@inline __SERIALIZE(ptr: usize = changetype(this)): string {\n return "{}";\n}'; - let SERIALIZE_BS_EMPTY = "@inline __SERIALIZE_BS(ptr: usize, staticSize: bool): void {\n store(bs.offset, 8192123);\n bs.offset += 4;\n}"; + let SERIALIZE_BS_EMPTY = "@inline __SERIALIZE(ptr: usize: bool): void {\n store(bs.offset, 8192123);\n bs.offset += 4;\n}"; let INITIALIZE_EMPTY = "@inline __INITIALIZE(): this {\n return this;\n}"; - let DESERIALIZE_EMPTY = "@inline __DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize): void {\n return false;\n}"; + let DESERIALIZE_EMPTY = "@inline __DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize, ptr: usize): void {\n return false;\n}"; let ALLOCATE_EMPTY = "@inline __ALLOCATE(): void {\n bs.ensureSize(4);\n}"; if (process.env["JSON_DEBUG"]) { console.log(SERIALIZE_RAW_EMPTY); @@ -269,7 +292,7 @@ class JSONTransform extends Visitor { const ALLOCATE_METHOD_EMPTY = SimpleParser.parseClassMember(ALLOCATE_EMPTY, node); if (!node.members.find((v) => v.name.text == "__SERIALIZE")) node.members.push(SERIALIZE_RAW_METHOD_EMPTY); - if (!node.members.find((v) => v.name.text == "__SERIALIZE_BS")) + if (!node.members.find((v) => v.name.text == "__SERIALIZE")) node.members.push(SERIALIZE_BS_METHOD_EMPTY); if (!node.members.find((v) => v.name.text == "__INITIALIZE")) node.members.push(INITIALIZE_METHOD_EMPTY); diff --git a/transform/lib/index.js.map b/transform/lib/index.js.map index 17c4500..e7fcfb1 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;AAG3D,IAAI,MAAM,GAAG,IAAI,CAAC;AAElB,MAAM,aAAc,SAAQ,OAAO;IAC1B,MAAM,CAAU;IAChB,OAAO,GAAa,E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C,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 37fa5ad..3b13e49 100644 --- a/transform/src/index.ts +++ b/transform/src/index.ts @@ -140,21 +140,20 @@ class JSONTransform extends Visitor { if (!this.schema.static) this.schema.members = sortMembers(this.schema.members); - let SERIALIZE = "@inline __SERIALIZE(ptr: usize = changetype(this)): string {\n"; - let SERIALIZE_BS = "__SERIALIZE_BS(ptr: usize, staticSize: bool): void {\n"; + let SERIALIZE = "__SERIALIZE(ptr: usize): void {\n"; let INITIALIZE = "@inline __INITIALIZE(): this {\n"; - let DESERIALIZE = "__DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize): void {\n const keySize = keyEnd - keyStart;"; + let DESERIALIZE = "__DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize, ptr: usize): void {\n switch (keyEnd - keyStart) {\n"; let ALLOCATE = "@inline __ALLOCATE(): void {\n"; indent = " "; if (this.schema.static == false) { if (this.schema.members.some(v => v.flags.has(PropertyFlags.OmitNull))) { - SERIALIZE_BS += indent + "let block: usize = 0;\n"; + SERIALIZE += indent + "let block: usize = 0;\n"; } this.schema.byteSize += 2; - SERIALIZE_BS += indent + "store(bs.offset, 123, 0); // {\n"; - SERIALIZE_BS += indent + "bs.offset += 2;\n"; + SERIALIZE += indent + "store(bs.offset, 123, 0); // {\n"; + SERIALIZE += indent + "bs.offset += 2;\n"; } let isPure = this.schema.static; @@ -167,61 +166,56 @@ class JSONTransform extends Visitor { const realName = member.name; const isLast = i == this.schema.members.length - 1; - DESERIALIZE += " if (keySize == " + ((aliasName.length - 2) << 1) + " && memory.compare(keyStart, changetype(" + aliasName + "), " + ((aliasName.length - 2) << 1) + ") == 0) {\n"; - DESERIALIZE += " this." + realName + " = JSON.__deserialize<" + member.type + ">(valStart, valEnd);\n"; - DESERIALIZE += " return;\n"; - DESERIALIZE += " }\n"; - if (!isRegular && !member.flags.has(PropertyFlags.OmitIf) && !member.flags.has(PropertyFlags.OmitNull)) isRegular = true; if (isRegular && isPure) { const keyPart = (isFirst ? "{" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), ${isPrimitive(member.type)});\n`; + SERIALIZE += this.getStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (isFirst) isFirst = false; } else if (isRegular && !isPure) { const keyPart = (isFirst ? "" : ",") + aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; + SERIALIZE += this.getStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (isFirst) isFirst = false; } else { if (member.flags.has(PropertyFlags.OmitNull)) { - SERIALIZE_BS += indent + `if ((block = load(ptr, offsetof("${realName}"))) !== 0) {\n`; + SERIALIZE += indent + `if ((block = load(ptr, offsetof(${JSON.stringify(realName)}))) !== 0) {\n`; indentInc(); const keyPart = aliasName + ":"; this.schema.byteSize += keyPart.length << 1; - SERIALIZE_BS += this.getStores(keyPart).map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; + SERIALIZE += this.getStores(keyPart).map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (!isLast) { this.schema.byteSize += 2; - SERIALIZE_BS += indent + `store(bs.offset, 44, 0); // ,\n`; - SERIALIZE_BS += indent + `bs.offset += 2;\n`; + SERIALIZE += indent + `store(bs.offset, 44, 0); // ,\n`; + SERIALIZE += indent + `bs.offset += 2;\n`; } indentDec(); this.schema.byteSize += 2; - SERIALIZE_BS += indent + `}\n`; + SERIALIZE += indent + `}\n`; } else if (member.flags.has(PropertyFlags.OmitIf)) { - SERIALIZE_BS += indent + `if (${toString}) !== 0) {\n`; + SERIALIZE += indent + `if (${toString}) !== 0) {\n`; indentInc(); - SERIALIZE_BS += this.getStores(aliasName + ":").map(v => indent + v + "\n").join(""); - SERIALIZE_BS += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof("${realName}")), staticSize);\n`; + SERIALIZE += this.getStores(aliasName + ":").map(v => indent + v + "\n").join(""); + SERIALIZE += indent + `JSON.__serialize<${member.type}>(load<${member.type}>(ptr, offsetof(${JSON.stringify(realName)})));\n`; if (!isLast) { this.schema.byteSize += 2; - SERIALIZE_BS += indent + `store(bs.offset, 44, 0); // ,\n`; - SERIALIZE_BS += indent + `bs.offset += 2;\n`; + SERIALIZE += indent + `store(bs.offset, 44, 0); // ,\n`; + SERIALIZE += indent + `bs.offset += 2;\n`; } indentDec(); - SERIALIZE_BS += indent + `}\n`; + SERIALIZE += indent + `}\n`; } } } - const sortedMembers: Property[][] = []; + let sortedMembers: Property[][] = []; let len = -1; this.schema.members @@ -237,138 +231,67 @@ class JSONTransform extends Visitor { } }); - const groups = sortedMembers.length; - // if (groups != 1) { - // DESERIALIZE += " switch (keyEnd - keyStart) {\n"; - // indent = " "; - // } else { - // indent = " "; - // } - for (const memberGroup of sortedMembers) { + sortedMembers = sortedMembers.sort((a, b) => b.length - a.length); - // const firstMemberLen = (memberGroup[0].alias || memberGroup[0].name).length << 1; - // if (firstMemberLen == 2) { - // if (groups != 1) { - // DESERIALIZE += indent + "case 2: {\n"; - // indentInc(); - // } - // if (memberGroup.length == 1) { - // const member = memberGroup[0]; - // const memberName = member.alias || member.name; - // DESERIALIZE += indent + `if (load(keyStart) == ${memberName.charCodeAt(0)}) this.${member.name} = JSON.__deserialize<${member.type}>(valStart, valEnd);\n`; - // if (groups != 1) DESERIALIZE += indent + "break;\n"; - // break; - // } - // DESERIALIZE += indent + "switch (load(keyStart)) {\n"; - // for (const member of memberGroup) { - // const memberName = member.alias || member.name; - // DESERIALIZE += indent + ` case ${memberName.charCodeAt(0)}: { // ${memberName}\n`; - // DESERIALIZE += indent + ` this.${member.name} = JSON.__deserialize<${member.type}>(valStart, valEnd);\n`; - // DESERIALIZE += indent + " break;\n"; - // DESERIALIZE += indent + " }\n"; - // } - // DESERIALIZE += indent + "}\n" - // if (groups != 1) { - // indentDec(); - // DESERIALIZE += indent + "}\n" - // } - // } else if (firstMemberLen == 4) { - // if (groups != 1) { - // DESERIALIZE += indent + "case 4: {\n"; - // indentInc(); - // } - // DESERIALIZE += indent + "switch (load(keyStart)) {\n"; - // for (const member of memberGroup) { - // const memberName = member.alias || member.name; - // DESERIALIZE += indent + ` case ${memberName.charCodeAt(0)}: { // ${memberName}\n`; - // DESERIALIZE += indent + ` this.${member.name} = JSON.__deserialize<${member.type}>(valStart, valEnd);\n`; - // DESERIALIZE += indent + " break;\n"; - // DESERIALIZE += indent + " }\n"; - // } - // DESERIALIZE += indent + "}\n" - // if (groups != 1) { - // indentDec(); - // DESERIALIZE += indent + "}\n" - // } - // } /*else if (firstMemberLen == 8) { - // if (groups != 1) { - // DESERIALIZE += indent + "case 8: {\n"; - // indentInc(); - // } - // DESERIALIZE += indent + "switch ((load(keyStart)) {\n"; - // for (const member of memberGroup) { - // const memberName = member.alias || member.name; - // DESERIALIZE += indent + ` case ${}: { // ${memberName}\n`; - // DESERIALIZE += indent + ` this.${member.name} = JSON.__deserialize<${member.type}>(valStart, valEnd);\n`; - // DESERIALIZE += indent + " break;\n"; - // DESERIALIZE += indent + " }\n"; - // } - // DESERIALIZE += indent + "}\n" - // if (groups != 1) { - // indentDec(); - // DESERIALIZE += indent + "}\n" - // } - // } */else if (memberGroup.length > 1) { - // if (groups != 1) { - // DESERIALIZE += indent + "case " + firstMemberLen + ": {\n"; - // indentInc(); - // } - // DESERIALIZE += indent + "switch (load(keyStart)) {\n"; - // for (const member of memberGroup) { - // const memberName = member.alias || member.name; - // DESERIALIZE += indent + ` case ${memberName.charCodeAt(0)}: { // ${memberName}\n`; - // DESERIALIZE += indent + ` this.${member.name} = JSON.__deserialize<${member.type}>(valStart, valEnd);\n`; - // DESERIALIZE += indent + " break;\n"; - // DESERIALIZE += indent + " }\n"; - // } - // DESERIALIZE += indent + "}\n" - // if (groups != 1) { - // indentDec(); - // DESERIALIZE += indent + "}\n" - // } - // } + indentInc(); + for (const memberGroup of sortedMembers) { + const memberLen = (memberGroup[0].alias || memberGroup[0].name).length << 1 + DESERIALIZE += `${indent}case ${memberLen}: {\n`; indentInc(); + if (memberLen == 2) DESERIALIZE += `${indent}switch (load(keyStart)) {\n`; + if (memberLen == 4) DESERIALIZE += `${indent}switch (load(keyStart)) {\n`; + if (memberLen == 8) DESERIALIZE += `${indent}switch (load(keyStart)) {\n`; + for (let i = 0; i < memberGroup.length; i++) { + const member = memberGroup[i]; + const memberName = member.alias || member.name; + if (memberLen == 2) { + DESERIALIZE += `${indent} case ${memberName.charCodeAt(0)}: { // ${memberName}\n`; + DESERIALIZE += `${indent} store<${member.type}>(ptr, JSON.__deserialize<${member.type}>(valStart, valEnd), offsetof(${JSON.stringify(member.name)}));\n`; + DESERIALIZE += `${indent} return;\n`; + DESERIALIZE += `${indent} }\n`; + } else if (memberLen == 4) { + DESERIALIZE += `${indent} case ${strToNum(memberName)[1]}: { // ${memberName}\n`; + DESERIALIZE += `${indent} store<${member.type}>(ptr, JSON.__deserialize<${member.type}>(valStart, valEnd), offsetof(${JSON.stringify(member.name)}));\n`; + DESERIALIZE += `${indent} return;\n`; + DESERIALIZE += `${indent} }\n`; + } else if (memberLen == 8) { + DESERIALIZE += `${indent} case ${strToNum(memberName)[1]}: { // ${memberName}\n`; + DESERIALIZE += `${indent} store<${member.type}>(ptr, JSON.__deserialize<${member.type}>(valStart, valEnd), offsetof(${JSON.stringify(member.name)}));\n`; + DESERIALIZE += `${indent} return;\n`; + DESERIALIZE += `${indent} }\n`; + } + } + DESERIALIZE += `${indent}}\n`; + indentDec(); } - // if (groups != 1) { - // DESERIALIZE += " } \n"; - // DESERIALIZE += "} "; - // } else { - // DESERIALIZE += "} "; - // } - DESERIALIZE += "}" + DESERIALIZE += `${indent}}\n` + indentDec(); + DESERIALIZE += `${indent}}\n` + indentDec(); + DESERIALIZE += `${indent}}\n` indent = " "; this.schema.byteSize += 2; - SERIALIZE_BS += indent + "store(bs.offset, 125, 0); // }\n"; - SERIALIZE_BS += indent + "bs.offset += 2;\n"; - SERIALIZE_BS += "}"; - - SERIALIZE += indent + `this.__ALLOCATE();\n`; - SERIALIZE += indent + `this.__SERIALIZE_BS(ptr, true);\n`; - SERIALIZE += indent + `return bs.out();\n`; + SERIALIZE += indent + "store(bs.offset, 125, 0); // }\n"; + SERIALIZE += indent + "bs.offset += 2;\n"; SERIALIZE += "}"; - indentDec(); - indentInc(); ALLOCATE += indent + "bs.ensureSize(" + this.schema.byteSize + ");\n"; ALLOCATE += "}"; if (process.env["JSON_DEBUG"]) { console.log(SERIALIZE); - console.log(SERIALIZE_BS); // console.log(INITIALIZE); console.log(DESERIALIZE); console.log(ALLOCATE); } const SERIALIZE_METHOD = SimpleParser.parseClassMember(SERIALIZE, node); - const SERIALIZE_BS_METHOD = SimpleParser.parseClassMember(SERIALIZE_BS, node); // const INITIALIZE_METHOD = SimpleParser.parseClassMember(INITIALIZE, node); const DESERIALIZE_METHOD = SimpleParser.parseClassMember(DESERIALIZE, node); const ALLOCATE_METHOD = SimpleParser.parseClassMember(ALLOCATE, node); if (!node.members.find((v) => v.name.text == "__SERIALIZE")) node.members.push(SERIALIZE_METHOD); - if (!node.members.find((v) => v.name.text == "__SERIALIZE_BS")) node.members.push(SERIALIZE_BS_METHOD); // if (!node.members.find((v) => v.name.text == "__INITIALIZE")) node.members.push(INITIALIZE_METHOD); if (!node.members.find((v) => v.name.text == "__DESERIALIZE")) node.members.push(DESERIALIZE_METHOD); if (!node.members.find((v) => v.name.text == "__ALLOCATE")) node.members.push(ALLOCATE_METHOD); @@ -376,9 +299,9 @@ class JSONTransform extends Visitor { } generateEmptyMethods(node: ClassDeclaration): void { let SERIALIZE_RAW_EMPTY = '@inline __SERIALIZE(ptr: usize = changetype(this)): string {\n return "{}";\n}'; - let SERIALIZE_BS_EMPTY = "@inline __SERIALIZE_BS(ptr: usize, staticSize: bool): void {\n store(bs.offset, 8192123);\n bs.offset += 4;\n}"; + let SERIALIZE_BS_EMPTY = "@inline __SERIALIZE(ptr: usize: bool): void {\n store(bs.offset, 8192123);\n bs.offset += 4;\n}"; let INITIALIZE_EMPTY = "@inline __INITIALIZE(): this {\n return this;\n}"; - let DESERIALIZE_EMPTY = "@inline __DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize): void {\n return false;\n}"; + let DESERIALIZE_EMPTY = "@inline __DESERIALIZE(keyStart: usize, keyEnd: usize, valStart: usize, valEnd: usize, ptr: usize): void {\n return false;\n}"; let ALLOCATE_EMPTY = "@inline __ALLOCATE(): void {\n bs.ensureSize(4);\n}"; if (process.env["JSON_DEBUG"]) { @@ -396,7 +319,7 @@ class JSONTransform extends Visitor { const ALLOCATE_METHOD_EMPTY = SimpleParser.parseClassMember(ALLOCATE_EMPTY, node); if (!node.members.find((v) => v.name.text == "__SERIALIZE")) node.members.push(SERIALIZE_RAW_METHOD_EMPTY); - if (!node.members.find((v) => v.name.text == "__SERIALIZE_BS")) node.members.push(SERIALIZE_BS_METHOD_EMPTY); + if (!node.members.find((v) => v.name.text == "__SERIALIZE")) node.members.push(SERIALIZE_BS_METHOD_EMPTY); if (!node.members.find((v) => v.name.text == "__INITIALIZE")) node.members.push(INITIALIZE_METHOD_EMPTY); if (!node.members.find((v) => v.name.text == "__DESERIALIZE")) node.members.push(DESERIALIZE_METHOD_EMPTY); if (!node.members.find((v) => v.name.text == "__ALLOCATE")) node.members.push(ALLOCATE_METHOD_EMPTY);