Documentation

Miri.Interpreter.Stack

Source-shaped stack-frame state and local storage operations from pinned rustc_const_eval/src/interpret/stack.rs. Interpreter callbacks remain explicit for layout queries, machine hooks, allocation, and deallocation.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[reducible, inline]

      Frames and call dispatch share the complete canonical instance identity.

      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[instance_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.
                    structure Miri.Interpreter.Frame (Prov Layout Extra : Type) :
                    Instances For
                      @[instance_reducible]
                      instance Miri.Interpreter.instDecidableEqFrame {Prov✝ Layout✝ Extra✝ : Type} [DecidableEq Prov✝] [DecidableEq Layout✝] [DecidableEq Extra✝] :
                      DecidableEq (Frame Prov✝ Layout✝ Extra✝)
                      Equations
                      def Miri.Interpreter.instDecidableEqFrame.decEq {Prov✝ Layout✝ Extra✝ : Type} [DecidableEq Prov✝] [DecidableEq Layout✝] [DecidableEq Extra✝] (x✝ x✝¹ : Frame Prov✝ Layout✝ Extra✝) :
                      Decidable (x✝ = x✝¹)
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[instance_reducible]
                        instance Miri.Interpreter.instReprFrame {Prov✝ Layout✝ Extra✝ : Type} [Repr Prov✝] [Repr Layout✝] [Repr Extra✝] :
                        Repr (Frame Prov✝ Layout✝ Extra✝)
                        Equations
                        def Miri.Interpreter.instReprFrame.repr {Prov✝ Layout✝ Extra✝ : Type} [Repr Prov✝] [Repr Layout✝] [Repr Extra✝] :
                        Frame Prov✝ Layout✝ Extra✝ → Nat → Std.Format
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Miri.Interpreter.Frame.create {Prov Layout Extra : Type} (loadedBody : LoadedBody) (functionInstance : FrameInstance) (extra : Extra) (returnContinuation : ReturnContinuation) (returnPlace : RuntimeStackPlace Prov) (initialSpan : MIR.SpanRef) (localsIdentity : LocalsIdentity) :
                          Frame Prov Layout Extra

                          The source push_stack_frame_raw initialization: one dead, uncached local state for each MIR local declaration. The other frame fields are required inputs; no body, return place, instance, or machine extra is invented here.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Miri.Interpreter.Frame.currentLoc {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) :
                            Equations
                            Instances For
                              def Miri.Interpreter.Frame.getLocal {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (localId : MIR.LocalId) :
                              Equations
                              Instances For
                                def Miri.Interpreter.Frame.getLocalOperand {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (localId : MIR.LocalId) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Miri.Interpreter.Frame.replaceLocalValue {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (localId : MIR.LocalId) (value : LocalValue Prov) :
                                  Except StackError (Frame Prov Layout Extra)

                                  Replace only the LocalValue, preserving rustc's memoized layout.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Miri.Interpreter.Frame.setLocalOperand {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (localId : MIR.LocalId) (value : Operand Prov) :
                                    Except StackError (Frame Prov Layout Extra)

                                    access_mut-style update: dead locals fail, and the cached layout is retained exactly. Callers performing actual writes must run their hooks first.

                                    Equations
                                    Instances For
                                      def Miri.Interpreter.Frame.getLocalLayout {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (localId : MIR.LocalId) :
                                      Equations
                                      Instances For
                                        def Miri.Interpreter.Frame.getOrCacheLocalLayout {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (localId : MIR.LocalId) (computed : Layout) :
                                        Except StackError (Frame Prov Layout Extra × Layout)

                                        Cache the source-computed layout only if no layout was already memoized. The returned layout is the cached one when present, matching layout_of_local.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def Miri.Interpreter.Frame.setLocation {Prov Layout Extra : Type} (self : Frame Prov Layout Extra) (location : FrameLocation) :
                                          Except StackError (Frame Prov Layout Extra)
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            structure Miri.Interpreter.Stack (Prov Layout Extra : Type) :
                                            Instances For
                                              def Miri.Interpreter.instDecidableEqStack.decEq {Prov✝ Layout✝ Extra✝ : Type} [DecidableEq Prov✝] [DecidableEq Layout✝] [DecidableEq Extra✝] (x✝ x✝¹ : Stack Prov✝ Layout✝ Extra✝) :
                                              Decidable (x✝ = x✝¹)
                                              Equations
                                              Instances For
                                                @[instance_reducible]
                                                instance Miri.Interpreter.instDecidableEqStack {Prov✝ Layout✝ Extra✝ : Type} [DecidableEq Prov✝] [DecidableEq Layout✝] [DecidableEq Extra✝] :
                                                DecidableEq (Stack Prov✝ Layout✝ Extra✝)
                                                Equations
                                                def Miri.Interpreter.instReprStack.repr {Prov✝ Layout✝ Extra✝ : Type} [Repr Prov✝] [Repr Layout✝] [Repr Extra✝] :
                                                Stack Prov✝ Layout✝ Extra✝ → Nat → Std.Format
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[instance_reducible]
                                                  instance Miri.Interpreter.instReprStack {Prov✝ Layout✝ Extra✝ : Type} [Repr Prov✝] [Repr Layout✝] [Repr Extra✝] :
                                                  Repr (Stack Prov✝ Layout✝ Extra✝)
                                                  Equations
                                                  def Miri.Interpreter.Stack.empty {Prov Layout Extra : Type} :
                                                  Stack Prov Layout Extra
                                                  Equations
                                                  Instances For
                                                    def Miri.Interpreter.Stack.currentFrame? {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) :
                                                    Option (Frame Prov Layout Extra)
                                                    Equations
                                                    Instances For
                                                      def Miri.Interpreter.Stack.frameIndex {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) :
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        def Miri.Interpreter.Stack.pushFrame {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) (frame : Frame Prov Layout Extra) :
                                                        Except StackError (Stack Prov Layout Extra)
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          def Miri.Interpreter.Stack.popFrame {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) :
                                                          Except StackError (Stack Prov Layout Extra × Frame Prov Layout Extra)
                                                          Equations
                                                          Instances For
                                                            def Miri.Interpreter.Stack.updateCurrentLocation {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) (location : FrameLocation) :
                                                            Except StackError (Stack Prov Layout Extra)
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              def Miri.Interpreter.Stack.getLocal {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) (localId : MIR.LocalId) :
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                def Miri.Interpreter.Stack.getLocalOperand {Prov Layout Extra : Type} (self : Stack Prov Layout Extra) (localId : MIR.LocalId) :
                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  structure Miri.Interpreter.StackEffect (State α : Type) :

                                                                  Stateful callback result: effects before an error are never rolled back.

                                                                  Instances For
                                                                    structure Miri.Interpreter.LocalStorageHooks (Prov Layout Extra State : Type) :

                                                                    Required compiler and machine operations. veryTriviallySized must implement source's recursive type-kind classifier; layout includes normalization and from_known_layout. Allocation/deallocation use stack memory kind.

                                                                    Instances For
                                                                      structure Miri.Interpreter.LocalStorageResult (Prov Layout Extra State : Type) :
                                                                      Instances For
                                                                        def Miri.Interpreter.Frame.deallocateLocal {Prov Layout Extra State : Type} (hooks : LocalStorageHooks Prov Layout Extra State) (state : State) (value : LocalValue Prov) :

                                                                        Source deallocate_local: only indirect live locals own an allocation. The required deallocator validates provenance and allocation identity.

                                                                        Equations
                                                                        Instances For
                                                                          def Miri.Interpreter.Frame.storageDead {Prov Layout Extra State : Type} (self : Frame Prov Layout Extra) (state : State) (hooks : LocalStorageHooks Prov Layout Extra State) (localId : MIR.LocalId) :
                                                                          LocalStorageResult Prov Layout Extra State

                                                                          Source storage_dead replaces the value before attempting deallocation.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            def Miri.Interpreter.Frame.storageLiveDyn {Prov Layout Extra State : Type} (self : Frame Prov Layout Extra) (state : State) (hooks : LocalStorageHooks Prov Layout Extra State) (localId : MIR.LocalId) (metadata : MemPlaceMeta Prov) :
                                                                            LocalStorageResult Prov Layout Extra State

                                                                            Source storage_live_dyn, including lazy layout caching, allocation or write hook before replacement, and replacement before old-value deallocation.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              def Miri.Interpreter.Frame.storageLive {Prov Layout Extra State : Type} (self : Frame Prov Layout Extra) (state : State) (hooks : LocalStorageHooks Prov Layout Extra State) (localId : MIR.LocalId) :
                                                                              LocalStorageResult Prov Layout Extra State
                                                                              Equations
                                                                              Instances For
                                                                                structure Miri.Interpreter.StackRunResult (Prov Layout Extra State α : Type) :

                                                                                Whole-stack effects keep mutations made by a machine hook even on failure.

                                                                                Instances For
                                                                                  structure Miri.Interpreter.StackLifecycleHooks (Prov Layout Extra State : Type) :

                                                                                  Compiler-dependent and machine-dependent stages required by the source frame lifecycle. Required constants and always-live analysis are explicit obligations because MIR.Body does not store their compiler query results.

                                                                                  Instances For
                                                                                    def Miri.Interpreter.Stack.pushStackFrameRaw {Prov Layout Extra State : Type} (self : Stack Prov Layout Extra) (state : State) (hooks : StackLifecycleHooks Prov Layout Extra State) (body : LoadedBody) (functionInstance : FrameInstance) (returnContinuation : ReturnContinuation) (returnPlace : RuntimeStackPlace Prov) (initialSpan : MIR.SpanRef) :
                                                                                    StackRunResult Prov Layout Extra State Unit

                                                                                    Source push_stack_frame_raw: init precedes insertion, while required constant checks and after-push run with the new frame already on the stack.

                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For
                                                                                      def Miri.Interpreter.Stack.popStackFrameRaw {Prov Layout Extra State : Type} (self : Stack Prov Layout Extra) (state : State) (hooks : StackLifecycleHooks Prov Layout Extra State) :
                                                                                      StackRunResult Prov Layout Extra State (Frame Prov Layout Extra)

                                                                                      Source pop_stack_frame_raw: before-pop effects precede removal.

                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For
                                                                                        def Miri.Interpreter.Stack.cleanupStackFrame {Prov Layout Extra State : Type} (self : Stack Prov Layout Extra) (state : State) (hooks : StackLifecycleHooks Prov Layout Extra State) (unwinding : Bool) (frame : Frame Prov Layout Extra) :
                                                                                        StackRunResult Prov Layout Extra State ReturnAction

                                                                                        Source cleanup_stack_frame: locals, then varargs, then machine after-pop. Stop-without-cleanup skips both deallocation and the machine hook.

                                                                                        Equations
                                                                                        • One or more equations did not get rendered due to their size.
                                                                                        Instances For
                                                                                          def Miri.Interpreter.Stack.pushStackFrameDone {Prov Layout Extra State : Type} (self : Stack Prov Layout Extra) (state : State) (hooks : StackLifecycleHooks Prov Layout Extra State) :
                                                                                          StackRunResult Prov Layout Extra State Unit

                                                                                          Source push_stack_frame_done: make return storage and always-live vars live in source order, preserving each successful update on later failure.

                                                                                          Equations
                                                                                          • One or more equations did not get rendered due to their size.
                                                                                          Instances For