Add SP@ IR op, replace SOURCE/DEPTH/PICK with Forth (Phase 7)
New IrOp::SpFetch pushes the current data-stack pointer value, enabling Forth-level stack introspection. This unblocks: - DEPTH: `: DEPTH 5440 SP@ - 2 RSHIFT ;` (DATA_STACK_TOP - sp) / 4 - PICK: `: PICK 1+ CELLS SP@ + @ ;` direct memory read - SOURCE: `: SOURCE 64 24 @ ;` reads INPUT_BUFFER_BASE + SYSVAR_NUM_TIB - FALIGNED, SFALIGNED, DFALIGNED: address alignment (shadowed in boot.fth) DEPTH and PICK are now compiled to native WASM — faster than the previous host-function dispatch through call_indirect + Rust closure + mutex. Removed ~109 lines of Rust. All 426 tests pass.
This commit is contained in:
@@ -133,6 +133,8 @@ pub enum IrOp {
|
||||
// -- System --
|
||||
/// Execute word by function table index: ( xt -- )
|
||||
Execute,
|
||||
/// Push the current data-stack pointer: ( -- addr )
|
||||
SpFetch,
|
||||
|
||||
// -- Float stack manipulation --
|
||||
/// Float duplicate: ( F: r -- r r )
|
||||
|
||||
Reference in New Issue
Block a user