@scriptc/compiler 0.2.8 → 0.2.9
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/ambient/scriptc-node-fallback.d.ts +1 -0
- package/dist/backend/cycle-analysis.js +50 -17
- package/dist/backend/cycle-analysis.js.map +1 -1
- package/dist/backend/cycle-analysis.test.js +138 -14
- package/dist/backend/cycle-analysis.test.js.map +1 -1
- package/dist/backend/cycle-mutability.d.ts +31 -6
- package/dist/backend/cycle-mutability.js +120 -18
- package/dist/backend/cycle-mutability.js.map +1 -1
- package/dist/backend/llvm/alloc.d.ts +13 -3
- package/dist/backend/llvm/alloc.js +24 -10
- package/dist/backend/llvm/alloc.js.map +1 -1
- package/dist/backend/llvm/alloc.test.js +5 -5
- package/dist/backend/llvm/alloc.test.js.map +1 -1
- package/dist/backend/llvm/byte-numbers.js +2 -3
- package/dist/backend/llvm/byte-numbers.js.map +1 -1
- package/dist/backend/llvm/classes.js +7 -6
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +17 -0
- package/dist/backend/llvm/common.js +28 -0
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/dense-array-access.js +1 -1
- package/dist/backend/llvm/dense-array-access.test.js +1 -1
- package/dist/backend/llvm/dyn.d.ts +4 -4
- package/dist/backend/llvm/dyn.js +27 -11
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +45 -3
- package/dist/backend/llvm/emitter.js +333 -74
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +36 -3
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.js +35 -28
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-containers.js +1 -1
- package/dist/backend/llvm/expr-context.d.ts +2 -0
- package/dist/backend/llvm/expr-control.js +46 -5
- package/dist/backend/llvm/expr-control.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +3 -0
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.d.ts +3 -0
- package/dist/backend/llvm/expr-stream-bridges.js +73 -11
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +18 -2
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +1 -0
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.d.ts +17 -6
- package/dist/backend/llvm/local-array-reads.js +155 -43
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/reference-effects.js +34 -1
- package/dist/backend/llvm/reference-effects.js.map +1 -1
- package/dist/backend/llvm/shapes.d.ts +14 -3
- package/dist/backend/llvm/shapes.js +43 -12
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +5 -5
- package/dist/backend/llvm/shapes.test.js.map +1 -1
- package/dist/backend/llvm/string-reads.js +29 -26
- package/dist/backend/llvm/string-reads.js.map +1 -1
- package/dist/backend/llvm/string-slices.js +1 -1
- package/dist/backend/llvm/trunc.d.ts +8 -0
- package/dist/backend/llvm/trunc.js +28 -0
- package/dist/backend/llvm/trunc.js.map +1 -0
- package/dist/backend/loop-polls.d.ts +14 -0
- package/dist/backend/loop-polls.js +100 -0
- package/dist/backend/loop-polls.js.map +1 -0
- package/dist/backend/loop-polls.test.d.ts +1 -0
- package/dist/backend/loop-polls.test.js +86 -0
- package/dist/backend/loop-polls.test.js.map +1 -0
- package/dist/backend/may-throw.js +20 -1
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +23 -0
- package/dist/backend/may-throw.test.js.map +1 -1
- package/dist/backend/native-codegen.d.ts +1 -3
- package/dist/backend/native-codegen.js +4 -32
- package/dist/backend/native-codegen.js.map +1 -1
- package/dist/backend/runtime-abi.d.ts +2 -2
- package/dist/backend/runtime-abi.js +2 -2
- package/dist/backend/runtime-abi.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +1 -1
- package/dist/backend/runtime-pack-targets.test.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +1 -1
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/cli/command.js +8 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/output-options.d.ts +1 -0
- package/dist/cli/output-options.js +3 -0
- package/dist/cli/output-options.js.map +1 -1
- package/dist/cli/usage.d.ts +5 -1
- package/dist/cli/usage.js +6 -0
- package/dist/cli/usage.js.map +1 -1
- package/dist/compile-types.d.ts +5 -0
- package/dist/executable/executable-cache.d.ts +2 -0
- package/dist/executable/executable-cache.js +3 -0
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +1 -0
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/frontend/lowering/array-values.js +37 -1
- package/dist/frontend/lowering/array-values.js.map +1 -1
- package/dist/frontend/lowering/builtins/strings.js +4 -1
- package/dist/frontend/lowering/builtins/strings.js.map +1 -1
- package/dist/frontend/lowering/call-arguments.js +96 -4
- package/dist/frontend/lowering/call-arguments.js.map +1 -1
- package/dist/frontend/lowering/class-method-mutations.js +88 -0
- package/dist/frontend/lowering/class-method-mutations.js.map +1 -1
- package/dist/frontend/lowering/containers/bytes.js +15 -4
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/expressions/union-fields.d.ts +19 -0
- package/dist/frontend/lowering/expressions/union-fields.js +236 -0
- package/dist/frontend/lowering/expressions/union-fields.js.map +1 -0
- package/dist/frontend/lowering/lower-calls.js +12 -2
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +6 -0
- package/dist/frontend/lowering/lower-exprs.js +162 -3
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-island.js +5 -19
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +11 -1
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +5 -0
- package/dist/frontend/lowering/lowerer.js +174 -8
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/nan-coded-reads.d.ts +161 -0
- package/dist/frontend/lowering/nan-coded-reads.js +1342 -0
- package/dist/frontend/lowering/nan-coded-reads.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-bounds.d.ts +14 -2
- package/dist/frontend/lowering/runtime-optional-bounds.js +17 -11
- package/dist/frontend/lowering/runtime-optional-bounds.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-bounds.test.js +28 -0
- package/dist/frontend/lowering/runtime-optional-bounds.test.js.map +1 -1
- package/dist/frontend/lowering/surfaces.js +8 -0
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/ir/builtin-signatures.d.ts +1 -1
- package/dist/ir/builtin-signatures.js +2 -0
- package/dist/ir/builtin-signatures.js.map +1 -1
- package/dist/ir/constant-globals.d.ts +14 -0
- package/dist/ir/constant-globals.js +81 -0
- package/dist/ir/constant-globals.js.map +1 -0
- package/dist/ir/constant-globals.test.d.ts +1 -0
- package/dist/ir/constant-globals.test.js +97 -0
- package/dist/ir/constant-globals.test.js.map +1 -0
- package/dist/ir/final-fields.d.ts +35 -0
- package/dist/ir/final-fields.js +187 -0
- package/dist/ir/final-fields.js.map +1 -0
- package/dist/ir/final-fields.test.d.ts +1 -0
- package/dist/ir/final-fields.test.js +106 -0
- package/dist/ir/final-fields.test.js.map +1 -0
- package/dist/ir/int32-slots.d.ts +9 -0
- package/dist/ir/int32-slots.js +70 -57
- package/dist/ir/int32-slots.js.map +1 -1
- package/dist/ir/int32-slots.test.js +27 -0
- package/dist/ir/int32-slots.test.js.map +1 -1
- package/dist/ir/integer-loops.d.ts +5 -0
- package/dist/ir/integer-loops.js +20 -4
- package/dist/ir/integer-loops.js.map +1 -1
- package/dist/ir/integer-loops.test.js +17 -0
- package/dist/ir/integer-loops.test.js.map +1 -1
- package/dist/ir/ir.d.ts +6 -1
- package/dist/ir/ir.js +4 -0
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/serialize.d.ts +12 -2
- package/dist/ir/serialize.js +190 -39
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/serialize.test.js +65 -1
- package/dist/ir/serialize.test.js.map +1 -1
- package/dist/native/cache.d.ts +8 -1
- package/dist/native/cache.js +38 -1
- package/dist/native/cache.js.map +1 -1
- package/dist/native/cache.test.js +11 -0
- package/dist/native/cache.test.js.map +1 -1
- package/dist/native/compiler.js +4 -3
- package/dist/native/compiler.js.map +1 -1
- package/dist/native/prepare.d.ts +3 -1
- package/dist/native/prepare.js +63 -28
- package/dist/native/prepare.js.map +1 -1
- package/dist/native/prepare.test.js +23 -1
- package/dist/native/prepare.test.js.map +1 -1
- package/dist/native/text-file.d.ts +10 -0
- package/dist/native/text-file.js +41 -0
- package/dist/native/text-file.js.map +1 -0
- package/dist/text-parts.d.ts +5 -0
- package/dist/text-parts.js +36 -0
- package/dist/text-parts.js.map +1 -0
- package/package.json +20 -20
- package/surface-manifest.json +7 -1
- package/dist/frontend/lowering/expressions/union-field-write.d.ts +0 -8
- package/dist/frontend/lowering/expressions/union-field-write.js +0 -108
- package/dist/frontend/lowering/expressions/union-field-write.js.map +0 -1
|
@@ -45,6 +45,10 @@ export interface LlvmTargetOptions {
|
|
|
45
45
|
/** Emit retain/release fast paths inline (the `speed` posture). Off, every
|
|
46
46
|
* retain and release is a runtime call. */
|
|
47
47
|
inlineRc?: boolean;
|
|
48
|
+
/** Define `scr_detached_exit` so the Linux runtime hands the address-space
|
|
49
|
+
* teardown after `process.exit` to a helper process (`--detached-exit`).
|
|
50
|
+
* Executables only; the runtime's weak default keeps it off. */
|
|
51
|
+
detachedExit?: boolean;
|
|
48
52
|
}
|
|
49
53
|
export declare function emitLlvmModule(mod: IrModule, options?: LlvmTargetOptions): string;
|
|
50
54
|
/** Keep large translation units below the host's single-string limit. */
|
|
@@ -73,12 +77,27 @@ export declare class LlEmitter {
|
|
|
73
77
|
private debugScope;
|
|
74
78
|
readonly sizeType: "i32" | "i64";
|
|
75
79
|
readonly ffiExtendNarrowIntegers: boolean;
|
|
76
|
-
readonly
|
|
80
|
+
readonly cycleBufferedOffset: number;
|
|
81
|
+
/** Emitted ScrCycType descriptors so far (their collector statistics
|
|
82
|
+
* indices; see ShapeHost.nextCycKind). */
|
|
83
|
+
private cycKinds;
|
|
77
84
|
readonly wasi: boolean;
|
|
85
|
+
/** The target lacks a rounding instruction at its baseline CPU (x86-64
|
|
86
|
+
* before SSE4.1), so `llvm.trunc` would lower to a libm call: emit
|
|
87
|
+
* truncation inline through an integer round trip instead. */
|
|
88
|
+
readonly inlineTrunc: boolean;
|
|
78
89
|
/** ELF worker executables give thread-locals the executable TLS models. */
|
|
79
90
|
private readonly executableTls;
|
|
91
|
+
/** Source loops enclosing the statement being emitted in the current
|
|
92
|
+
* function body. */
|
|
93
|
+
private loopDepth;
|
|
94
|
+
/** Darwin worker executables read the stack guard from a pthread
|
|
95
|
+
* thread-specific-data slot off the thread pointer (scr_runtime.h's
|
|
96
|
+
* SCR_STACK_GUARD_TSD): the architecture names the access sequence. */
|
|
97
|
+
private readonly stackGuardTsd;
|
|
80
98
|
private readonly emitLibraryIdentity;
|
|
81
99
|
private readonly runtimeAbiMarker;
|
|
100
|
+
private readonly detachedExit;
|
|
82
101
|
/** Interned string literals: UTF-8 text → { symbol, byte length } —
|
|
83
102
|
* first-use order, the runtime ABI’s determinism discipline. */
|
|
84
103
|
private readonly literals;
|
|
@@ -286,6 +305,11 @@ export declare class LlEmitter {
|
|
|
286
305
|
};
|
|
287
306
|
}>;
|
|
288
307
|
private countedLoopsEnabled;
|
|
308
|
+
/** Whole-program final reference fields (ir/final-fields.ts). */
|
|
309
|
+
private finalFields;
|
|
310
|
+
/** The current function may borrow final fields of borrowable objects:
|
|
311
|
+
* not a constructor (where they change), not async or a generator. */
|
|
312
|
+
private finalFieldBorrows;
|
|
289
313
|
integerRanges: IntegerRanges;
|
|
290
314
|
private byteWindowsEnabled;
|
|
291
315
|
private byteWindowEntries;
|
|
@@ -486,6 +510,13 @@ export declare class LlEmitter {
|
|
|
486
510
|
* unwind returns it as the dummy, so a call in tail position keeps a single
|
|
487
511
|
* return and stays eligible for tail-call and recursion elimination. */
|
|
488
512
|
private emitUnwind;
|
|
513
|
+
/** Loads the running thread's exact pending word (ELF worker
|
|
514
|
+
* executables, scr_exception.c): bit 0 mirrors the active cell, bit 1
|
|
515
|
+
* requests the context's stop. It lives in the executable's static TLS
|
|
516
|
+
* block, so the access is one thread-pointer-relative load. Monotonic by
|
|
517
|
+
* default: a loop must not hoist the load out and miss a cross-thread
|
|
518
|
+
* stop (see emitPendingCheck for the unordered tests). */
|
|
519
|
+
private loadExcFlag;
|
|
489
520
|
/** Instructions (two-space indented) that set the i1 `dest` to "an
|
|
490
521
|
* exception is pending in the active context" — scr_exc_pending()'s
|
|
491
522
|
* meaning — for the helper and adapter bodies that test it outside
|
|
@@ -501,11 +532,12 @@ export declare class LlEmitter {
|
|
|
501
532
|
* call's result temp must join its frame BEFORE this runs so the unwind
|
|
502
533
|
* releases the dummy (NULL for refcounted kinds) harmlessly. A scalar
|
|
503
534
|
* call result of the function's return type may be passed as the unwind's
|
|
504
|
-
* dummy value (see emitUnwind).
|
|
535
|
+
* dummy value (see emitUnwind). `poll` marks a worker termination poll
|
|
536
|
+
* (function entry or loop budget), whose test must stay ordered. */
|
|
505
537
|
emitPendingCheck(passThrough?: {
|
|
506
538
|
name: string;
|
|
507
539
|
type: IrType;
|
|
508
|
-
}): void;
|
|
540
|
+
}, poll?: boolean): void;
|
|
509
541
|
/** After a runtime call that ALWAYS leaves an exception pending (the
|
|
510
542
|
* compiler-resolved Node throws): the pending test would always answer
|
|
511
543
|
* true, so unwind unconditionally. Emission continues in a block with no
|
|
@@ -515,6 +547,9 @@ export declare class LlEmitter {
|
|
|
515
547
|
/** A recursive function's entry check: below the running stack's guard,
|
|
516
548
|
* throw Node's RangeError and unwind like any other pending exception. */
|
|
517
549
|
private emitStackCheck;
|
|
550
|
+
/** Whether the emitter follows this call with a pending test (the
|
|
551
|
+
* conditions in expr-calls.ts). */
|
|
552
|
+
private callTestsPending;
|
|
518
553
|
private workerLoopBudget;
|
|
519
554
|
private emitWorkerLoopCheck;
|
|
520
555
|
/** Moves an already-evaluated value into the runtime's exception cell —
|
|
@@ -621,6 +656,13 @@ export declare class LlEmitter {
|
|
|
621
656
|
* array cell holding the value and move it into the ARR-kind box
|
|
622
657
|
* (set_ref releases nothing — the slot was the empty sentinel). */
|
|
623
658
|
private tdzScalarInit;
|
|
659
|
+
/** The payload a TDZ box holds before its declaration runs, when that is
|
|
660
|
+
* not NULL. A nullable union's value is its arm pointer with NULL as a
|
|
661
|
+
* unit arm (nullable-unions.ts), so a stored `null`/`undefined` would
|
|
662
|
+
* read back as the temporal dead zone; such boxes start at the module's
|
|
663
|
+
* immortal NULLABLE_ABSENT sentinel instead, which no value of the
|
|
664
|
+
* binding can hold and every RC entry point and the collector skip. */
|
|
665
|
+
private tdzEmptySentinel;
|
|
624
666
|
/** The TDZ-guarded read of a boxed binding: an empty payload slot is
|
|
625
667
|
* the temporal dead zone — throw Node's exact catchable ReferenceError
|
|
626
668
|
* (exprs.ts's varRef guard). Scalars then peek the one-element
|