mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JavaScript: Pull out auxiliary predicate to improve join order in TPhi.
This commit is contained in:
@@ -122,10 +122,7 @@ private cached module Internal {
|
||||
}
|
||||
or TPhi(ReachableJoinBlock bb, SsaSourceVariable v) {
|
||||
liveAtEntry(bb, v) and
|
||||
exists (ReachableBasicBlock defbb, SsaDefinition def |
|
||||
def.definesAt(defbb, _, v) and
|
||||
bb.inDominanceFrontierOf(defbb)
|
||||
)
|
||||
inDefDominanceFrontier(bb, v)
|
||||
}
|
||||
or TRefinement(ReachableBasicBlock bb, int i, GuardControlFlowNode guard, SsaSourceVariable v) {
|
||||
bb.getNode(i) = guard and
|
||||
@@ -133,6 +130,17 @@ private cached module Internal {
|
||||
liveAtEntry(bb, v)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `bb` is in the dominance frontier of a block containing a definition of `v`.
|
||||
*/
|
||||
pragma[noinline]
|
||||
private predicate inDefDominanceFrontier(ReachableJoinBlock bb, SsaSourceVariable v) {
|
||||
exists (ReachableBasicBlock defbb, SsaDefinition def |
|
||||
def.definesAt(defbb, _, v) and
|
||||
bb.inDominanceFrontierOf(defbb)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `v` is a captured variable which is declared in `declContainer` and read in
|
||||
* `useContainer`.
|
||||
|
||||
Reference in New Issue
Block a user