From 3b97e73b0ee1b4b0de6a3edb4cdd479dec3b7570 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Wed, 30 Nov 2022 13:33:16 -0500 Subject: [PATCH 01/12] In this pull request, the Signature class becomes immutable. The reason being is because signature type lookups have become a big bottleneck for libraries that have a lot of type signatures. We can uniquely identify these signatures by calculating their string representation using signature.toString(). This causes a lot of not so very straightforward problems within the compiler, the program, and the resolver. For instance, the compiler now has to call the `newStub` function with the maximum arguments, and when resolving a type in the resolver, we are not allowed to simply modify the return type of signatures, and instead we create a new one to obtain the proper function type id at instantiation time. Changes involved: - compiler tests fixtures updated - Signatures are now immutable - Some changes involving signatureReference equality have changed --- src/compiler.ts | 7 +-- src/program.ts | 6 +- src/resolver.ts | 16 ++++-- src/types.ts | 85 +++++++++++++++++++---------- tests/compiler/builtins.debug.wat | 8 +-- tests/compiler/builtins.release.wat | 6 +- 6 files changed, 78 insertions(+), 50 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index 0ee4365ecb..dba51c522a 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -6430,8 +6430,8 @@ export class Compiler extends DiagnosticEmitter { assert(operandIndex == minOperands); // create the varargs stub - stub = original.newStub("varargs"); - stub.signature.requiredParameters = maxArguments; + stub = original.newStub("varargs", maxArguments); + original.varargsStub = stub; // compile initializers of omitted arguments in the scope of the stub, @@ -7102,8 +7102,7 @@ export class Compiler extends DiagnosticEmitter { } } - let signature = new Signature(this.program, parameterTypes, returnType, thisType); - signature.requiredParameters = numParameters; // ! + let signature = new Signature(this.program, parameterTypes, returnType, thisType, numParameters); instance = new Function( prototype.name, prototype, diff --git a/src/program.ts b/src/program.ts index 63360df1be..8d7948c833 100644 --- a/src/program.ts +++ b/src/program.ts @@ -472,7 +472,7 @@ export class Program extends DiagnosticEmitter { /** Managed classes contained in the program, by id. */ managedClasses: Map = new Map(); /** A set of unique function signatures contained in the program, by id. */ - uniqueSignatures: Signature[] = new Array(0); + uniqueSignatures: Map = new Map(); /** Module exports. */ moduleExports: Map = new Map(); /** Module imports. */ @@ -3826,12 +3826,12 @@ export class Function extends TypedElement { } /** Creates a stub for use with this function, i.e. for varargs or override calls. */ - newStub(postfix: string): Function { + newStub(postfix: string, requiredParameters: i32 = this.signature.requiredParameters): Function { let stub = new Function( this.original.name + STUB_DELIMITER + postfix, this.prototype, this.typeArguments, - this.signature.clone(), + this.signature.clone(requiredParameters), this.contextualTypeArguments ); stub.original = this.original; diff --git a/src/resolver.ts b/src/resolver.ts index f9baff992d..dc57e3110e 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -422,9 +422,7 @@ export class Resolver extends DiagnosticEmitter { ); if (!returnType) return null; } - let signature = new Signature(this.program, parameterTypes, returnType, thisType); - signature.requiredParameters = requiredParameters; - signature.hasRest = hasRest; + let signature = new Signature(this.program, parameterTypes, returnType, thisType, requiredParameters, hasRest); return node.isNullable ? signature.type.asNullable() : signature.type; } @@ -2706,7 +2704,14 @@ export class Resolver extends DiagnosticEmitter { } const type = this.resolveExpression(expr, tempFlow, ctxType, reportMode); if (type) { - signatureReference.returnType = type; + functionType.signatureReference = new Signature( + this.program, + signatureReference.parameterTypes, + type, + signatureReference.thisType, + signatureReference.requiredParameters, + signatureReference.hasRest, + ); } } return functionType; @@ -2853,8 +2858,7 @@ export class Resolver extends DiagnosticEmitter { returnType = type; } - let signature = new Signature(this.program, parameterTypes, returnType, thisType); - signature.requiredParameters = requiredParameters; + let signature = new Signature(this.program, parameterTypes, returnType, thisType, requiredParameters); let nameInclTypeParameters = prototype.name; if (instanceKey.length) nameInclTypeParameters += `<${instanceKey}>`; diff --git a/src/types.ts b/src/types.ts index a0074edc70..ee972e41f6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -421,13 +421,20 @@ export class Type { /** Tests if this type equals the specified. */ equals(other: Type): bool { - if (this.kind != other.kind) return false; + if (this.kind != other.kind) { + return false; + } if (this.isReference) { - return ( - this.classReference == other.classReference && - this.signatureReference == other.signatureReference && - this.isNullableReference == other.isNullableReference - ); + if (this.classReference != other.classReference) return false; + let selfSignatureReference = this.signatureReference; + let otherSignatureReference = other.signatureReference; + if (selfSignatureReference && otherSignatureReference) { + if (!selfSignatureReference.equals(otherSignatureReference)) return false; + } else { + if (selfSignatureReference != otherSignatureReference) return false; + } + + return this.isNullableReference == other.isNullableReference; } return true; } @@ -886,14 +893,10 @@ export class Signature { id: u32 = 0; /** Parameter types, if any, excluding `this`. */ parameterTypes: Type[]; - /** Number of required parameters excluding `this`. Other parameters are considered optional. */ - requiredParameters: i32; /** Return type. */ returnType: Type; /** This type, if an instance signature. */ thisType: Type | null; - /** Whether the last parameter is a rest parameter. */ - hasRest: bool; /** Respective function type. */ type: Type; /** The program that created this signature. */ @@ -904,14 +907,16 @@ export class Signature { program: Program, parameterTypes: Type[] | null = null, returnType: Type | null = null, - thisType: Type | null = null + thisType: Type | null = null, + /** Number of required parameters excluding `this`. Other parameters are considered optional. */ + public readonly requiredParameters: i32 = parameterTypes ? parameterTypes.length : 0, + /** Whether the last parameter is a rest parameter. */ + public readonly hasRest: bool = false, ) { this.parameterTypes = parameterTypes ? parameterTypes : []; - this.requiredParameters = 0; this.returnType = returnType ? returnType : Type.void; this.thisType = thisType; this.program = program; - this.hasRest = false; let usizeType = program.options.usizeType; let type = new Type( usizeType.kind, @@ -922,16 +927,20 @@ export class Signature { type.signatureReference = this; let signatureTypes = program.uniqueSignatures; - let length = signatureTypes.length; - for (let i = 0; i < length; i++) { - let compare = unchecked(signatureTypes[i]); - if (this.equals(compare)) { - this.id = compare.id; - return this; + let compareString = this.toString(); + if (signatureTypes.has(compareString)) { + let existing = signatureTypes.get(compareString)!; + if (!this.equals(existing)) { + trace(compareString); + trace(existing.toString()); } + assert(this.equals(existing), "Types don't match"); + this.id = existing.id; + return this; } + this.id = program.nextSignatureId++; - signatureTypes.push(this); + signatureTypes.set(compareString, this); } get paramRefs(): TypeRef { @@ -965,25 +974,38 @@ export class Signature { if (thisThisType) { if (!otherThisType || !thisThisType.equals(otherThisType)) return false; } else if (otherThisType) { + trace("failed on thisThisType"); return false; } // check rest parameter - if (this.hasRest != other.hasRest) return false; + if (this.hasRest != other.hasRest) { + trace("failed on hasRest"); + return false; + } // check return type - if (!this.returnType.equals(other.returnType)) return false; + if (!this.returnType.equals(other.returnType)) { + trace("failed on returnType"); + return false; + } // check parameter types - let thisParameterTypes = this.parameterTypes; + let selfParameterTypes = this.parameterTypes; let otherParameterTypes = other.parameterTypes; - let numParameters = thisParameterTypes.length; - if (numParameters != otherParameterTypes.length) return false; + let numParameters = selfParameterTypes.length; + if (numParameters != otherParameterTypes.length) { + trace("failed on numParameters"); + return false; + } for (let i = 0; i < numParameters; ++i) { - let thisParameterType = unchecked(thisParameterTypes[i]); + let selfParameterType = unchecked(selfParameterTypes[i]); let otherParameterType = unchecked(otherParameterTypes[i]); - if (!thisParameterType.equals(otherParameterType)) return false; + if (!selfParameterType.equals(otherParameterType)) { + trace("failed on selfParameterType"); + return false; + } } return true; } @@ -1105,7 +1127,8 @@ export class Signature { let thisType = this.thisType; if (thisType) { sb.push(validWat ? "this:" : "this: "); - assert(!thisType.signatureReference); + // sometimes "this" can be a function type + // assert(!thisType.signatureReference); sb.push(thisType.toString(validWat)); index = 1; } @@ -1127,7 +1150,7 @@ export class Signature { } /** Creates a clone of this signature that is safe to modify. */ - clone(): Signature { + clone(requieredParameters: i32 = this.requiredParameters, hasRest: bool = this.hasRest): Signature { let parameterTypes = this.parameterTypes; let numParameterTypes = parameterTypes.length; let cloneParameterTypes = new Array(numParameterTypes); @@ -1138,7 +1161,9 @@ export class Signature { this.program, cloneParameterTypes, this.returnType, - this.thisType + this.thisType, + requieredParameters, + hasRest ); } } diff --git a/tests/compiler/builtins.debug.wat b/tests/compiler/builtins.debug.wat index 9986eafa4e..22e152bde3 100644 --- a/tests/compiler/builtins.debug.wat +++ b/tests/compiler/builtins.debug.wat @@ -3213,11 +3213,11 @@ local.set $48 i32.const 0 local.set $49 - i32.const 46 + i32.const 51 local.set $50 - i32.const 47 + i32.const 52 local.set $51 - i32.const 47 + i32.const 52 local.set $52 i32.const 256 local.set $63 @@ -3262,7 +3262,7 @@ unreachable end local.get $50 - i32.const 46 + i32.const 51 i32.eq i32.eqz if diff --git a/tests/compiler/builtins.release.wat b/tests/compiler/builtins.release.wat index de997e4994..7ef85acda2 100644 --- a/tests/compiler/builtins.release.wat +++ b/tests/compiler/builtins.release.wat @@ -735,9 +735,9 @@ i32.const 5 f64.const 0 f64.const 0 - f64.const 46 - f64.const 47 - f64.const 47 + f64.const 51 + f64.const 52 + f64.const 52 call $~lib/builtins/trace global.get $~lib/memory/__stack_pointer local.tee $0 From 10506ac96bd91fba148d903353397fafc9710901 Mon Sep 17 00:00:00 2001 From: jtenner Date: Thu, 1 Dec 2022 07:10:19 -0500 Subject: [PATCH 02/12] Update src/types.ts Remove comments Co-authored-by: dcode --- src/types.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index ee972e41f6..1ce70cbacc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1127,8 +1127,6 @@ export class Signature { let thisType = this.thisType; if (thisType) { sb.push(validWat ? "this:" : "this: "); - // sometimes "this" can be a function type - // assert(!thisType.signatureReference); sb.push(thisType.toString(validWat)); index = 1; } From 0ce4b53cd2c04027da87861db313a32711af985e Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Thu, 1 Dec 2022 12:37:16 -0500 Subject: [PATCH 03/12] nits --- package-lock.json | 1 + src/types.ts | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 59edf5a86b..5a5574e1f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "assemblyscript", "version": "0.0.0", "license": "Apache-2.0", "dependencies": { diff --git a/src/types.ts b/src/types.ts index 1ce70cbacc..feafe76d1a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -929,12 +929,8 @@ export class Signature { let signatureTypes = program.uniqueSignatures; let compareString = this.toString(); if (signatureTypes.has(compareString)) { - let existing = signatureTypes.get(compareString)!; - if (!this.equals(existing)) { - trace(compareString); - trace(existing.toString()); - } - assert(this.equals(existing), "Types don't match"); + let existing = assert(signatureTypes.get(compareString)); + assert(this.equals(existing)); this.id = existing.id; return this; } From 19b9fd66d15747f5bb2218d8c2d01a43f22e2b12 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Thu, 1 Dec 2022 12:37:51 -0500 Subject: [PATCH 04/12] type --- src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index feafe76d1a..b45701e3bd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1144,7 +1144,7 @@ export class Signature { } /** Creates a clone of this signature that is safe to modify. */ - clone(requieredParameters: i32 = this.requiredParameters, hasRest: bool = this.hasRest): Signature { + clone(requiredParameters: i32 = this.requiredParameters, hasRest: bool = this.hasRest): Signature { let parameterTypes = this.parameterTypes; let numParameterTypes = parameterTypes.length; let cloneParameterTypes = new Array(numParameterTypes); @@ -1156,7 +1156,7 @@ export class Signature { cloneParameterTypes, this.returnType, this.thisType, - requieredParameters, + requiredParameters, hasRest ); } From 671e17a0bab642dfeae2e3f5b44b870111c77481 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Thu, 1 Dec 2022 15:24:38 -0500 Subject: [PATCH 05/12] rename refactor --- output.txt | Bin 0 -> 3346 bytes src/compiler.ts | 2 +- src/program.ts | 2 +- src/types.ts | 64 +++++++++++++++++------------------------------- 4 files changed, 25 insertions(+), 43 deletions(-) create mode 100644 output.txt diff --git a/output.txt b/output.txt new file mode 100644 index 0000000000000000000000000000000000000000..9d2c6c60be4ebfad71da87bef586dbc2adaf6ba4 GIT binary patch literal 3346 zcmd6p+fEZv6oyygor&*Iuf!;AXsLyoXb5270#9Iwv0juOpg<4K3<5X4gzxDKn5f^s zhUsijMva1IGBf+Q_P_ph*z4<;kxgu9C2R5~7FpXm*7IJU_P`G5b(tI6h;K~q(E9eA zIjtSiPk1BSvQs4W?3UfMCB{mu8?Z;R=IC{7&-bWT_f_{8%}$T($mQ?w*O^^=IGvOH z*d(kEGgnu#ll)1z< zoskY2^?Ajk=4P1rbDo<>mmG1tYj=_R#@^a}{x3Oc=;!xr6?SCL32O(8jhv|rtu%WA zkB2;`_JUU1t(Ku(MSjGt2z})Psb*qgVDFK-%-oQtjodD0Wvf&6^wsY z{)neXdxdWdBZ=FxMJ|xG`;2xNYfYtP_KX92w%D0qsTPdLuf(pbF1g~eOX~zg`>a!@ zShNNI&*9;h>#)JDtH&LohnPt7TN~?(xx>EF|MFp8I8r=7>yM_ioKDumd56F z>2MxJG}WXE+Yek9X;j4cHky<{9>(SdJ;k7`sl1a}_`0+@k0#e@0Sh&-&pg`wEu9p@ zR~;v*zg@0X<19Aje_N}6jlJ%Xt@tj+9(q*S*0_bP3wfT4X6@KB+He{rHR_it{#4^z z{ZSz0rP{*5e z$JL02@P-T9>o8x!E~D_v{_LwE8YHlHwSFBcZAZ5l);_@hs`$S00l}J>ZNnXjP}|F|OKO t_ojSk*DIktR_;vilS*Ml_%pvz{T8304iSd!Ew98zUe%?n-ga%Y<{N0~T}A)^ literal 0 HcmV?d00001 diff --git a/src/compiler.ts b/src/compiler.ts index dba51c522a..f21b4325ad 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -8668,7 +8668,7 @@ export class Compiler extends DiagnosticEmitter { ) ), null, - new Signature(this.program, null, classInstance.type, classInstance.type), + new Signature(this.program, [], classInstance.type, classInstance.type), contextualTypeArguments ); } diff --git a/src/program.ts b/src/program.ts index 8d7948c833..7ab84021a4 100644 --- a/src/program.ts +++ b/src/program.ts @@ -3217,7 +3217,7 @@ export class File extends Element { program.filesByName.set(this.internalName, this); let startFunction = this.program.makeNativeFunction( `start:${this.internalName}`, - new Signature(program, null, Type.void), + new Signature(program, [], Type.void), this ); startFunction.internalName = startFunction.name; diff --git a/src/types.ts b/src/types.ts index b45701e3bd..3a45931cbd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -425,16 +425,18 @@ export class Type { return false; } if (this.isReference) { - if (this.classReference != other.classReference) return false; let selfSignatureReference = this.signatureReference; let otherSignatureReference = other.signatureReference; - if (selfSignatureReference && otherSignatureReference) { - if (!selfSignatureReference.equals(otherSignatureReference)) return false; - } else { - if (selfSignatureReference != otherSignatureReference) return false; - } - return this.isNullableReference == other.isNullableReference; + return ( + this.classReference == other.classReference + && ( + selfSignatureReference && otherSignatureReference + ? selfSignatureReference.equals(otherSignatureReference) + : selfSignatureReference == otherSignatureReference + ) + && this.isNullableReference == other.isNullableReference + ); } return true; } @@ -890,33 +892,26 @@ export function typesToString(types: Type[]): string { /** Represents a fully resolved function signature. */ export class Signature { /** Unique id representing this signature. */ - id: u32 = 0; - /** Parameter types, if any, excluding `this`. */ - parameterTypes: Type[]; - /** Return type. */ - returnType: Type; - /** This type, if an instance signature. */ - thisType: Type | null; + public readonly id: u32 = 0; /** Respective function type. */ - type: Type; - /** The program that created this signature. */ - program: Program; + public readonly type: Type; /** Constructs a new signature. */ constructor( - program: Program, - parameterTypes: Type[] | null = null, - returnType: Type | null = null, - thisType: Type | null = null, + /** The program that created this signature. */ + public readonly program: Program, + /** Parameter types, if any, excluding `this`. */ + public readonly parameterTypes: Type[] = [], + /** Return type. */ + public readonly returnType: Type = Type.void, + /** This type, if an instance signature. */ + public readonly thisType: Type | null = null, /** Number of required parameters excluding `this`. Other parameters are considered optional. */ public readonly requiredParameters: i32 = parameterTypes ? parameterTypes.length : 0, /** Whether the last parameter is a rest parameter. */ public readonly hasRest: bool = false, ) { - this.parameterTypes = parameterTypes ? parameterTypes : []; - this.returnType = returnType ? returnType : Type.void; this.thisType = thisType; - this.program = program; let usizeType = program.options.usizeType; let type = new Type( usizeType.kind, @@ -970,38 +965,25 @@ export class Signature { if (thisThisType) { if (!otherThisType || !thisThisType.equals(otherThisType)) return false; } else if (otherThisType) { - trace("failed on thisThisType"); return false; } // check rest parameter - if (this.hasRest != other.hasRest) { - trace("failed on hasRest"); - return false; - } + if (this.hasRest != other.hasRest) return false; // check return type - if (!this.returnType.equals(other.returnType)) { - trace("failed on returnType"); - return false; - } + if (!this.returnType.equals(other.returnType)) return false; // check parameter types let selfParameterTypes = this.parameterTypes; let otherParameterTypes = other.parameterTypes; let numParameters = selfParameterTypes.length; - if (numParameters != otherParameterTypes.length) { - trace("failed on numParameters"); - return false; - } + if (numParameters != otherParameterTypes.length) return false; for (let i = 0; i < numParameters; ++i) { let selfParameterType = unchecked(selfParameterTypes[i]); let otherParameterType = unchecked(otherParameterTypes[i]); - if (!selfParameterType.equals(otherParameterType)) { - trace("failed on selfParameterType"); - return false; - } + if (!selfParameterType.equals(otherParameterType)) return false; } return true; } From 0196ec172e418583dade22521e8c6c1a26a55ee7 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Thu, 1 Dec 2022 15:34:32 -0500 Subject: [PATCH 06/12] rename uniqueKey --- src/types.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types.ts b/src/types.ts index 3a45931cbd..2ddb236ac2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -922,16 +922,16 @@ export class Signature { type.signatureReference = this; let signatureTypes = program.uniqueSignatures; - let compareString = this.toString(); - if (signatureTypes.has(compareString)) { - let existing = assert(signatureTypes.get(compareString)); + let uniqueKey = this.toString(); + if (signatureTypes.has(uniqueKey)) { + let existing = assert(signatureTypes.get(uniqueKey)); assert(this.equals(existing)); this.id = existing.id; return this; } this.id = program.nextSignatureId++; - signatureTypes.set(compareString, this); + signatureTypes.set(uniqueKey, this); } get paramRefs(): TypeRef { From 9ab2beaafbea235ffd881a78b9a0a5294e67de9f Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Thu, 1 Dec 2022 17:51:45 -0500 Subject: [PATCH 07/12] fix types --- output.txt | Bin 3346 -> 0 bytes src/types.ts | 8 ++------ 2 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index 9d2c6c60be4ebfad71da87bef586dbc2adaf6ba4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3346 zcmd6p+fEZv6oyygor&*Iuf!;AXsLyoXb5270#9Iwv0juOpg<4K3<5X4gzxDKn5f^s zhUsijMva1IGBf+Q_P_ph*z4<;kxgu9C2R5~7FpXm*7IJU_P`G5b(tI6h;K~q(E9eA zIjtSiPk1BSvQs4W?3UfMCB{mu8?Z;R=IC{7&-bWT_f_{8%}$T($mQ?w*O^^=IGvOH z*d(kEGgnu#ll)1z< zoskY2^?Ajk=4P1rbDo<>mmG1tYj=_R#@^a}{x3Oc=;!xr6?SCL32O(8jhv|rtu%WA zkB2;`_JUU1t(Ku(MSjGt2z})Psb*qgVDFK-%-oQtjodD0Wvf&6^wsY z{)neXdxdWdBZ=FxMJ|xG`;2xNYfYtP_KX92w%D0qsTPdLuf(pbF1g~eOX~zg`>a!@ zShNNI&*9;h>#)JDtH&LohnPt7TN~?(xx>EF|MFp8I8r=7>yM_ioKDumd56F z>2MxJG}WXE+Yek9X;j4cHky<{9>(SdJ;k7`sl1a}_`0+@k0#e@0Sh&-&pg`wEu9p@ zR~;v*zg@0X<19Aje_N}6jlJ%Xt@tj+9(q*S*0_bP3wfT4X6@KB+He{rHR_it{#4^z z{ZSz0rP{*5e z$JL02@P-T9>o8x!E~D_v{_LwE8YHlHwSFBcZAZ5l);_@hs`$S00l}J>ZNnXjP}|F|OKO t_ojSk*DIktR_;vilS*Ml_%pvz{T8304iSd!Ew98zUe%?n-ga%Y<{N0~T}A)^ diff --git a/src/types.ts b/src/types.ts index 2ddb236ac2..a18d596a1f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -430,11 +430,7 @@ export class Type { return ( this.classReference == other.classReference - && ( - selfSignatureReference && otherSignatureReference - ? selfSignatureReference.equals(otherSignatureReference) - : selfSignatureReference == otherSignatureReference - ) + && selfSignatureReference == otherSignatureReference && this.isNullableReference == other.isNullableReference ); } @@ -927,7 +923,7 @@ export class Signature { let existing = assert(signatureTypes.get(uniqueKey)); assert(this.equals(existing)); this.id = existing.id; - return this; + return existing; } this.id = program.nextSignatureId++; From c934d886c1bd0f180ce94938f06431c7febfc832 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Mon, 5 Dec 2022 00:35:28 -0500 Subject: [PATCH 08/12] refactor to private constructor for signature --- output.txt | Bin 0 -> 137702 bytes src/compiler.ts | 6 ++--- src/program.ts | 2 +- src/resolver.ts | 6 ++--- src/types.ts | 67 ++++++++++++++++++++++++++++++++---------------- 5 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 output.txt diff --git a/output.txt b/output.txt new file mode 100644 index 0000000000000000000000000000000000000000..d963126ab11ee5c05a14b4069e56295d8f53e755 GIT binary patch literal 137702 zcmeI5>2e&`m7ptP{yAcvVE#bzbc0$zkN~(@w7O+VbZDZR@@Q%QP}mA?pkRZf8YH#Z zt(TaGnrE38=$|ulzC1WM=VsoURhgAlnE)yfWEBdTS@)iOzyI(5zL9?b5~KC3>tR$cSa?2Fmn?E36lb@eB+ALZVY+0)r8`8k@soV}3y zkL3N9yn8zPUjCiP`)&E{&Folywr5vo|8@4O*+;Y2^7*k`%XPnzCvMFi&%T{Kl9--?!p*!H-hpy`@wRJ_D8gE^f{Tda4L3k^7|9{SS z%Kw%XfuSu~J$wdFy`JsJC-9qb7IgkKGf6&k;VsCyfe#Yl#n$>KQc8lzBWi?_4Vf#N4%Si1&^GTkHb%ec*-T6qYQ!J=0 z`Q)d{qE=7D={j00_#pI|BvM9z;RpN z&tJi=T)Qn-zp3m}h4a(O`o}k;KkWB=!hXNx}ECBc(wnXE<_`Z^3Xav4bzhi6mcX@A5Tnxv)E7iXSVS|_QZB9E7$spqPxQYX)?dH4C zNB~;lb|-w*}ZtM>I(CDTvj8<5__bBNVx^yzJ(h|eT8_;yVWm*k6M?TXxE_r4S2 zFhqb(W`C_{iAWI8)mOCm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oxUahFu>T40qn z)FRx2N8QJk>RYcAD&4L(dL8`w)j>z4|JWRt zlSWEIR2P)#XmxOzh9rvCd!1(9t90TxR5Jz3{-$VA=Ma}ge2Oem`nh`gTBf1($s$&a z3?Ew--Art)6i(yGB33oNhPx?QBB!bpHsi=5Rx|~;M9rVVg}!k(ZVXv;^Hjf&tHEw2 z^ATMZndfppSdl-s=(BaoBCYosTNd3CY3Tfx!f8BN#Hz;Uxm%T8Z8mcXn{i|jE1Cja zqUKNGGNvrLb*kUTl|{D_Ps3#qdM(;Tc>B|kMXVUA8ebMgKjbix*<;G0Dfl9{WVVFM z=@d3&$)YKEA-59EpTcEaS)}^Ck1QIh^6hq_zdS-!&)8b7oP6qu)Ll`9q17T*4Z`n4 z)5#a&*)i+xxK?f9)LDuOSQNKZ@uN>zB(KNL+Vo(#x(6$|Z+%bydmSQ<1wPYrjQ4yi1Tk19^za9W{`s$|7=Ho_jv+34@UoIz9rW&;pS(-*NIH=&}lh(-Z8mfW*ERL zicju%C7;GKk3HkrmLHChTGMn)KS0khbzI-!KW&M3Np`?!E$%s=4Q;o@4SLOc>-4h> z(); @@ -7102,7 +7102,7 @@ export class Compiler extends DiagnosticEmitter { } } - let signature = new Signature(this.program, parameterTypes, returnType, thisType, numParameters); + let signature = Signature.new(this.program, parameterTypes, returnType, thisType, numParameters); instance = new Function( prototype.name, prototype, @@ -8668,7 +8668,7 @@ export class Compiler extends DiagnosticEmitter { ) ), null, - new Signature(this.program, [], classInstance.type, classInstance.type), + Signature.new(this.program, [], classInstance.type, classInstance.type), contextualTypeArguments ); } diff --git a/src/program.ts b/src/program.ts index 7ab84021a4..d7c43ed400 100644 --- a/src/program.ts +++ b/src/program.ts @@ -3217,7 +3217,7 @@ export class File extends Element { program.filesByName.set(this.internalName, this); let startFunction = this.program.makeNativeFunction( `start:${this.internalName}`, - new Signature(program, [], Type.void), + Signature.new(program, [], Type.void), this ); startFunction.internalName = startFunction.name; diff --git a/src/resolver.ts b/src/resolver.ts index dc57e3110e..1e94a31051 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -422,7 +422,7 @@ export class Resolver extends DiagnosticEmitter { ); if (!returnType) return null; } - let signature = new Signature(this.program, parameterTypes, returnType, thisType, requiredParameters, hasRest); + let signature = Signature.new(this.program, parameterTypes, returnType, thisType, requiredParameters, hasRest); return node.isNullable ? signature.type.asNullable() : signature.type; } @@ -2704,7 +2704,7 @@ export class Resolver extends DiagnosticEmitter { } const type = this.resolveExpression(expr, tempFlow, ctxType, reportMode); if (type) { - functionType.signatureReference = new Signature( + functionType.signatureReference = Signature.new( this.program, signatureReference.parameterTypes, type, @@ -2858,7 +2858,7 @@ export class Resolver extends DiagnosticEmitter { returnType = type; } - let signature = new Signature(this.program, parameterTypes, returnType, thisType, requiredParameters); + let signature = Signature.new(this.program, parameterTypes, returnType, thisType, requiredParameters); let nameInclTypeParameters = prototype.name; if (instanceKey.length) nameInclTypeParameters += `<${instanceKey}>`; diff --git a/src/types.ts b/src/types.ts index a18d596a1f..25d9526ae0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -887,49 +887,72 @@ export function typesToString(types: Type[]): string { /** Represents a fully resolved function signature. */ export class Signature { - /** Unique id representing this signature. */ - public readonly id: u32 = 0; - /** Respective function type. */ - public readonly type: Type; + - /** Constructs a new signature. */ - constructor( + public static new( /** The program that created this signature. */ - public readonly program: Program, + program: Program, /** Parameter types, if any, excluding `this`. */ - public readonly parameterTypes: Type[] = [], + parameterTypes: Type[] = [], /** Return type. */ - public readonly returnType: Type = Type.void, + returnType: Type = Type.void, /** This type, if an instance signature. */ - public readonly thisType: Type | null = null, + thisType: Type | null = null, /** Number of required parameters excluding `this`. Other parameters are considered optional. */ - public readonly requiredParameters: i32 = parameterTypes ? parameterTypes.length : 0, + requiredParameters: i32 = parameterTypes ? parameterTypes.length : 0, /** Whether the last parameter is a rest parameter. */ - public readonly hasRest: bool = false, - ) { - this.thisType = thisType; + hasRest: bool = false, + ): Signature { + // get the usize type, and the type of the signature let usizeType = program.options.usizeType; let type = new Type( usizeType.kind, usizeType.flags & ~TypeFlags.Value | TypeFlags.Reference, usizeType.size ); - this.type = type; - type.signatureReference = this; + // calculate the properties let signatureTypes = program.uniqueSignatures; - let uniqueKey = this.toString(); + let nextId = program.nextSignatureId; + + // construct the signature and calculate it's unique key + let signature = new Signature(program, parameterTypes, returnType, thisType, requiredParameters, hasRest, nextId, type);; + let uniqueKey = signature.toString(); + + // check if it exists, and return it if (signatureTypes.has(uniqueKey)) { let existing = assert(signatureTypes.get(uniqueKey)); - assert(this.equals(existing)); - this.id = existing.id; + assert(signature.equals(existing)); return existing; } - this.id = program.nextSignatureId++; - signatureTypes.set(uniqueKey, this); + // otherwise increment the program's signature id, set the signature reference of the type, and memoize the signature + program.nextSignatureId = nextId + 1; + type.signatureReference = signature; + signatureTypes.set(uniqueKey, signature); + return signature; } + /** Constructs a new signature. */ + private constructor( + /** The program that created this signature. */ + public readonly program: Program, + /** Parameter types, if any, excluding `this`. */ + public readonly parameterTypes: Type[], + /** Return type. */ + public readonly returnType: Type, + /** This type, if an instance signature. */ + public readonly thisType: Type | null, + /** Number of required parameters excluding `this`. Other parameters are considered optional. */ + public readonly requiredParameters: i32, + /** Whether the last parameter is a rest parameter. */ + public readonly hasRest: bool, + /** Unique id representing this signature. */ + public readonly id: u32, + /** Respective function type. */ + public readonly type: Type, + ) {} + get paramRefs(): TypeRef { let thisType = this.thisType; let parameterTypes = this.parameterTypes; @@ -1129,7 +1152,7 @@ export class Signature { for (let i = 0; i < numParameterTypes; ++i) { unchecked(cloneParameterTypes[i] = parameterTypes[i]); } - return new Signature( + return Signature.new( this.program, cloneParameterTypes, this.returnType, From de15573dcdbad8837e1784357e9e6d518998fa35 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Mon, 5 Dec 2022 00:38:59 -0500 Subject: [PATCH 09/12] how did this get here? --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 25d9526ae0..df7acb80eb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -916,7 +916,7 @@ export class Signature { let nextId = program.nextSignatureId; // construct the signature and calculate it's unique key - let signature = new Signature(program, parameterTypes, returnType, thisType, requiredParameters, hasRest, nextId, type);; + let signature = new Signature(program, parameterTypes, returnType, thisType, requiredParameters, hasRest, nextId, type); let uniqueKey = signature.toString(); // check if it exists, and return it From b3a6e27fdd7e028ba3ba0fff11d3648c35d90f4e Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Mon, 5 Dec 2022 08:22:25 -0500 Subject: [PATCH 10/12] refactor to create --- src/compiler.ts | 6 +++--- src/program.ts | 2 +- src/resolver.ts | 6 +++--- src/types.ts | 5 ++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index 993ac353e5..c01ef852cc 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -474,7 +474,7 @@ export class Compiler extends DiagnosticEmitter { module.setFeatures(featureFlags); // set up the main start function - let startFunctionInstance = program.makeNativeFunction(BuiltinNames.start, Signature.new(program, [], Type.void)); + let startFunctionInstance = program.makeNativeFunction(BuiltinNames.start, Signature.create(program, [], Type.void)); startFunctionInstance.internalName = BuiltinNames.start; this.currentFlow = startFunctionInstance.flow; this.currentBody = new Array(); @@ -7102,7 +7102,7 @@ export class Compiler extends DiagnosticEmitter { } } - let signature = Signature.new(this.program, parameterTypes, returnType, thisType, numParameters); + let signature = Signature.create(this.program, parameterTypes, returnType, thisType, numParameters); instance = new Function( prototype.name, prototype, @@ -8668,7 +8668,7 @@ export class Compiler extends DiagnosticEmitter { ) ), null, - Signature.new(this.program, [], classInstance.type, classInstance.type), + Signature.create(this.program, [], classInstance.type, classInstance.type), contextualTypeArguments ); } diff --git a/src/program.ts b/src/program.ts index d7c43ed400..abfcfe6162 100644 --- a/src/program.ts +++ b/src/program.ts @@ -3217,7 +3217,7 @@ export class File extends Element { program.filesByName.set(this.internalName, this); let startFunction = this.program.makeNativeFunction( `start:${this.internalName}`, - Signature.new(program, [], Type.void), + Signature.create(program, [], Type.void), this ); startFunction.internalName = startFunction.name; diff --git a/src/resolver.ts b/src/resolver.ts index 1e94a31051..20005b954d 100644 --- a/src/resolver.ts +++ b/src/resolver.ts @@ -422,7 +422,7 @@ export class Resolver extends DiagnosticEmitter { ); if (!returnType) return null; } - let signature = Signature.new(this.program, parameterTypes, returnType, thisType, requiredParameters, hasRest); + let signature = Signature.create(this.program, parameterTypes, returnType, thisType, requiredParameters, hasRest); return node.isNullable ? signature.type.asNullable() : signature.type; } @@ -2704,7 +2704,7 @@ export class Resolver extends DiagnosticEmitter { } const type = this.resolveExpression(expr, tempFlow, ctxType, reportMode); if (type) { - functionType.signatureReference = Signature.new( + functionType.signatureReference = Signature.create( this.program, signatureReference.parameterTypes, type, @@ -2858,7 +2858,7 @@ export class Resolver extends DiagnosticEmitter { returnType = type; } - let signature = Signature.new(this.program, parameterTypes, returnType, thisType, requiredParameters); + let signature = Signature.create(this.program, parameterTypes, returnType, thisType, requiredParameters); let nameInclTypeParameters = prototype.name; if (instanceKey.length) nameInclTypeParameters += `<${instanceKey}>`; diff --git a/src/types.ts b/src/types.ts index df7acb80eb..bdf2f64ba2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -887,9 +887,8 @@ export function typesToString(types: Type[]): string { /** Represents a fully resolved function signature. */ export class Signature { - - public static new( + public static create( /** The program that created this signature. */ program: Program, /** Parameter types, if any, excluding `this`. */ @@ -1152,7 +1151,7 @@ export class Signature { for (let i = 0; i < numParameterTypes; ++i) { unchecked(cloneParameterTypes[i] = parameterTypes[i]); } - return Signature.new( + return Signature.create( this.program, cloneParameterTypes, this.returnType, From 212264e8786b85ae815a7f11873083bceb1bb945 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Mon, 5 Dec 2022 08:22:58 -0500 Subject: [PATCH 11/12] comment --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index bdf2f64ba2..baad2a89f5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -887,7 +887,7 @@ export function typesToString(types: Type[]): string { /** Represents a fully resolved function signature. */ export class Signature { - + /** Construct a new signature. */ public static create( /** The program that created this signature. */ program: Program, From e47b1c60a56ecd948e09680ab7b5df54154f1a92 Mon Sep 17 00:00:00 2001 From: Joshua Tenner Date: Mon, 5 Dec 2022 08:23:25 -0500 Subject: [PATCH 12/12] remove output.txt. artifact of debugging. --- output.txt | Bin 137702 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index d963126ab11ee5c05a14b4069e56295d8f53e755..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137702 zcmeI5>2e&`m7ptP{yAcvVE#bzbc0$zkN~(@w7O+VbZDZR@@Q%QP}mA?pkRZf8YH#Z zt(TaGnrE38=$|ulzC1WM=VsoURhgAlnE)yfWEBdTS@)iOzyI(5zL9?b5~KC3>tR$cSa?2Fmn?E36lb@eB+ALZVY+0)r8`8k@soV}3y zkL3N9yn8zPUjCiP`)&E{&Folywr5vo|8@4O*+;Y2^7*k`%XPnzCvMFi&%T{Kl9--?!p*!H-hpy`@wRJ_D8gE^f{Tda4L3k^7|9{SS z%Kw%XfuSu~J$wdFy`JsJC-9qb7IgkKGf6&k;VsCyfe#Yl#n$>KQc8lzBWi?_4Vf#N4%Si1&^GTkHb%ec*-T6qYQ!J=0 z`Q)d{qE=7D={j00_#pI|BvM9z;RpN z&tJi=T)Qn-zp3m}h4a(O`o}k;KkWB=!hXNx}ECBc(wnXE<_`Z^3Xav4bzhi6mcX@A5Tnxv)E7iXSVS|_QZB9E7$spqPxQYX)?dH4C zNB~;lb|-w*}ZtM>I(CDTvj8<5__bBNVx^yzJ(h|eT8_;yVWm*k6M?TXxE_r4S2 zFhqb(W`C_{iAWI8)mOCmt17Ysr5(!WP+b#7SgCc0M!RMeFh=@cFT%LQL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