feat: move fiber execution of loaded modules from Wren to C runtime

The `loadModule_` primitive now returns a fiber when a module is loaded, and the C runtime handles calling it via `PRIM_RUN_FIBER` instead of the Wren code manually invoking the result. This removes the conditional `if (result != null) result.call` from the `import_` method in both the builtin source and the embedded libSource string, and adds `IS_FIBER` macro to `wren_value.h` for type checking in the native implementation.
This commit is contained in:
Bob Nystrom
2015-02-16 18:16:42 +00:00
parent f2424f029e
commit 2082b64454
3 changed files with 12 additions and 6 deletions
+1 -3
View File
@@ -60,9 +60,7 @@ class Sequence {
class String is Sequence {
import_(variable) {
var result = loadModule_
if (result != null) result.call
loadModule_
return lookUpVariable_(variable)
}
}