Draft: refactor initialization
This merge request showcases work in progress changes
This commit changes ECL core runtime:
- moves indispensable parts of the runtime to separate structures
- introduces a concept of exceptions that can be stack allocated
- allows for binding handlers in early environment
- refactors how we treat processes and environments
- introduces modules with a well specified life cycle (init module, env, cpu)
With these individual parts are more independent opening a path towards further changes:
- delimited continuations
- minimized runtime
- shared common language runtime (i.e multiple CL instances)
This merge request subsumes !348 (merged). Technically we could split this one in logical parts (each list of commits should be read from the bottom to the top):
Refactor stacks:
13755d0bb * origin/refactor-stacks cleanup: reorganize cl_env_struct
1551762a7 * stacks: add a general purpose stack implementation based on vector
f7633962d * stacks: refactor file to separate low level and high level operators
a14508cee * stacks: merge stack overflow errors into a single handler
2f9826506 * stacks: refactor the code in stacks.d
2d8331fca * stacks: remove serror, stack-error-handler and reset-margin
33b363915 * stacks: rename bds and vms stack pointers stored in frs
6dcff2267 * stacks: rename env runtime stack operators ecl_vms_*
f2cc791c1 * stacks: use a manual allocator for stacks
52ce2e8f5 * stacks: manually allocate bindings table
815e0daa0 * stacks: make runtime stack accessors inline functions
ad81ee8f4 * stacks: move runtime stack to a separate structure
3c8621105 * stacks: move C shadow stack to a separate structure
5260cbc7d * stacks: move invocation history stack to a separate structure
b42b1532c * stacks: move frames stack to a separate structure
a624a946b * stacks: clean up inlined versions for bds operators
3c75a98b2 * stacks: rename thread_local_bindings{,_size} to tl_bindings{,_size}
da3dc3424 * stacks: move the binding stack to a separate structure
Separate ecl_boot from cl_boot:
d840f1089 * nucleus: move ecl_core_struct to nucleus
8d936ab24 * nucleus: move protect and dummy tags to boot.d
ebdde0b63 * nucleus: move early constants from main.d to boot.d
3f8920753 * nucleus: move files process.o and process.d from OBJS to NUCL_OBJS
f1bcd3fa4 * nucleus: add a module boot for booting the core
e1d9726d4 * nucleus: add a module for program control transfer
86d64b358 * nucleus: move atomics from threads directory to core
09876a167 * nucleus: move function calling from apply.d and eval.d to call.d
4a760a06d * core: split cl_core_struct in two structure cl_core and ecl_core
b0d52e622 * core: define protect and dummy tags as constants
0b473f57e * core: move defacto constants from cl_core structure to global space
2cc9a4d4e * c/makefile: group files in rough categories
Introduce exceptions:
4f6296869 * exceptions: define *SIGNAL-HANDLERS* in cold_boot
0fe1887cb * exceptions: dispatch signals exceptions (not conditions)
ffbdf6f20 * exceptions: runtime stack error signals exceptions (not conditions)
3e500d93a * exceptions: interpreter signals exceptions (not conditions)
e422b1eed * exceptions: introduce the concept of an exception
e83abf68c * exceptions: introduce signals to the early environment
bde0bf209 * exceptions: rewrite signal handling to use functions and not lists
Refactor environment vs process vs thread allocations:
9ce19f55c * process: move ecl_clear_bignum_registers to _dealloc_env
0375f9747 * process: use GC_thread_is_registered() instead of the_env->cleanup
4ea1528b3 * nucleus: [2/n] move processing unit managament to nucleus
91f4fa8ec * nucleus: [1/n] move processing unit managament to nucleus
Introduce modules:
73fe3d1f7 * modules: [A/n] move the environment allocators to nucleus
c595bd013 * modules: [9/n] introduce ecl_module_thread
d14ccae13 * modules: [7/n] introduce ecl_module_stacks
9f2066e42 * modules: [6/n] introduce ecl_module_aux
2359c9c36 * modules: [5/n] introduce ecl_module_ffi
8c374067d * modules: [4/n] introduce ecl_module_bignum
525ddf3cf * modules: [3/n] introduce ecl_module_process
0aa9ddc14 * modules: [2/n] introduce ecl_module_unixint
dce0776b2 * modules: [1/n] introduce ecl_module_gc
9561872f2 * modules: [0/n] introduce a new structure ecl_module in the system
Decouple early environment:
b294f99bc * origin/implement-modules nucleus: introduce a table with early symbols ecl_symbols
ac6e5a26d * nucleus: move early stacks to a separate file
d984ad5bd * nucleus: move aux throw/go/tagbody implementations to jump.d
f436621eb * process: move process initialization to the process module hooks
d15028712 * garbage: register and unregister GC threads manually from a module
15118bfdd * process: abstract away create thread, exit thread and sigmask
Edited by Daniel Kochmański