dibyendumajumdar / ravi

Ravi is a dialect of Lua, featuring limited optional static typing, JIT and AOT compilers
http://ravilang.github.io/
Other
1.16k stars 62 forks source link

Performance tuning of interpreter - fixed stacks #116

Open dibyendumajumdar opened 7 years ago

dibyendumajumdar commented 7 years ago

Lua allocates stacks dynamically. This means that the VM cannot assume that the base pointer in a function is stable while the function is executing as the base may change due to reallocation. Perhaps by creating pre-allocated stacks of fixed size we can avoid this inefficiency - this will particularly help JIT implementation as we will not have to rely upon LLVM to remove redundant updates to the base pointer.

dibyendumajumdar commented 4 years ago

The main issue with this is that supporting co-routines requires stacks to be dynamic. Because the execution can be resumed on a different stack.