[work loop] Prevent work loop from being inlined (#16865)

Uses Closure Compiler's `@noinline` directive.

See https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#noinline
This commit is contained in:
Andrew Clark
2019-09-23 11:12:47 -07:00
committed by GitHub
parent 312b462d54
commit a87d245fc2
+3
View File
@@ -1422,6 +1422,8 @@ function inferTimeFromExpirationTimeWithSuspenseConfig(
);
}
// The work loop is an extremely hot path. Tell Closure not to inline it.
/** @noinline */
function workLoopSync() {
// Already timed out, so perform work without checking if we need to yield.
while (workInProgress !== null) {
@@ -1429,6 +1431,7 @@ function workLoopSync() {
}
}
/** @noinline */
function workLoop() {
// Perform work until Scheduler asks us to yield
while (workInProgress !== null && !shouldYield()) {