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:
+1
-3
@@ -60,9 +60,7 @@ class Sequence {
|
||||
|
||||
class String is Sequence {
|
||||
import_(variable) {
|
||||
var result = loadModule_
|
||||
if (result != null) result.call
|
||||
|
||||
loadModule_
|
||||
return lookUpVariable_(variable)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user