Repository navigation
compiler: keep raw memory ABI out of user symbol tables - #206
Merged
Merged
Conversation
- Split prelude builtins into public ABI and raw/system ABI. Only public names are registered as SYM_FN; raw names resolve solely through the prelude query in @std/@core library context. - User code now gets N06 for load8/store8/load64/w32/_dyncpy/ load_str_ptr/store_str_ptr. cell_load/cell_store/alloc/syscall3 remain public ABI. - Always track the owning library of a compilation unit (not only when the pub layer is on) so raw visibility has an owner even in ordinary programs. Compiler implementation trees (src/arch, src/runtime, ...) belong to @core. - Record the main source path; guard empty virtual file paths before reading a stored path string (purity self-test crashed on the empty slot). - Update internal fixtures that used raw names to public rawbuf wrappers or cell_load; pin the boundary with test_raw_abi_boundary and the LSP completion test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
把前端的 ABI 内建分成公开 ABI与raw/系统 ABI 两层。raw 名不再进入用户符号表。
load8/store8/load64/w32/_dyncpy/load_str_ptr/store_str_ptr:用户代码调用 →
N06 Undefined function;LSP 补全不提供;@std/@core正常使用。cell_load/cell_store/alloc/syscall3/syscall4/get_arg等保持公开 ABI。prelude_builtin_add增加可见性列;只有公开 ABI 注册为SYM_FN,raw 名仅通过prelude 查询在库上下文中解析。删除了 checker 末尾绕过可见性的 builtin 回退循环。
pub层开关:普通用户程序也记录当前函数所属库,raw 可见性据此判定。编译器实现域(
src/arch、src/runtime、src/os、src/format、src/lsp、src/targets等)归入
@core。rawbuf包装或cell_load,新增test_raw_abi_boundary钉边界。test_lsp.py补断言:补全候选不包含load8/store8。验证
selfhost-tests全绿bootstrap-tests全绿check全绿canary5/5,值与上一代逐字节相同(raw 名不注册不改变.ccr/ ELF)load8(...)/store8(...)→ N06;rawbuf.rawRead8公开包装 build+run rc=42