mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
refactor(core): run pending dynamic imports before ops (#18592)
This is in preparation to limit number of times we have to cross Rust -> V8 boundary on each tick of event loop.
This commit is contained in:
parent
c4628aa809
commit
686fe47749
1 changed files with 3 additions and 2 deletions
|
@ -1205,8 +1205,6 @@ impl JsRuntime {
|
||||||
|
|
||||||
self.pump_v8_message_loop()?;
|
self.pump_v8_message_loop()?;
|
||||||
|
|
||||||
// Ops
|
|
||||||
self.resolve_async_ops(cx)?;
|
|
||||||
// Dynamic module loading - ie. modules loaded using "import()"
|
// Dynamic module loading - ie. modules loaded using "import()"
|
||||||
{
|
{
|
||||||
// Run in a loop so that dynamic imports that only depend on another
|
// Run in a loop so that dynamic imports that only depend on another
|
||||||
|
@ -1232,6 +1230,9 @@ impl JsRuntime {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ops
|
||||||
|
self.resolve_async_ops(cx)?;
|
||||||
// Run all next tick callbacks and macrotasks callbacks and only then
|
// Run all next tick callbacks and macrotasks callbacks and only then
|
||||||
// check for any promise exceptions (`unhandledrejection` handlers are
|
// check for any promise exceptions (`unhandledrejection` handlers are
|
||||||
// run in macrotasks callbacks so we need to let them run first).
|
// run in macrotasks callbacks so we need to let them run first).
|
||||||
|
|
Loading…
Reference in a new issue