diff --git a/runtime/compiletime/README.md b/runtime/compiletime/README.md new file mode 100644 index 0000000..314fbd8 --- /dev/null +++ b/runtime/compiletime/README.md @@ -0,0 +1,5 @@ +A WebAssembly module instance is statically linked with the backing functions implementing the wasm32 ABI, yielding a *.so file that SLEdge can execute. This ensures that the instance is able to aggressively inline and optimize this code. + +They are broken into instruction types as on https://webassembly.github.io/spec/core/exec/instructions.html. They depend on common headers for the WebAssembly types located in the WebAssembly instance struct. These are located in runtime/include/common. + +The stubs correspond to awsm/src/codegen/runtime_stubs.rs diff --git a/runtime/compiletime/table_instructions.c b/runtime/compiletime/table_instructions.c index 575f1c5..2803ddf 100644 --- a/runtime/compiletime/table_instructions.c +++ b/runtime/compiletime/table_instructions.c @@ -1,11 +1,6 @@ #include "types.h" -/* This file contains the stub functions that the aWsm compiler expects - * This corresponds to awsm/src/codegen/runtime_stubs.rs - * This should be linked with the *.bc file generated by aWsm in order to compile a module as a *.so - */ - extern thread_local struct wasm_module_instance current_wasm_module_instance; INLINE void @@ -24,13 +19,6 @@ add_function_to_table(uint32_t idx, uint32_t type_id, char *pointer) }; } -/* - * Table handling functionality - * This was moved from compiletime in order to place the - * function in the callstack in GDB. It can be moved back - * to runtime/compiletime/memory/64bit_nix.c to remove the - * additional function call - */ INLINE char * get_function_from_table(uint32_t idx, uint32_t type_id) {