aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/base.zc
Commit message (Collapse)AuthorAgeFilesLines
* uninit: track aggregate fills per part, sticky computed-index fills, &a[k] ↵Gravatar zinc 12 days1-1/+3
| | | | and method calls set the aggregate; fix test/example hits; docs
* definite assignment: reading a local before it is initialized is a compile ↵Gravatar zinc 12 days1-12/+13
| | | | | | error (spec 4.1.5, b.1.9) track linited per local alongside the ownership state; snapshots, exit records and joins carry it, and a join keeps a local set only when every reaching path set it. x = e, a declaration initializer, &x (out-parameter), a full array initializer, or using an aggregate as an address set a local; field and element writes do not set the aggregate. while/for bodies that may run zero times do not count; do/while does. compiler, runtime, std, actor and lsp sources initialize the locals the rule flagged; zc0 accepts = {} brace lists (zeroed). tests: tests/errors/uninit_*.zc, tests/conformance/4-statements/uninit_*.zc
* constant expressions: c precedence and / % ^ (b.1.3); local const usable in ↵Gravatar zinc 12 days1-1/+2
| | | | constant expressions (b.1.7, b.2.16); zc0 matches
* merge work/demo-fixes: analyzer ownership fixes (back links, loop-built ↵Gravatar zinc 12 days1-3/+10
|\ | | | | | | lists, .u inference), Io.print any args, block-end borrow messages
| * analyzer: infer .u from returns of fresh objects in the body (prescan guess, ↵Gravatar zinc 13 days1-1/+1
| | | | | | | | then checked as .u)
| * analyzer: an outer owner moved into a deeper container can take it back ↵Gravatar zinc 13 days1-2/+9
| | | | | | | | (loop-built lists); block-end frees name the owner (why 9) in messages and LSP related info
* | hold blocks: top-level hold { shared let ...; fn ... } monitors; shared ↵Gravatar zinc 13 days1-0/+6
|/ | | | values kept by the host and copied in/out at the outermost call, reentrant per-block locks in declaration order (core, micro)
* lsp: borrow errors ranged on the use, with related information for where the ↵Gravatar zinc 13 days1-3/+22
| | | | owner ended and was declared; vscode client passes relatedInformation through
* analyzer: check borrow returns of forward-called functions at the unit's ↵Gravatar zinc 13 days1-1/+2
| | | | end; borrows clause for prototypes, definitions, externs and function types, checked against the body
* analyzer: use-after-end messages name the borrower, the owner and how the ↵Gravatar zinc 13 days1-7/+23
| | | | owner ended (freed, moved, .d parameter, push, global, reassignment), with fixtures
* wip: prover gaps (inline len bound, cross-array, rt.new depth, fixed new, ↵Gravatar zinc 13 days1-1/+2
| | | | affine i*n+k); unbuilt and untested
* destructors: reassigning an m owner that still holds a value frees the old ↵Gravatar zinc 13 days1-0/+1
| | | | value first, running its drop (right side first, then the free, then the store), with hint: x: reassigning frees the old value; a new value that is part of the old one is an error; u, d and captured owners keep the leak error; the new value's size, leaf type and drop are recorded like a declaration's; spec 6.8.5, 6.15.2
* compiler: a //:lines marker starts a new file, so unbounded; and unchecked; ↵Gravatar zinc 13 days1-1/+3
| | | | of the source before it end there: a program joined to the unbounded runtime in a self-hosted run-only image is bounds-checked again (since d55b5fd its index errors went unreported); runtime_image_test expects the trap's exit status 2; spec 4.15.1, 4.x unchecked, 5.15.3
* compiler: the drop globals' comment says mailbox send, so nothing the ↵Gravatar zinc 13 days1-1/+1
| | | | compiler reads mentions actors (test.sh check)
* destructors: heap(v), drop(v, f) / v.drop(f) / v.drop = f, struct drop ↵Gravatar zinc 13 days1-0/+5
| | | | methods, collector drops after the sweep (once, resurrection), freed blocks forget their drop, temporaries drop at statement end with a hint, actor send check; o3: no collection inside a region (pending until the outermost exit), no drops set or ended inside o3; spec 3.11.6, 4.10.3-4, 6.15
* explain-checks: the record writer moves to src/lib/explain.zc, embedded and ↵Gravatar zinc 13 days1-1/+1
| | | | compiled only in that mode; the genome keeps the call sites and a hook
* bounds: body scan, loop-entry hoisting, pointer proofs from requested size, ↵Gravatar zinc 13 days1-0/+9
| | | | --explain-checks v1 (non-o3 code)
* zy: nonzero exit on compile errorsGravatar zinc 13 days1-3/+5
|
* bounds checking: port agent/bounds-checking onto main 0879d0a; unbounded ↵Gravatar zinc 14 days1-4/+8
| | | | main in o3call, o3 tests expect no check, boundsrules, bounds_fixed, bounds_heap and zc0unbounded tests
* line tables and backtraces: port agent/line-tables onto main, op 56 on the ↵Gravatar zinc 14 days1-1/+88
| | | | x86-64 jit, docs, measurements, tests; default genome reservation 0x68000
* zc: add the defer statementGravatar zinc 14 days1-0/+8
| | | | | | | | | | | | defer expr; and defer { ... } register code that runs when the enclosing block ends: at the end of the block, and at return, break and continue that leave it. the tokens are kept at the defer and compiled again at each exit (block_close, body, kw_return, kw_break, kw_continue), newest first, before the block's variables are released, so the analyzer sees a deferred rt.free(p) as the transfer of p where it runs. names mean what they meant at the defer; values are read when it runs. return, break and continue inside a deferred statement are errors, reported once. works in unchecked code and closures (own base per function context).
* split compiler.zc into files by phaseGravatar zinc 14 days1-0/+1384
src/compiler/compiler.zc is now twelve files under src/compiler/, listed in order in src/compiler/parts. cat of the parts in order is byte-identical to the old file, so every compiler and image except the language server's is unchanged. no function was edited. consumers read the list: the makefile, bootstrap-check, genmap (which still writes one compiler.zc into a generated map directory), tinyvm.bat, test.sh, test_win.ps1 and the lsp drivers. the language server embeds each part and serves them joined as the one document tinyvm:/compiler.zc.