@scriptc/compiler 0.0.34 → 0.0.35

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.
Files changed (66) hide show
  1. package/dist/backend/cc-cache.test.js +969 -7
  2. package/dist/backend/cc-cache.test.js.map +1 -1
  3. package/dist/backend/cc.d.ts +90 -18
  4. package/dist/backend/cc.js +953 -276
  5. package/dist/backend/cc.js.map +1 -1
  6. package/dist/backend/llvm/split.d.ts +43 -0
  7. package/dist/backend/llvm/split.js +227 -0
  8. package/dist/backend/llvm/split.js.map +1 -0
  9. package/dist/backend/llvm/split.test.d.ts +1 -0
  10. package/dist/backend/llvm/split.test.js +102 -0
  11. package/dist/backend/llvm/split.test.js.map +1 -0
  12. package/dist/backend/object-localize.test.js +20 -0
  13. package/dist/backend/object-localize.test.js.map +1 -1
  14. package/dist/executable/early-cache.d.ts +86 -0
  15. package/dist/executable/early-cache.js +460 -0
  16. package/dist/executable/early-cache.js.map +1 -0
  17. package/dist/executable/early-cache.test.d.ts +1 -0
  18. package/dist/executable/early-cache.test.js +300 -0
  19. package/dist/executable/early-cache.test.js.map +1 -0
  20. package/dist/ffi/profile.d.ts +7 -2
  21. package/dist/ffi/profile.js +1 -0
  22. package/dist/ffi/profile.js.map +1 -1
  23. package/dist/frontend/lowering/lower-builtins.js +2 -2
  24. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  25. package/dist/frontend/lowering/lower-calls.js +14 -4
  26. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  27. package/dist/frontend/lowering/lower-containers.js +18 -23
  28. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  29. package/dist/frontend/lowering/lower-exprs.js +22 -10
  30. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  31. package/dist/frontend/lowering/lower-island.js +3 -3
  32. package/dist/frontend/lowering/lower-island.js.map +1 -1
  33. package/dist/frontend/lowering/lower-mixins.js +1 -1
  34. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  35. package/dist/frontend/lowering/lower-stmts.js +1 -1
  36. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  37. package/dist/frontend/lowering/lowerer.d.ts +6 -0
  38. package/dist/frontend/lowering/lowerer.js +230 -81
  39. package/dist/frontend/lowering/lowerer.js.map +1 -1
  40. package/dist/frontend/lowering/surfaces.js +1 -1
  41. package/dist/frontend/lowering/surfaces.js.map +1 -1
  42. package/dist/frontend/program.js +42 -13
  43. package/dist/frontend/program.js.map +1 -1
  44. package/dist/frontend/ts7/checker.d.ts +40 -2
  45. package/dist/frontend/ts7/checker.js +194 -32
  46. package/dist/frontend/ts7/checker.js.map +1 -1
  47. package/dist/frontend/types.js +20 -42
  48. package/dist/frontend/types.js.map +1 -1
  49. package/dist/index.d.ts +4 -1
  50. package/dist/index.js +219 -101
  51. package/dist/index.js.map +1 -1
  52. package/dist/ir/nodes.d.ts +6 -0
  53. package/dist/ir/nodes.js +28 -0
  54. package/dist/ir/nodes.js.map +1 -1
  55. package/dist/ir/validate.js +7 -1
  56. package/dist/ir/validate.js.map +1 -1
  57. package/dist/library/early-cache.js +4 -23
  58. package/dist/library/early-cache.js.map +1 -1
  59. package/dist/library/implementation-identity.d.ts +23 -0
  60. package/dist/library/implementation-identity.js +84 -0
  61. package/dist/library/implementation-identity.js.map +1 -0
  62. package/dist/startup-cache.d.ts +6 -0
  63. package/dist/startup-cache.js +6 -0
  64. package/dist/startup-cache.js.map +1 -0
  65. package/package.json +3 -2
  66. package/surface-manifest.json +1 -1
@@ -625,7 +625,7 @@ export function declaredReturnType(L, decl, blame) {
625
625
  * instead of the generic supported-types recitation; a no-op for every
626
626
  * other unmappable type (the caller's badType reports those). */
627
627
  function fenceGenericSignatureResult(L, blame, t) {
628
- const parts = t.isUnionType() ? t.getTypes() : [t];
628
+ const parts = t.isUnionType() ? ts.constituentTypes(t) : [t];
629
629
  if (!parts.some((p) => L.checker.getCallSignatures(p).some((s) => (s.typeParameters?.length ?? 0) > 0))) {
630
630
  return;
631
631
  }
@@ -1046,8 +1046,8 @@ export function unifySignatureBindings(L, info, rsig, bindings, tsBindings) {
1046
1046
  // unbound type parameter surfaces as a mapping diagnostic later).
1047
1047
  if (declared.isUnionType()) {
1048
1048
  const unitFlags = ts.TypeFlags.Undefined | ts.TypeFlags.Null;
1049
- const dParts = declared.getTypes().filter((t) => !(t.flags & unitFlags));
1050
- const iParts = inst.isUnionType() ? inst.getTypes().filter((t) => !(t.flags & unitFlags)) : [inst];
1049
+ const dParts = ts.constituentTypes(declared).filter((t) => !(t.flags & unitFlags));
1050
+ const iParts = inst.isUnionType() ? ts.constituentTypes(inst).filter((t) => !(t.flags & unitFlags)) : [inst];
1051
1051
  if (dParts.length === 1 && iParts.length === 1)
1052
1052
  unify(dParts[0], iParts[0], depth + 1);
1053
1053
  return;
@@ -1443,7 +1443,7 @@ export function lowerGenericFnValue(L, ref, info) {
1443
1443
  // A `Fn | undefined`-flavored slot: the value can only inhabit the
1444
1444
  // one callable arm — judge by it (the requireExactArityValue union
1445
1445
  // rule).
1446
- const callable = pinT.getTypes().map((t) => L.checker.getCallSignatures(t)).filter((s) => s.length === 1);
1446
+ const callable = ts.constituentTypes(pinT).map((t) => L.checker.getCallSignatures(t)).filter((s) => s.length === 1);
1447
1447
  if (callable.length === 1)
1448
1448
  target = callable[0][0];
1449
1449
  }
@@ -1782,6 +1782,16 @@ function internImplicitInstance(L, blame, info, shapes, argTypes) {
1782
1782
  // the pinned signature over a missing body, which the linker never
1783
1783
  // sees because the poison also fenced the call statement.
1784
1784
  try {
1785
+ // Implicit-any instances lower EAGERLY at the call site so their
1786
+ // inferred return type is available immediately. They therefore do
1787
+ // not pass through emitReachable's queued generic-instance wave,
1788
+ // which normally batches checker work before lowering a body. Prime
1789
+ // this exact committed instance body here; repeated instantiations of
1790
+ // the same declaration find the facade memos warm.
1791
+ L.checker.prefetchRoots([
1792
+ ...info.decl.parameters.flatMap((param) => param.initializer ? [param.initializer] : []),
1793
+ ...(info.decl.body ? [info.decl.body] : []),
1794
+ ]);
1785
1795
  const fn = L.lowerGenericInstance(info, inst);
1786
1796
  L.implicitFns.push(fn);
1787
1797
  }