Commit d708300
feat(vm-jit): native-call ABI slice 1 — depth-carrying call ABI
First slice of native recursion (the call-ABI keystone). Threads a native
call-chain depth through the compiled-function ABI so a later slice can guard
against host-stack overflow before enabling recursive native->native calls.
- CompiledAbi gains a trailing `depth: usize` parameter.
- compile_inner appends it to the function signature; build_function binds it at
the entry block.
- Each `CallNative` forwards `caller_depth + 1` to its callee; the top-level
`call()` starts the chain at depth 0.
Carried only — no entry guard yet, so behavior is unchanged. The public
`NativeModule::call` signature is unchanged, so reg_vm callers are unaffected.
Validated: vm-jit 81/0 (incl. native-call-chain + child-deopt), differential
33/0 (the corpus heavily exercises CallNative + force-deopt), rsscript lib
native-call/deopt 15/0, jit_acceptance 83/0, default workspace build clean.
Next: slice 2 — CallSelf lowering + entry depth guard (declare-before-define).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 39ed894 commit d708300
2 files changed
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1237 | 1237 | | |
1238 | 1238 | | |
1239 | 1239 | | |
| 1240 | + | |
1240 | 1241 | | |
1241 | 1242 | | |
1242 | 1243 | | |
| |||
1833 | 1834 | | |
1834 | 1835 | | |
1835 | 1836 | | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
1836 | 1842 | | |
1837 | 1843 | | |
1838 | 1844 | | |
| |||
2169 | 2175 | | |
2170 | 2176 | | |
2171 | 2177 | | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
2172 | 2181 | | |
2173 | 2182 | | |
2174 | 2183 | | |
| |||
3435 | 3444 | | |
3436 | 3445 | | |
3437 | 3446 | | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
3438 | 3451 | | |
3439 | 3452 | | |
3440 | 3453 | | |
| |||
3931 | 3944 | | |
3932 | 3945 | | |
3933 | 3946 | | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
3934 | 3951 | | |
3935 | 3952 | | |
3936 | 3953 | | |
| |||
3942 | 3959 | | |
3943 | 3960 | | |
3944 | 3961 | | |
| 3962 | + | |
3945 | 3963 | | |
3946 | 3964 | | |
3947 | 3965 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
221 | 235 | | |
222 | 236 | | |
223 | 237 | | |
| |||
0 commit comments