Skip to content

Commit

Permalink
Merge branch 'v0.0.5-pre' of https://github.com/fastvm/minivm into v0…
Browse files Browse the repository at this point in the history
….0.5-pre
  • Loading branch information
ShawSumma committed Jul 26, 2024
2 parents 5595984 + 230658e commit 79896e2
Show file tree
Hide file tree
Showing 28 changed files with 987 additions and 1,146 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ package-lock.json
web/minivm.js
web-raw/minivm.js
web-raw/minivm.wasm
.DS_Store
208 changes: 0 additions & 208 deletions main/driver.mjs

This file was deleted.

6 changes: 3 additions & 3 deletions main/minivm.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ __attribute__((no_instrument_function)) int main(int argc, char **argv) {
} else if (!strcmp(arg, "--no-dump-ir")) {
vm->dump_ir = false;
} else if (!strcmp(arg, "--repl")) {
vm_repl(vm);
vm_lang_lua_repl(vm);
isrepl = false;
} else {
isrepl = false;
Expand All @@ -70,7 +70,7 @@ __attribute__((no_instrument_function)) int main(int argc, char **argv) {
exit(1);
}

vm_block_t *entry = vm_compile(vm, src, name ? name : "__expr__");
vm_ir_block_t *entry = vm_lang_lua_compile(vm, src, name ? name : "__expr__");

vm_obj_t value = vm_run_main(vm, entry);
if (vm_obj_is_error(value)) {
Expand All @@ -91,7 +91,7 @@ __attribute__((no_instrument_function)) int main(int argc, char **argv) {
}

if (isrepl) {
vm_repl(vm);
vm_lang_lua_repl(vm);
}

#if VM_USE_SPALL
Expand Down
18 changes: 0 additions & 18 deletions main/test/globals.lua

This file was deleted.

4 changes: 3 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ MAKE_INCLUDE ?=
# setup targets
default: all

all: build/bin/minivm${EXE}
all: minivm

minivm: build/bin/minivm${EXE}

# specific builds
clean: .dummy
Expand Down
4 changes: 3 additions & 1 deletion test/closure/funcret.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ local add = function(x)
end
end

local max = tonumber(arg and arg[1]) or 1000000

local i = 0
while i < 1000 * 1000 * 10 do
while i < max do
i = add(i)(1)
end

Expand Down
20 changes: 20 additions & 0 deletions test/test.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local function run(x, y)
print('-- ' .. tostring(x) .. ' and ' .. tostring(y))
print(x and y)
print(
do
local tmp = x
if x then
y
else
x
end
end
)
end

run(true, true)
run(true, false)
run(false, true)
run(false, false)

File renamed without changes.
Loading

0 comments on commit 79896e2

Please sign in to comment.