Move globals out of VM and into a Module struct.
Functions store a reference to the module where they were defined and load "module" variables from there. Right now there's only one "main" module, but this is a step in the right direction. Perf is down, though. :( binary_trees - wren .......... 3026 0.33s 88.28% relative to baseline delta_blue - wren .......... 7248 0.14s 94.32% relative to baseline fib - wren .......... 2414 0.41s 88.08% relative to baseline for - wren .......... 6753 0.15s 78.79% relative to baseline method_call - wren .......... 6624 0.15s 100.03% relative to baseline
This commit is contained in:
@@ -93,6 +93,8 @@ void wrenFreeVM(WrenVM* vm);
|
||||
WrenInterpretResult wrenInterpret(WrenVM* vm, const char* sourcePath,
|
||||
const char* source);
|
||||
|
||||
// TODO: Figure out how these interact with modules.
|
||||
|
||||
// Defines a foreign method implemented by the host application. Looks for a
|
||||
// global class named [className] to bind the method to. If not found, it will
|
||||
// be created automatically.
|
||||
|
||||
Reference in New Issue
Block a user