JS: Add compileForOverlayEval: true#20421
Conversation
4f55fcb to
33001a7
Compare
There was a problem hiding this comment.
Pull Request Overview
Enables the compileForOverlayEval: true configuration in the JavaScript CodeQL library and optimizes token navigation by introducing a helper predicate to improve join ordering performance.
- Adds
compileForOverlayEval: trueto the qlpack.yml configuration - Introduces
adjacentTokenshelper predicate to optimize join order in token navigation - Refactors
getNextToken()method to use the new helper predicate
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| javascript/ql/lib/qlpack.yml | Enables compileForOverlayEval configuration option |
| javascript/ql/lib/semmle/javascript/Tokens.qll | Adds adjacentTokens helper predicate and refactors getNextToken for better performance |
33001a7 to
f4b798b
Compare
80475a6 to
fdb6dd3
Compare
tausbn
left a comment
There was a problem hiding this comment.
One minor comment, otherwise this looks good to me. 👍
|
|
||
| import javascript | ||
|
|
||
| private predicate adjacentTokens(Token token1, Token token2) { |
There was a problem hiding this comment.
No pragma[nomagic] on this to prevent future reinlining?
There was a problem hiding this comment.
Added pragma[nomagic]. The DIL seems to be unchanged so we shouldn't have to rerun the evaluations.
120dcd3 to
c583b48
Compare
tausbn
left a comment
There was a problem hiding this comment.
One minor comment, otherwise this looks good to me. 👍
|
|
||
| import javascript | ||
|
|
||
| private predicate adjacentTokens(Token token1, Token token2) { |
There was a problem hiding this comment.
No pragma[nomagic] on this to prevent future reinlining?
There was a problem hiding this comment.
Added pragma[nomagic]. The DIL seems to be unchanged so we shouldn't have to rerun the evaluations.
120dcd3 to
c583b48
Compare
Adds
compileForOverlayEval: trueand fixes a bad join order arising when this is enabled.Evaluations: