Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Oct 23, 2025

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

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Add a new `term_reuse_binary` to reuse a refc binary, taking advantage
of private_append compiler optimization.

Add handling of out of memory errors in term_alloc_refc_binary by raising
out of memory error instead of aborting.

Replaced uses of `term_create_empty_binary` with
`term_create_uninitialized_binary` since we don't need to set the binary
content to zeroes.

Update `and_/3` signature in JIT backends to handle and with a new register,
and performed few optimizations accordingly by removing unnecessary copy.

Signed-off-by: Paul Guyot <[email protected]>
@pguyot pguyot force-pushed the w43/esp32-embedded-jit branch from 7be0cea to 90966fd Compare October 25, 2025 16:10
pguyot added 27 commits October 25, 2025 18:11
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]>
Introduce jit_stream_flash.c common implementation that leverages
(common) flash behavior that can be written from 1 to 0.

Signed-off-by: Paul Guyot <[email protected]>
- Add riscv32 to AVM_PRECOMPILED_TARGETS
- Enable ENABLE_TRACE for debugging
- Add riscv32 directory handling in test.c

Signed-off-by: Paul Guyot <[email protected]>
Signed-off-by: Paul Guyot <[email protected]>
This reduces memory usage when call_or_schedule_next or
set_continuation_to_label are invoked with known labels

Signed-off-by: Paul Guyot <[email protected]>
@pguyot pguyot force-pushed the w43/esp32-embedded-jit branch from 90966fd to 4e7dc5c Compare October 25, 2025 16:13
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