Skip to content

Commit 047aee3

Browse files
committed
add pragma[noinline] to predicates where the qldoc mentions join-order
1 parent a237137 commit 047aee3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

javascript/ql/lib/semmle/javascript/dataflow/AbstractProperties.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class AbstractProtoProperty extends AbstractProperty {
8686
* has to be toplevel predicate to avoid a spurious type join with `AbstractProperty`,
8787
* which in turn introduces a materialization.
8888
*/
89+
pragma[noinline]
8990
private AbstractValue getAnAssignedValue(AbstractValue b, string p) {
9091
exists(AnalyzedPropertyWrite apw | apw.writesValue(b, p, result))
9192
}

javascript/ql/lib/semmle/javascript/dataflow/Configuration.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ private predicate barrierGuardBlocksEdge(
493493
*
494494
* This predicate exists to get a better join-order for the `barrierGuardBlocksEdge` predicate above.
495495
*/
496+
pragma[noinline]
496497
private BasicBlock getADominatedBasicBlock(BarrierGuardNode guard, ConditionGuardNode cond) {
497498
barrierGuardIsRelevant(guard) and
498499
guard.getEnclosingExpr() = cond.getTest() and
@@ -996,6 +997,7 @@ private predicate exploratoryLoadStep(
996997
*
997998
* This private predicate is only used in `exploratoryLoadStep`, and exists as a separate predicate to give the compiler a hint about join-ordering.
998999
*/
1000+
pragma[noinline]
9991001
private string getAForwardRelevantLoadProperty(DataFlow::Configuration cfg) {
10001002
exists(DataFlow::Node previous | isRelevantForward(previous, cfg) |
10011003
basicStoreStep(previous, _, result) or
@@ -1055,6 +1057,7 @@ private predicate exploratoryBackwardStoreStep(
10551057
*
10561058
* This private predicate is only used in `exploratoryBackwardStoreStep`, and exists as a separate predicate to give the compiler a hint about join-ordering.
10571059
*/
1060+
pragma[noinline]
10581061
private string getABackwardsRelevantStoreProperty(DataFlow::Configuration cfg) {
10591062
exists(DataFlow::Node mid | isRelevant(mid, cfg) |
10601063
basicLoadStep(mid, _, result) or
@@ -1672,6 +1675,7 @@ private predicate onPath(DataFlow::Node nd, DataFlow::Configuration cfg, PathSum
16721675
*
16731676
* This predicate has been outlined from `onPath` to give the optimizer a hint about join-ordering.
16741677
*/
1678+
pragma[noinline]
16751679
private predicate onPathStep(
16761680
DataFlow::Node nd, DataFlow::Configuration cfg, PathSummary summary, PathSummary stepSummary,
16771681
DataFlow::Node mid

0 commit comments

Comments
 (0)