Class ValueTraversal

java.lang.Object
cs1302.tracer.trace.ValueTraversal

public final class ValueTraversal extends Object
Iterative traversal of inline values; guest heap references remain leaves.
  • Field Details

    • MAX_DEPTH

      public static final int MAX_DEPTH
      Maximum inline value path length, including its root and leaf.
      See Also:
  • Method Details

    • validate

      public static void validate(ExecutionSnapshot snapshot)
      Checks every value root before snapshot accounting or conversion.
      Parameters:
      snapshot - Snapshot owned by the caller; must not be mutated during serialization.
    • visit

      public static void visit(TraceValue root, Consumer<TraceValue> visitor)
      Visits children before their parent, rejecting deep paths and identity cycles. Shared values are visited once; cached heights check each incoming path. Record hashCode is never invoked.
      Parameters:
      root - Root value, possibly null.
      visitor - Postorder consumer.