* Ask provider to JIT compile an expression. * * Returns true if successful, false if not. */
| 150 | * Returns true if successful, false if not. |
| 151 | */ |
| 152 | bool |
| 153 | jit_compile_expr(struct ExprState *state) |
| 154 | { |
| 155 | /* |
| 156 | * We can easily create a one-off context for functions without an |
| 157 | * associated PlanState (and thus EState). But because there's no executor |
| 158 | * shutdown callback that could deallocate the created function, they'd |
| 159 | * live to the end of the transactions, where they'd be cleaned up by the |
| 160 | * resowner machinery. That can lead to a noticeable amount of memory |
| 161 | * usage, and worse, trigger some quadratic behaviour in gdb. Therefore, |
| 162 | * at least for now, don't create a JITed function in those circumstances. |
| 163 | */ |
| 164 | if (!state->parent) |
| 165 | return false; |
| 166 | |
| 167 | /* if no jitting should be performed at all */ |
| 168 | if (!(state->parent->state->es_jit_flags & PGJIT_PERFORM)) |
| 169 | return false; |
| 170 | |
| 171 | /* or if expressions aren't JITed */ |
| 172 | if (!(state->parent->state->es_jit_flags & PGJIT_EXPR)) |
| 173 | return false; |
| 174 | |
| 175 | /* this also takes !jit_enabled into account */ |
| 176 | if (provider_init()) |
| 177 | return provider.compile_expr(state); |
| 178 | |
| 179 | return false; |
| 180 | } |
| 181 | |
| 182 | /* Aggregate JIT instrumentation information */ |
| 183 | void |
no test coverage detected