MCPcopy Create free account
hub / github.com/bytedance/bolt / compileExpressions

Function compileExpressions

bolt/expression/ExprCompiler.cpp:631–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629} // namespace
630
631std::vector<std::shared_ptr<Expr>> compileExpressions(
632 const std::vector<TypedExprPtr>& sources,
633 core::ExecCtx* execCtx,
634 ExprSet* exprSet,
635 bool enableConstantFolding) {
636 Scope scope({}, nullptr, exprSet);
637 std::vector<std::shared_ptr<Expr>> exprs;
638 exprs.reserve(sources.size());
639
640 // Precompute a set of function calls that support flattening. This allows to
641 // lock function registry once vs. locking for each function call.
642 auto flatteningCandidates = collectFlatteningCandidates(sources);
643
644 for (auto& source : sources) {
645#ifdef ENABLE_BOLT_EXPR_JIT
646 exprs.push_back(compileExpression(
647 source,
648 &scope,
649 execCtx->queryCtx()->queryConfig(),
650 execCtx->pool(),
651 flatteningCandidates,
652 enableConstantFolding,
653 true));
654#else
655 exprs.push_back(compileExpression(
656 source,
657 &scope,
658 execCtx->queryCtx()->queryConfig(),
659 execCtx->pool(),
660 flatteningCandidates,
661 enableConstantFolding));
662#endif
663 }
664 return exprs;
665}
666
667} // namespace bytedance::bolt::exec

Callers 3

ExprSetMethod · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 7

compileExpressionFunction · 0.85
queryCtxMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
poolMethod · 0.45

Tested by 2

TEST_FFunction · 0.68
TEST_FFunction · 0.68