| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Mohamed Hegazy (@mhegazy) Vladimir Matveev (@vladima) Ron Buckton (@rbuckton) My latest commit optimizes the critical code paths in the binder for a bind time reduction of about 10%. Specifically, the bindChildren method had gotten really bloated and didn't put getContainerFlags to its proper full use. We'll now completely circumvent the container specific logic when the container flags are zero (which is the common case). |
Sorry, something went wrong.
|
Turns out there were more opportunities for optimization in the binder. Bind time is now reduced by 25% compared to the original code. Latest gains come from completely circumventing bindChildren for terminal nodes (such as identifiers, literals, and other token nodes). Also, the updateStrictMode function was folded into bindWorker. |
Sorry, something went wrong.
| const restTypes: Type[] = []; | ||
| for (let i = indexOfParameter; i < iife.arguments.length; i++) { | ||
| restTypes.push(getTypeOfExpression(iife.arguments[i])); | ||
| if (func.kind === SyntaxKind.FunctionExpression || func.kind === SyntaxKind.ArrowFunction) { |
There was a problem hiding this comment.
we already check this in getImmediatelyInvokedFunctionExpression
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, I'll remove it.
Sorry, something went wrong.
|
👍 |
Sorry, something went wrong.
|
Vladimir Matveev (@vladima) and Ron Buckton (@rbuckton) can you take a look. |
Sorry, something went wrong.
| hasExplicitReturn = false; | ||
| currentFlow = { flags: FlowFlags.Start }; | ||
| if (containerFlags & ContainerFlags.IsControlFlowContainer) { | ||
| const saveCurrentFlow = currentFlow; |
There was a problem hiding this comment.
Do you also need to save/restore the currentTrueTarget and currentFalseTarget flow labels here? I see that they are tracked in bindConditionalExpressionFlow and bindPrefixUnaryExpressionFlow, but what happens when one branch of the condition contains an IIFE?
Sorry, something went wrong.
There was a problem hiding this comment.
No, there's no need to save those. They're only used when a conditional operator is immediately contained in a conditional statement, and they're saved and restored at that point.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR improves control flow analysis as follows:
Some examples:
Fixes #8381.