Rewrite module loading in order to be smaller

Aperta
#1,950 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c, erlang

Direzione di ricerca

Start with the module loading and parsing implementation in opcodesswitch.h, where IMPL_CODE_LOADER enables the current code. Investigate how the mega-switch handles opcode definitions and BIF calls, then assess whether a table-driven parsing loop can reduce flash usage and detect missing BIFs. Done means a smaller loader that checks consistency and avoids crashes from missing BIFs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Module code loading / parsing is implemented in opcodesswitch.h when IMPL_CODE_LOADER is defined, that relies on the mega-switch and a lot on inlined code.
As a consequence the compile code takes a lot of space.
The whole functionality can be replaced with a smaller parsing loop that relies on some kind of opcode definition table, saving quite a lot of space on flash memory.
Last but not least, a good smarter implementation, should verify consistency and avoid some issues, such as calling missing BIFs (it causes a crash).

Lingua principale
Erlang
Stelle
2.3k
Fork
171
Merge medio
5g 11h
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di atomvm/AtomVM

Tutte le issue di atomvm/AtomVM

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.