Skip to content

Split ExecutionFrame::Next() into a fast path and an out-of-line slow path. - #2305

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_989862082
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_989862082

Conversation

@copybara-service

Copy link
Copy Markdown

Split ExecutionFrame::Next() into a fast path and an out-of-line slow path.

Next() is called once per evaluation step. It is split into a small fast
path and an out-of-line ReturnFromSubexpression(). The fast path returns the
next step in the current execution path, or nullptr when the top-level
program finishes (which happens once per evaluation). The rare case of
returning from a lazily evaluated subexpression is handled out of line. This
keeps Next() small enough to inline into the ExecutionFrame::Evaluate loop
without changing behavior.

… path.

`Next()` is called once per evaluation step. It is split into a small fast
path and an out-of-line `ReturnFromSubexpression()`. The fast path returns the
next step in the current execution path, or `nullptr` when the top-level
program finishes (which happens once per evaluation). The rare case of
returning from a lazily evaluated subexpression is handled out of line. This
keeps `Next()` small enough to inline into the `ExecutionFrame::Evaluate` loop
without changing behavior.

PiperOrigin-RevId: 989862082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants