@scriptc/compiler 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/cc-cache.test.js +308 -1
- package/dist/backend/cc-cache.test.js.map +1 -1
- package/dist/backend/cc.d.ts +6 -0
- package/dist/backend/cc.js +707 -68
- package/dist/backend/cc.js.map +1 -1
- package/dist/backend/emission/emit-exprs.js +53 -2
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emitter.d.ts +12 -5
- package/dist/backend/emission/emitter.js +160 -22
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/emission/may-throw.js +7 -4
- package/dist/backend/emission/may-throw.js.map +1 -1
- package/dist/backend/ffi-callbacks.d.ts +38 -1
- package/dist/backend/ffi-callbacks.js +76 -3
- package/dist/backend/ffi-callbacks.js.map +1 -1
- package/dist/backend/llvm/emitter.js +243 -12
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/diagnostics/diagnostic.js +2 -0
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/ffi/profile.d.ts +17 -5
- package/dist/ffi/profile.js +169 -22
- package/dist/ffi/profile.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +1 -0
- package/dist/frontend/lowering/lower-calls.js +89 -23
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +65 -19
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +12 -0
- package/dist/frontend/lowering/lowerer.js +20 -1
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/ts7/checker.d.ts +2 -0
- package/dist/frontend/ts7/checker.js +20 -3
- package/dist/frontend/ts7/checker.js.map +1 -1
- package/dist/frontend/types.d.ts +8 -0
- package/dist/frontend/types.js +33 -5
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +22 -9
- package/dist/ir/nodes.js +7 -1
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +1 -1
- package/dist/ir/validate.js +74 -1
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/int-infer.test.js +4 -4
- package/dist/library/profile.d.ts +3 -0
- package/dist/library/profile.js +9 -1
- package/dist/library/profile.js.map +1 -1
- package/package.json +2 -2
- package/surface-manifest.json +1 -1
|
@@ -511,6 +511,16 @@ export declare class Lowerer {
|
|
|
511
511
|
/** Union re-tag helpers (%union.retag.N), interned per (from, to)
|
|
512
512
|
* unionId pair — see unionRetagHelper. */
|
|
513
513
|
readonly retagHelpers: Map<string, string>;
|
|
514
|
+
/** Callee names of every interned coercion helper whose CALL mints a
|
|
515
|
+
* FRESH closure per evaluation (%fn.width.*, %fn.adapt.*,
|
|
516
|
+
* %fnval.spawnres.*). Registered at the mint site — NOT recovered by
|
|
517
|
+
* name-prefix matching — because retained-FFI release identity is the
|
|
518
|
+
* runtime closure pointer: a coercion adapter allocates a different
|
|
519
|
+
* closure at the registration and release sites, so lowerFfiCall must
|
|
520
|
+
* refuse these forms at compile time (SC5003). Any new closure-minting
|
|
521
|
+
* adapter helper MUST add its name here, or the identity guard silently
|
|
522
|
+
* reopens and the mismatch surfaces as a runtime release trap instead. */
|
|
523
|
+
readonly freshClosureAdapters: Set<string>;
|
|
514
524
|
/** Symbols bound by `const x = promisify(execFile)` — the one lowered
|
|
515
525
|
* util.promisify shape. Declarations register here and emit nothing;
|
|
516
526
|
* calls through the binding lower (lowerExecFileAsyncCall) and value
|
|
@@ -706,6 +716,8 @@ export declare class Lowerer {
|
|
|
706
716
|
* IrModule.unions. An arm's index in the canonical list is its runtime
|
|
707
717
|
* tag. */
|
|
708
718
|
readonly unions: UnionRegistry;
|
|
719
|
+
/** Context-free successful type mappings. See TypeMapperCtx.typeMemo. */
|
|
720
|
+
readonly typeMemo: Map<string, IrType>;
|
|
709
721
|
readonly ambient: string;
|
|
710
722
|
readonly overridesAmbient: string;
|
|
711
723
|
readonly fallbackAmbient: string;
|
|
@@ -700,6 +700,16 @@ export class Lowerer {
|
|
|
700
700
|
/** Union re-tag helpers (%union.retag.N), interned per (from, to)
|
|
701
701
|
* unionId pair — see unionRetagHelper. */
|
|
702
702
|
retagHelpers = new Map();
|
|
703
|
+
/** Callee names of every interned coercion helper whose CALL mints a
|
|
704
|
+
* FRESH closure per evaluation (%fn.width.*, %fn.adapt.*,
|
|
705
|
+
* %fnval.spawnres.*). Registered at the mint site — NOT recovered by
|
|
706
|
+
* name-prefix matching — because retained-FFI release identity is the
|
|
707
|
+
* runtime closure pointer: a coercion adapter allocates a different
|
|
708
|
+
* closure at the registration and release sites, so lowerFfiCall must
|
|
709
|
+
* refuse these forms at compile time (SC5003). Any new closure-minting
|
|
710
|
+
* adapter helper MUST add its name here, or the identity guard silently
|
|
711
|
+
* reopens and the mismatch surfaces as a runtime release trap instead. */
|
|
712
|
+
freshClosureAdapters = new Set();
|
|
703
713
|
/** Symbols bound by `const x = promisify(execFile)` — the one lowered
|
|
704
714
|
* util.promisify shape. Declarations register here and emit nothing;
|
|
705
715
|
* calls through the binding lower (lowerExecFileAsyncCall) and value
|
|
@@ -875,6 +885,8 @@ export class Lowerer {
|
|
|
875
885
|
* IrModule.unions. An arm's index in the canonical list is its runtime
|
|
876
886
|
* tag. */
|
|
877
887
|
unions = new UnionRegistry();
|
|
888
|
+
/** Context-free successful type mappings. See TypeMapperCtx.typeMemo. */
|
|
889
|
+
typeMemo = new Map();
|
|
878
890
|
ambient = ambientDtsPath();
|
|
879
891
|
overridesAmbient = overridesDtsPath();
|
|
880
892
|
fallbackAmbient = fallbackDtsPath();
|
|
@@ -1038,6 +1050,10 @@ export class Lowerer {
|
|
|
1038
1050
|
isNpmFile: this.isNpmFile,
|
|
1039
1051
|
isExternalTypeFile: (sf) => this.externalTypeSpecifiersByFile.has(tsgoPath(resolve(sf.fileName))),
|
|
1040
1052
|
dynamic: this.dynamic,
|
|
1053
|
+
typeMemo: this.typeMemo,
|
|
1054
|
+
canMemoizeType: () => this.typeParamBindings === null &&
|
|
1055
|
+
this.typeParamTsBindings === null &&
|
|
1056
|
+
this.mixinTypeContext === null,
|
|
1041
1057
|
// fileTag is filled just below; the hook is only ever CALLED during
|
|
1042
1058
|
// lowering, long after the constructor completes.
|
|
1043
1059
|
isProgramFile: (sf) => this.fileTag.has(sf),
|
|
@@ -2000,7 +2016,7 @@ export class Lowerer {
|
|
|
2000
2016
|
const module = this.diags.length > 0
|
|
2001
2017
|
? null
|
|
2002
2018
|
: {
|
|
2003
|
-
irVersion:
|
|
2019
|
+
irVersion: 5,
|
|
2004
2020
|
sourceFile: this.entry.fileName,
|
|
2005
2021
|
functions,
|
|
2006
2022
|
classes: artifacts.classes,
|
|
@@ -4368,6 +4384,7 @@ export class Lowerer {
|
|
|
4368
4384
|
return existing;
|
|
4369
4385
|
const name = `%fn.width.${this.widthHelpers.size}`;
|
|
4370
4386
|
this.widthHelpers.set(key, name);
|
|
4387
|
+
this.freshClosureAdapters.add(name); // wraps `f` in a new closure per call
|
|
4371
4388
|
const impl = `${name}.impl`;
|
|
4372
4389
|
// The returned closure's body: call the captured original, width-map.
|
|
4373
4390
|
this.liftedFns.push({
|
|
@@ -4545,6 +4562,7 @@ export class Lowerer {
|
|
|
4545
4562
|
return existing;
|
|
4546
4563
|
const name = `%fn.adapt.${this.retagHelpers.size}`;
|
|
4547
4564
|
this.retagHelpers.set(key, name);
|
|
4565
|
+
this.freshClosureAdapters.add(name); // wraps `f` in a new closure per call
|
|
4548
4566
|
const impl = `${name}.impl`;
|
|
4549
4567
|
const params = toT.params.map((t, i) => ({ localId: `a.${i}`, name: `a${i}`, type: t }));
|
|
4550
4568
|
const strandThrow = (why) => ({
|
|
@@ -4715,6 +4733,7 @@ export class Lowerer {
|
|
|
4715
4733
|
return existing;
|
|
4716
4734
|
const name = `%fnval.spawnres.${this.widthHelpers.size}`;
|
|
4717
4735
|
this.widthHelpers.set(key, name);
|
|
4736
|
+
this.freshClosureAdapters.add(name); // wraps `f` in a new closure per call
|
|
4718
4737
|
const impl = `${name}.impl`;
|
|
4719
4738
|
const params = toT.params.map((p, i) => ({ localId: `p${i}.0`, name: `p${i}`, type: p }));
|
|
4720
4739
|
const rRef = { kind: "varRef", localId: "r.0", type: fromT.ret, loc };
|