Consider converting FastTuple-returning functions in vm.cpp to use RAII value types

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      vm.cpp contains 12 ByteCode helper functions that still return FastTuple<bool, TypeTags, Value> and accept raw (TypeTags, Value) parameter pairs. These were not part of the vm_builtin*.cpp / vm_block.cpp conversion sweep (SPM-4577 Tier 2).

      Candidates:

      • getField (x2 overloads) — non-owning reads, could return TagValueView
      • getElement — non-owning read, could return TagValueView
      • getFieldOrElement — non-owning read, could return TagValueView
      • getArraySize — returns shallow NumberInt64, could return TagValueOwned
      • setField — creates a new object, could return TagValueMaybeOwned
      • aggSum, aggCount, aggMin, aggMax, aggFirst, aggLast — accumulator helpers, could return TagValueMaybeOwned

      Note: ByteCode::dispatchBuiltin in vm_builtin.cpp should remain as FastTuple — it is the intentional VM dispatch boundary between the RAII interior and the raw stack machinery.

      This is a consider ticket: scope and approach should be evaluated before committing, as some of these functions have many callers across the codebase.

            Assignee:
            Evan Bergeron
            Reporter:
            Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: