First declosure impl

This commit is contained in:
2026-09-04 13:53:59 +00:00
parent af85244587
commit 617dbeb988
7 changed files with 376 additions and 11 deletions
+16 -3
View File
@@ -175,16 +175,29 @@ Swap, CallMethod, PutLoc1, Drop) still occur elsewhere for ordinary reasons.
Only the specific class-pattern instances listed above are removed.
====================================================================
UNSUPPORTED (the pass panics)
====================================================================
DefineClass AtomU8 { arg: 1 } derived class (extends)
Prototype form would have to flatten the parent's prototype into the
child's and lower `super`. Neither is implemented, so declass panics
rather than emit a class that has silently lost its parent.
====================================================================
NOT TOUCHED (passed through unchanged)
====================================================================
DefineClass AtomU8 { arg: 1 } derived class
DefineMethod AtomU8 { arg: 1 } getter
DefineMethod AtomU8 { arg: 2 } setter
DefineMethodComputed ... computed method name
DefineClassComputed ... computed class name
Known gap: a getter or setter (DefineMethod with a non-zero kind) is
NOT yet passed through. It is wrongly lowered as an ordinary method,
to a put_field, giving a data property instead of an accessor. It
should instead make the whole class pass through untouched.
====================================================================
LEFT BEHIND (removed by a later pass)
+6 -2
View File
@@ -120,8 +120,12 @@ last argument, so it is args.last().
DETECT, abstractly:
plain call call | call0..3 (callee = last arg; not call_method,
call_constructor, or apply)
plain call call | call0..3 | tail_call (callee = last arg; not
call_method, call_constructor,
or apply)
A tail call stays a tail call. It pushes nothing and returns, so turning it
into an ordinary call would leave a value behind and drop the return.
outer, which in the example is: