diff --git a/main/minivm.c b/main/minivm.c index 193506d0..1852d1ec 100644 --- a/main/minivm.c +++ b/main/minivm.c @@ -17,7 +17,8 @@ void vm_lang_lua_repl(vm_config_t *config, vm_table_t *std, vm_blocks_t *blocks) int main(int argc, char **argv) { vm_config_t val_config = (vm_config_t) { .use_num = VM_USE_NUM_I32, - .tb_lbbv = false, + .tb_lbbv = true, + .tb_regs_cast = true, .tb_recompile = true, #if defined(EMSCRIPTEN) .target = VM_TARGET_TB_EMCC, diff --git a/vm/backend/exec.c b/vm/backend/exec.c index 5dc4d9b6..ca18fcc4 100644 --- a/vm/backend/exec.c +++ b/vm/backend/exec.c @@ -28,7 +28,8 @@ void *vm_cache_comp(const char *comp, const char *flags, const char *src, const fwrite(src, len, 1, out); fclose(out); vm_io_buffer_t *cmd_buf = vm_io_buffer_new(); - vm_io_buffer_format(cmd_buf, "%s -shared -O2 -foptimize-sibling-calls -fPIC %s %s -o %s -w -pipe", comp, flags, c_file, so_file); + // vm_io_buffer_format(cmd_buf, "%s -shared -g3 -foptimize-sibling-calls -fPIC %s %s -o %s -w -pipe", comp, flags, c_file, so_file); + vm_io_buffer_format(cmd_buf, "%s -shared -O3 -foptimize-sibling-calls -fPIC %s %s -o %s -w -pipe", comp, flags, c_file, so_file); int res = system(cmd_buf->buf); if (res) { return NULL; @@ -97,15 +98,16 @@ void *vm_cache_comp(const char *comp, const char *flags, const char *src, const fclose(out); vm_io_buffer_t *cmd_buf = vm_io_buffer_new(); vm_io_buffer_format(cmd_buf, "%s -shared -O3 -foptimize-sibling-calls -fPIC %s %s -o %s -w -pipe", comp, flags, c_file, so_file); + // vm_io_buffer_format(cmd_buf, "%s -shared -g3 -fsanitize=memory -foptimize-sibling-calls -fPIC %s %s -o %s -w -pipe", comp, flags, c_file, so_file); int res = system(cmd_buf->buf); if (res) { return NULL; } - remove(c_file); + // remove(c_file); } void *handle = dlopen(so_file, RTLD_LAZY); void *sym = dlsym(handle, entry); - remove(so_file); + // remove(so_file); return sym; } #endif