mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[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:
1 parent
312b462d54
commit
a87d245fc2
1 file changed
+3
@@ -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()) {
|
||||
|
||||
Reference in new issue
Block a user