@scriptc/compiler 0.3.4 → 0.3.5

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 (219) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +131 -10
  2. package/dist/backend/llvm/array-search.js +1 -1
  3. package/dist/backend/llvm/array-search.js.map +1 -1
  4. package/dist/backend/llvm/call-lifetimes.d.ts +6 -0
  5. package/dist/backend/llvm/call-lifetimes.js +19 -0
  6. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  7. package/dist/backend/llvm/constant-callbacks.d.ts +2 -21
  8. package/dist/backend/llvm/constant-callbacks.js +36 -219
  9. package/dist/backend/llvm/constant-callbacks.js.map +1 -1
  10. package/dist/backend/llvm/constant-callbacks.test.js +22 -0
  11. package/dist/backend/llvm/constant-callbacks.test.js.map +1 -1
  12. package/dist/backend/llvm/dense-array-access.d.ts +9 -0
  13. package/dist/backend/llvm/dense-array-access.js +27 -1
  14. package/dist/backend/llvm/dense-array-access.js.map +1 -1
  15. package/dist/backend/llvm/dyn.d.ts +6 -0
  16. package/dist/backend/llvm/dyn.js +40 -6
  17. package/dist/backend/llvm/dyn.js.map +1 -1
  18. package/dist/backend/llvm/emitter.d.ts +75 -1
  19. package/dist/backend/llvm/emitter.js +408 -38
  20. package/dist/backend/llvm/emitter.js.map +1 -1
  21. package/dist/backend/llvm/expr-async.js +17 -7
  22. package/dist/backend/llvm/expr-async.js.map +1 -1
  23. package/dist/backend/llvm/expr-bytes.js +1 -1
  24. package/dist/backend/llvm/expr-callbacks.d.ts +11 -0
  25. package/dist/backend/llvm/expr-callbacks.js +53 -0
  26. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  27. package/dist/backend/llvm/expr-calls.js +88 -2
  28. package/dist/backend/llvm/expr-calls.js.map +1 -1
  29. package/dist/backend/llvm/expr-containers.js +50 -27
  30. package/dist/backend/llvm/expr-containers.js.map +1 -1
  31. package/dist/backend/llvm/expr-primitives.js +9 -1
  32. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  33. package/dist/backend/llvm/expr-stream-bridges.js +4 -0
  34. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  35. package/dist/backend/llvm/integer-clones.d.ts +103 -0
  36. package/dist/backend/llvm/integer-clones.js +1336 -0
  37. package/dist/backend/llvm/integer-clones.js.map +1 -0
  38. package/dist/backend/llvm/integer-clones.test.d.ts +1 -0
  39. package/dist/backend/llvm/integer-clones.test.js +219 -0
  40. package/dist/backend/llvm/integer-clones.test.js.map +1 -0
  41. package/dist/backend/llvm/lib-datagram.js +14 -0
  42. package/dist/backend/llvm/lib-datagram.js.map +1 -1
  43. package/dist/backend/llvm/lib-dispatch.js +4 -0
  44. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  45. package/dist/backend/llvm/lib-process.js +24 -0
  46. package/dist/backend/llvm/lib-process.js.map +1 -1
  47. package/dist/backend/llvm/lib-shared.js +34 -2
  48. package/dist/backend/llvm/lib-shared.js.map +1 -1
  49. package/dist/backend/llvm/lib-tls.js +6 -0
  50. package/dist/backend/llvm/lib-tls.js.map +1 -1
  51. package/dist/backend/llvm/local-array-reads.js +1 -1
  52. package/dist/backend/llvm/local-array-reads.js.map +1 -1
  53. package/dist/backend/llvm/map-entry-fusion.d.ts +28 -0
  54. package/dist/backend/llvm/map-entry-fusion.js +233 -0
  55. package/dist/backend/llvm/map-entry-fusion.js.map +1 -0
  56. package/dist/backend/llvm/map-entry-fusion.test.d.ts +1 -0
  57. package/dist/backend/llvm/map-entry-fusion.test.js +183 -0
  58. package/dist/backend/llvm/map-entry-fusion.test.js.map +1 -0
  59. package/dist/backend/llvm/map-number-lookup.d.ts +2 -0
  60. package/dist/backend/llvm/map-number-lookup.js +1 -1
  61. package/dist/backend/llvm/map-number-lookup.js.map +1 -1
  62. package/dist/backend/llvm/map-number-lookup.test.js +10 -11
  63. package/dist/backend/llvm/map-number-lookup.test.js.map +1 -1
  64. package/dist/backend/llvm/map-read-lifetimes.d.ts +2 -0
  65. package/dist/backend/llvm/map-read-lifetimes.js +3 -0
  66. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  67. package/dist/backend/llvm/map-read-lifetimes.test.js +2 -2
  68. package/dist/backend/llvm/publish.d.ts +16 -0
  69. package/dist/backend/llvm/publish.js +81 -10
  70. package/dist/backend/llvm/publish.js.map +1 -1
  71. package/dist/backend/llvm/publish.test.d.ts +1 -0
  72. package/dist/backend/llvm/publish.test.js +94 -0
  73. package/dist/backend/llvm/publish.test.js.map +1 -0
  74. package/dist/backend/llvm/record-results.js +76 -2
  75. package/dist/backend/llvm/record-results.js.map +1 -1
  76. package/dist/backend/llvm/record-sources.d.ts +7 -0
  77. package/dist/backend/llvm/record-sources.js +14 -0
  78. package/dist/backend/llvm/record-sources.js.map +1 -0
  79. package/dist/backend/llvm/shapes.d.ts +9 -3
  80. package/dist/backend/llvm/shapes.js +18 -14
  81. package/dist/backend/llvm/shapes.js.map +1 -1
  82. package/dist/backend/llvm/shapes.test.js +5 -3
  83. package/dist/backend/llvm/shapes.test.js.map +1 -1
  84. package/dist/backend/llvm/string-lifetimes.test.js +75 -1
  85. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  86. package/dist/backend/llvm/walkers.d.ts +17 -0
  87. package/dist/backend/llvm/walkers.js +123 -0
  88. package/dist/backend/llvm/walkers.js.map +1 -1
  89. package/dist/backend/native/contracts.d.ts +2 -1
  90. package/dist/backend/native/executable.js +3 -1
  91. package/dist/backend/native/executable.js.map +1 -1
  92. package/dist/backend/runtime-abi.d.ts +2 -2
  93. package/dist/backend/runtime-abi.js +2 -2
  94. package/dist/backend/runtime-pack-targets.test.js +1 -1
  95. package/dist/backend/runtime-pack.test.js +1 -1
  96. package/dist/frontend/lowering/builtin-calls.js +3 -0
  97. package/dist/frontend/lowering/builtin-calls.js.map +1 -1
  98. package/dist/frontend/lowering/builtins/callable-aliases.js +54 -8
  99. package/dist/frontend/lowering/builtins/callable-aliases.js.map +1 -1
  100. package/dist/frontend/lowering/builtins/child-process-async.d.ts +8 -6
  101. package/dist/frontend/lowering/builtins/child-process-async.js +45 -29
  102. package/dist/frontend/lowering/builtins/child-process-async.js.map +1 -1
  103. package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +2 -0
  104. package/dist/frontend/lowering/builtins/filesystem-calls.js +5 -0
  105. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -1
  106. package/dist/frontend/lowering/builtins/filesystem.js +60 -0
  107. package/dist/frontend/lowering/builtins/filesystem.js.map +1 -1
  108. package/dist/frontend/lowering/builtins/fs-streams.d.ts +26 -0
  109. package/dist/frontend/lowering/builtins/fs-streams.js +131 -0
  110. package/dist/frontend/lowering/builtins/fs-streams.js.map +1 -0
  111. package/dist/frontend/lowering/builtins/module-calls.js +5 -1
  112. package/dist/frontend/lowering/builtins/module-calls.js.map +1 -1
  113. package/dist/frontend/lowering/class-dynamic-dispatch.js +150 -8
  114. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  115. package/dist/frontend/lowering/containers/bytes.js +33 -12
  116. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  117. package/dist/frontend/lowering/devirtualize.js +20 -7
  118. package/dist/frontend/lowering/devirtualize.js.map +1 -1
  119. package/dist/frontend/lowering/lower-calls.js +58 -3
  120. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  121. package/dist/frontend/lowering/lower-classes.js +7 -0
  122. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  123. package/dist/frontend/lowering/lower-dgram.js +55 -15
  124. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  125. package/dist/frontend/lowering/lower-event-emitter.d.ts +9 -1
  126. package/dist/frontend/lowering/lower-event-emitter.js +78 -0
  127. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  128. package/dist/frontend/lowering/lower-exprs.d.ts +4 -0
  129. package/dist/frontend/lowering/lower-exprs.js +132 -58
  130. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  131. package/dist/frontend/lowering/lower-inspect.js +26 -0
  132. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  133. package/dist/frontend/lowering/lower-server.d.ts +2 -1
  134. package/dist/frontend/lowering/lower-server.js +73 -5
  135. package/dist/frontend/lowering/lower-server.js.map +1 -1
  136. package/dist/frontend/lowering/lower-stmts.js +12 -6
  137. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  138. package/dist/frontend/lowering/lower-stream.js +8 -0
  139. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  140. package/dist/frontend/lowering/lowerer.d.ts +3 -1
  141. package/dist/frontend/lowering/lowerer.js +2 -2
  142. package/dist/frontend/lowering/lowerer.js.map +1 -1
  143. package/dist/frontend/lowering/record-sources.d.ts +15 -0
  144. package/dist/frontend/lowering/record-sources.js +46 -0
  145. package/dist/frontend/lowering/record-sources.js.map +1 -0
  146. package/dist/frontend/lowering/surfaces.js +33 -1
  147. package/dist/frontend/lowering/surfaces.js.map +1 -1
  148. package/dist/frontend/type-mapper.d.ts +3 -0
  149. package/dist/frontend/type-mapper.js +53 -0
  150. package/dist/frontend/type-mapper.js.map +1 -1
  151. package/dist/ir/analysis.d.ts +10 -0
  152. package/dist/ir/analysis.js +35 -0
  153. package/dist/ir/analysis.js.map +1 -1
  154. package/dist/ir/analysis.test.js +69 -1
  155. package/dist/ir/analysis.test.js.map +1 -1
  156. package/dist/ir/builtin-effects.js +36 -0
  157. package/dist/ir/builtin-effects.js.map +1 -1
  158. package/dist/ir/builtin-signatures.d.ts +1 -1
  159. package/dist/ir/builtin-signatures.js +91 -7
  160. package/dist/ir/builtin-signatures.js.map +1 -1
  161. package/dist/ir/capture-values.d.ts +107 -0
  162. package/dist/ir/capture-values.js +850 -0
  163. package/dist/ir/capture-values.js.map +1 -0
  164. package/dist/ir/capture-values.test.d.ts +1 -0
  165. package/dist/ir/capture-values.test.js +268 -0
  166. package/dist/ir/capture-values.test.js.map +1 -0
  167. package/dist/ir/field-values.d.ts +16 -0
  168. package/dist/ir/field-values.js +128 -0
  169. package/dist/ir/field-values.js.map +1 -0
  170. package/dist/ir/field-values.test.d.ts +1 -0
  171. package/dist/ir/field-values.test.js +160 -0
  172. package/dist/ir/field-values.test.js.map +1 -0
  173. package/dist/ir/final-fields.d.ts +4 -1
  174. package/dist/ir/final-fields.js +11 -3
  175. package/dist/ir/final-fields.js.map +1 -1
  176. package/dist/ir/function-references.test.js +1 -1
  177. package/dist/ir/function-references.test.js.map +1 -1
  178. package/dist/ir/init-only-globals.d.ts +16 -0
  179. package/dist/ir/init-only-globals.js +121 -0
  180. package/dist/ir/init-only-globals.js.map +1 -0
  181. package/dist/ir/init-only-globals.test.d.ts +1 -0
  182. package/dist/ir/init-only-globals.test.js +115 -0
  183. package/dist/ir/init-only-globals.test.js.map +1 -0
  184. package/dist/ir/initializer-bindings.d.ts +18 -1
  185. package/dist/ir/initializer-bindings.js +91 -1
  186. package/dist/ir/initializer-bindings.js.map +1 -1
  187. package/dist/ir/initializer-bindings.test.js +57 -2
  188. package/dist/ir/initializer-bindings.test.js.map +1 -1
  189. package/dist/ir/int32-slots.d.ts +22 -0
  190. package/dist/ir/int32-slots.js +376 -13
  191. package/dist/ir/int32-slots.js.map +1 -1
  192. package/dist/ir/int32-slots.test.js +91 -8
  193. package/dist/ir/int32-slots.test.js.map +1 -1
  194. package/dist/ir/integer-loop-facts.d.ts +19 -1
  195. package/dist/ir/integer-loop-facts.js +155 -7
  196. package/dist/ir/integer-loop-facts.js.map +1 -1
  197. package/dist/ir/integer-ranges.d.ts +8 -5
  198. package/dist/ir/integer-ranges.js +147 -55
  199. package/dist/ir/integer-ranges.js.map +1 -1
  200. package/dist/ir/integer-ranges.test.js +225 -7
  201. package/dist/ir/integer-ranges.test.js.map +1 -1
  202. package/dist/ir/ir.d.ts +9 -1
  203. package/dist/ir/ir.js.map +1 -1
  204. package/dist/ir/property-bags.d.ts +14 -0
  205. package/dist/ir/property-bags.js +121 -0
  206. package/dist/ir/property-bags.js.map +1 -0
  207. package/dist/ir/receiver-readers.d.ts +21 -0
  208. package/dist/ir/receiver-readers.js +217 -0
  209. package/dist/ir/receiver-readers.js.map +1 -0
  210. package/dist/ir/runtime-features.js +6 -1
  211. package/dist/ir/runtime-features.js.map +1 -1
  212. package/dist/ir/validate.js +26 -0
  213. package/dist/ir/validate.js.map +1 -1
  214. package/dist/ir/validate.test.js +21 -0
  215. package/dist/ir/validate.test.js.map +1 -1
  216. package/dist/library/int-infer.js +3 -0
  217. package/dist/library/int-infer.js.map +1 -1
  218. package/package.json +20 -20
  219. package/surface-manifest.json +28 -2
@@ -1,10 +1,11 @@
1
1
  import { type ArraySearchKind } from "./array-search.js";
2
2
  import type { IrBytesElem, IrExpr, IrFfiImport, IrFunction, IrLocal, IrModule, IrRecordShape, IrStmt, IrType, IrUnionDef, SrcLoc } from "../../ir/ir.js";
3
3
  import { type SplitSpan } from "./split-loops.js";
4
- import { type IntegerRanges } from "../../ir/integer-ranges.js";
4
+ import { type IntegerRange, type IntegerRanges } from "../../ir/integer-ranges.js";
5
5
  import { type Int32Slots } from "../../ir/int32-slots.js";
6
6
  import { type Int32Abi } from "./int32-abi.js";
7
7
  import { type Int32Local } from "./int32-locals.js";
8
+ import { type IntegerClones } from "./integer-clones.js";
8
9
  import { type ConstantNumericTable } from "../../ir/constant-tables.js";
9
10
  import { type FfiCallbackAdapter } from "../ffi-callbacks.js";
10
11
  import { type CallLifetimes } from "./call-lifetimes.js";
@@ -15,6 +16,7 @@ import { InlineUnionFields } from "./inline-unions.js";
15
16
  import { OptionalArrayReads, type LocalArrayRead } from "./local-array-reads.js";
16
17
  import { CheckedNarrows } from "./checked-narrows.js";
17
18
  import { type MapReadLifetimes } from "./map-read-lifetimes.js";
19
+ import { type MapEntryFusion } from "./map-entry-fusion.js";
18
20
  import { ReferenceEffects } from "./reference-effects.js";
19
21
  import { ReferenceWrites, type Writes } from "./reference-writes.js";
20
22
  import { StackCallbacks } from "./stack-callbacks.js";
@@ -89,6 +91,10 @@ export declare class LlEmitter {
89
91
  /** The alias tag of a runtime word that emitted code reads and writes
90
92
  * outside every field (the lifetime-region count, owner and cursors). */
91
93
  memoryAliasAttachment(category: string): string;
94
+ /** The `!range` attachment of an array length load: a length is at most
95
+ * 2^32 - 1 (the runtime's SCR_ARR_MAX_LENGTH), so conversions to double
96
+ * and back fold. 32-bit targets load the full range anyway. */
97
+ get arrayLengthRange(): string;
92
98
  fieldAliasAttachment(ptr: string): string;
93
99
  private fieldAliasMetadata;
94
100
  private readonly debug;
@@ -173,6 +179,8 @@ export declare class LlEmitter {
173
179
  /** Interned NUL-terminated C-string constants (scr_jb_puts labels, the
174
180
  * stringify indent text): UTF-8 text → { symbol, byte length }. */
175
181
  private readonly cstrs;
182
+ /** Interned ScrMapOps descriptors (scr_map.h): initializer → symbol. */
183
+ private readonly mapOpsConsts;
176
184
  /** Type-directed walker functions (JSON serializers, the indent
177
185
  * rewriter, union ToString/join) — interned per typeKey/unionId, defs
178
186
  * flushed with the shape helpers. */
@@ -216,6 +224,8 @@ export declare class LlEmitter {
216
224
  callArrayReads: Map<IrExpr, LocalArrayRead>;
217
225
  mapReadLifetimes: MapReadLifetimes;
218
226
  readNumberMapWrites: ReadonlySet<IrExpr>;
227
+ /** The current function's fused string-key Map get-then-set pairs (map-entry-fusion.ts). */
228
+ mapEntryFusion: MapEntryFusion | null;
219
229
  readonly callLifetimes: CallLifetimes;
220
230
  readonly constantCallbacks: Map<string, Map<string, string>>;
221
231
  currentConstantCallbacks: ReadonlyMap<string, string>;
@@ -374,8 +384,18 @@ export declare class LlEmitter {
374
384
  private readonly initializerBindings;
375
385
  /** Whole-program int32 storage and parameter/result facts. */
376
386
  readonly int32Slots: Int32Slots;
387
+ /** The program has no runtime store into a checked-dynamic value
388
+ * (dynamicFieldStores), so live views of classes and records never
389
+ * commit back into their objects. Library builds keep their commits:
390
+ * their values cross a native boundary. */
391
+ readonly liveViewsReadOnly: boolean;
377
392
  /** Functions whose direct calls use i32 parameters or results. */
378
393
  readonly int32Abis: ReadonlyMap<string, Int32Abi>;
394
+ /** Pure number functions with speculative integer clones. */
395
+ readonly integerClones: IntegerClones;
396
+ /** The IR function being emitted. */
397
+ currentFunctionName: string;
398
+ integerParamRange(fnName: string, localId: string): IntegerRange | null;
379
399
  /** Immutable module constants (contract types) whose graphs become
380
400
  * immortal once initialized: their reads need no reference counting. */
381
401
  readonly immortalGlobals: ReadonlySet<string>;
@@ -407,6 +427,9 @@ export declare class LlEmitter {
407
427
  private byteWindowEntries;
408
428
  bytesBounds: ReadonlySet<IrExpr | IrStmt>;
409
429
  integerViews: Map<string, string>;
430
+ /** Module globals the current function owns outright (initializer
431
+ * bindings): their function-local slot, which stands in for the global. */
432
+ private privateGlobalSlots;
410
433
  /** Number locals of the current function stored only as an i32
411
434
  * (int32-locals.ts); their slots are `alloca i32`. */
412
435
  int32Locals: Map<string, Int32Local>;
@@ -447,7 +470,14 @@ export declare class LlEmitter {
447
470
  finalLabel: string;
448
471
  cleanupLabel: string;
449
472
  suspendLabel: string;
473
+ /** The generator's OUT slot (%ScrGenSlot) for a native body whose
474
+ * yield channel is a number or boolean, which its yields store into
475
+ * inline (see emitGenSlotStore); null otherwise. */
476
+ out: string | null;
450
477
  } | null;
478
+ /** Inline generator slot accesses need the %ScrGenHead/%ScrGenSlot
479
+ * mirrors in the module header. */
480
+ usesGenSlots: boolean;
451
481
  /** The generator channels of the function being emitted (null outside
452
482
  * generator bodies): yieldExpr emission reads them, and emitTryCatch's
453
483
  * catch prologue emits the GENRET sentinel re-unwind exactly here. */
@@ -464,6 +494,8 @@ export declare class LlEmitter {
464
494
  constructor(mod: IrModule, options: LlvmTargetOptions);
465
495
  /** The borrowed parameters of a hierarchy's vtable slot (empty: owned). */
466
496
  virtualSlotBorrowed(rootName: string, slotIndex: number): ReadonlySet<number>;
497
+ /** Optimized emission: no debug-info (dev) posture. */
498
+ get optimizing(): boolean;
467
499
  /** The vtable entry for one implementation (VirtualBorrows.entry). */
468
500
  virtualEntry(implFn: string): string;
469
501
  private implSlotBorrowed;
@@ -582,6 +614,8 @@ export declare class LlEmitter {
582
614
  * stringify-indent currency) — `@`-ref, first-use order. */
583
615
  cstr(text: string): string;
584
616
  needBadTag(): void;
617
+ /** The ScrMapOps descriptor holding these operands (ShapeHost.mapOps). */
618
+ mapOps(operands: readonly string[]): string;
585
619
  /** The interned immortal instance for a UNIT arm of a union — asserts
586
620
  * the arm really is payload-less (undefined/null). Public: class
587
621
  * emission initializes undefined-admitting fields through it
@@ -852,11 +886,24 @@ export declare class LlEmitter {
852
886
  * whether the promise waiter list or the ready FIFO owns the continuation;
853
887
  * LLVM keeps all live locals in the coroutine frame. */
854
888
  emitWasiSuspend(promise: string | null): void;
889
+ /** A native generator's OUT slot (scr_async.c's ScrGen.out, mirrored by
890
+ * %ScrGenHead and %ScrGenSlot { kind, f64, b, payload, release_fn }). */
891
+ genOutSlot(gen: string): string;
892
+ /** A yield on a number or boolean channel: scr_gen_slot_f64/bool inline.
893
+ * Such a body's OUT never holds a reference at a yield (only its final
894
+ * completion can park one), so the slot needs no release first. */
895
+ emitGenSlotStore(slot: string, kind: "f64" | "bool", value: string): void;
896
+ /** scr_gen_take_out_f64/bool inline: the slot's value when it holds that
897
+ * kind (otherwise 0 or false), leaving the slot empty. */
898
+ emitGenSlotTake(slot: string, kind: "f64" | "bool"): string;
855
899
  /** Suspend after a target-specific runtime helper already queued the
856
900
  * continuation (used by module awaits, which skip the hop when settled). */
857
901
  emitCoroSuspendPrepared(): void;
858
902
  /** Move a clean async return value into the current fiber's promise. */
859
903
  private emitWasiFulfill;
904
+ /** Number locals declared as a copy of a capture or of a lazily boxed
905
+ * parameter, at the top of the body. */
906
+ private doubleCopies;
860
907
  private emitFunction;
861
908
  /** The double-ABI entry of a function with an i32 entry: every caller
862
909
  * that is not a direct call (closures, dispatch, adapters, the runtime)
@@ -1028,6 +1075,27 @@ export declare class LlEmitter {
1028
1075
  * `s += String.fromCharCode(c)` appends the character without building
1029
1076
  * the one-character string; null for any other suffix. */
1030
1077
  private emitSingleCharCode;
1078
+ /**
1079
+ * Lower `recv.f = recv.f + suffix` on a plain string field like
1080
+ * emitStringSelfConcatAssign does for locals. The field's old value is
1081
+ * snapshotted (+1) and the suffix evaluated in JavaScript order; then the
1082
+ * field unlinks and releases its CURRENT value, so the snapshot is unique
1083
+ * unless a real alias exists and the concat appends in place instead of
1084
+ * copying the whole string on every append. Returns false (emitting
1085
+ * nothing) for every other store.
1086
+ */
1087
+ private emitFieldSelfConcat;
1088
+ /** A snapshot the current statement frames own (+1), or an immortal
1089
+ * value: it stays valid after its container releases the same string. */
1090
+ private ownsSnapshot;
1091
+ /**
1092
+ * `a[i] = a[i] + suffix` on a string array (the canonical statement form
1093
+ * of `a[i] += suffix`): the old element is snapshotted (+1) and the
1094
+ * suffix evaluated in JavaScript order; then, when the slot still holds
1095
+ * the snapshot, the array lets go of it (emitDenseSlotUnlink) so the
1096
+ * concat can append in place, and the result is stored as usual.
1097
+ */
1098
+ private emitArraySelfConcat;
1031
1099
  /** `local = local + suffix` when the suffix cannot read or write the
1032
1100
  * local (an unboxed binding is only reachable through this function's own
1033
1101
  * expressions): reading the binding after the suffix gives the value the
@@ -1189,6 +1257,12 @@ export declare class LlEmitter {
1189
1257
  fn: string;
1190
1258
  shim: string;
1191
1259
  };
1260
+ emitterOnceAdapter(boxerT: IrType & {
1261
+ kind: "func";
1262
+ }): {
1263
+ fn: string;
1264
+ shim: string;
1265
+ };
1192
1266
  wrapEmitterListener(target: string, adapterFn: string): string;
1193
1267
  unwrapNullableClosure(u: string, funcTag: number): string;
1194
1268
  closeBindThunkFor(cbUnion: IrType, retServer: boolean): string;