Finish converting arithmetic builtins to use value RAII types

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QE 2026-05-25
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      Complete the RAII migration of vm_builtin_arith.cpp left unfinished by SERVER-114263 (first pass). 24 functions remain on the old auto [_, tag, val] = getFromStack(N) pattern.

      Scope of Work

      • src/mongo/db/exec/sbe/vm/vm_builtin_arith.cpp — unary/trig functions (abs, ceil, floor, exp, ln, sqrt, all trig variants): convert to viewFromStack; round/pow/sum functions (pow, genericRoundTrunc, round, trunc, builtinDoubleDoubleSum): convert with ownership review

      Technical Notes

      Use SERVER-114263 and genericDiv in vm_arith.cpp as reference. viewFromStack(N) returns TagValueView — use .tag / .value (no parens). For functions passing the owned flag downstream use moveFromStack.

            Assignee:
            Mihai Andrei
            Reporter:
            Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: