Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Oct 24, 2025

Continuation of:

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@pguyot pguyot changed the title JIT: Optimize memory usage by rewriting jump table immediatly JIT: Optimize memory usage by rewriting jump table immediately Oct 24, 2025
Use a cache to remember tail calls that were already implemented and
replace further implementations of the same tail call with a jump to the
previous implementation.

Coverage shows that all cases are covered in libs/estdlib/src and libs/jit/src:

OP_RETURN: 50 misses, 1735 hits (97%)
OP_JUMP/OP_CALL_LAST/OP_CALL_ONLY: 656 misses, 389 hits (37%)
OP_CALL_LAST: 220 misses, 206 hits (48%)
OP_FUNC_INFO: 58 misses, 1619 hits (97%)

Signed-off-by: Paul Guyot <[email protected]>
This is required as flash chips are programmed by setting bits from 1 to 0,
and erased by setting all bits to 0, so placeholders set to FF can be
replaced without erasing a whole block.

Signed-off-by: Paul Guyot <[email protected]>
@pguyot pguyot force-pushed the w43/jit-rewrite-jumptable-asap branch from 4e5b42a to b55e295 Compare October 24, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant