Commit 593b3ee
committed
Merge pull request #1909 from pguyot/w42/pico-embedded-jit
Embedded JIT mode for Pico
Continuation of:
- #1829
- #1838
- #1881
- #1891
- #1893
- #1900
- #1901
- #1903
- #1907
Add the ability to perform just in time compilation directly on Raspberry Pi
Pico. Erlang bytecode is compiled to armv6m on the first run and directly
executed on subsequent runs. In this PR, the native code compilation does not
take advantage of being done on the device, it still generates position
independent code.
If Erlang modules include `Type` chunk, the same optimizations that happen on
the desktop with precompilation could be done on the Pico, however current
release (0.7.5) of [`packbeam`](https://github.com/atomvm/atomvm_packbeam)
prunes the `Type` chunk.
Just in time compilation on the Pico is achieved by:
- Adding a flush call after JIT is performed, which is noop on all platforms
except on armv6m where we flush the literal pool (normally a noop, though, as
the pool should have been flushed earlier).
- Updating avm API to fetch the last section named end.
- Adding a `jit_stream_flash` for RP2 platform and adding a cache native code
mechanism that rely on the avm end section on RP2 to find out where to flash
jit code (after the last end) and detect if avm were updated.
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-laterFile tree
27 files changed
+2462
-154
lines changed- .github/workflows
- doc/src
- libs/jit/src
- src
- libAtomVM
- platforms
- emscripten/src
- esp32/main
- generic_unix
- lib
- rp2/src
- lib
- stm32/src
- tests
- libs/jit
27 files changed
+2462
-154
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
538 | 551 | | |
539 | 552 | | |
540 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
0 commit comments