Documentation

Miri.Interpreter.Call

Connected call pipeline from pinned interpret/call.rs and step.rs. Compiler queries, ABI compatibility, and machine leaves are mandatory effects.

Instances For
    @[instance_reducible]
    instance Miri.Interpreter.instReprFnArg {P✝ : Type} [Repr P✝] :
    Repr (FnArg P✝)
    Equations
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      inductive Miri.Interpreter.FnVal (Other : Type) :
      Instances For
        def Miri.Interpreter.instReprFnVal.repr {Other✝ : Type} [Repr Other✝] :
        FnVal Other✝ → Nat → Std.Format
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[instance_reducible]
          instance Miri.Interpreter.instReprFnVal {Other✝ : Type} [Repr Other✝] :
          Repr (FnVal Other✝)
          Equations

          Function-kind query after signature normalization, before callee resolution.

          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              structure Miri.Interpreter.CallRequest (P Other Extern FnABI : Type) :
              Instances For
                structure Miri.Interpreter.EvaluatedCall (P Other Extern FnABI : Type) :
                Instances For
                  @[reducible, inline]
                  Equations
                  Instances For
                    structure Miri.Interpreter.CallHooks (P S C E Other Extern FnABI ArgABI : Type) :

                    FnABI, ArgABI, Extern preserve complete compiler ABI records supplied by the caller. No reduced pass-mode or calling-convention enum is invented. checkArgumentCompat implements source layout_compat AND its eq_abi assertion. All memory operations must invoke the canonical memory/provenance hooks.

                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Miri.Interpreter.Call.evalFnCallArgumentAt {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (operand : MIR.Operand) (disjoint : Bool) (path : OperandPath) :
                        CallM S (FnArg P)
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Miri.Interpreter.Call.evalFnCallArgument {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (operand : MIR.Operand) (disjoint : Bool) :
                          CallM S (FnArg P)
                          Equations
                          Instances For
                            def Miri.Interpreter.Call.evalCalleeAndArgs {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (func : MIR.Operand) (args : Array MIR.SpannedOperand) (dest : MIR.Place) :
                            CallM S (EvaluatedCall P Other Extern FnABI)
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Miri.Interpreter.Call.passArgument {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (caller : FnArg P) (callerAbi calleeAbi : ArgABI) (calleeIndex : Nat) (dest : MIR.Place) (calleeTy : MIR.TyId) (alreadyLive : Bool) :

                              Argument copy precedes protection; StorageLive precedes evaluating callee place.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Miri.Interpreter.Call.allocateVarargs {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (args : Array (FnArg P × ArgABI)) (calleeAbis : Array ArgABI) :

                                Source stack.rs allocate_varargs: static callee ABI checks precede allocation and copy; no in-place protection is performed for varargs.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Miri.Interpreter.Call.initStackFrame {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (fnInstance : CallInstance) (loadedBody : LoadedBody) (callerFnAbi : FnABI) (args : Array (FnArg P)) (withCallerLocation : Bool) (destination : RuntimeStackPlace P) (cont : ReturnContinuation) :

                                  Source init_stack_frame, including all four argument initialization arms.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Miri.Interpreter.Call.initFnCallStep {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (request : CallRequest P Other Extern FnABI) :
                                    CallM S (Option (CallRequest P Other Extern FnABI))

                                    One source dispatch, returning a recursive request for intrinsic fallback or virtual dispatch. This avoids hiding recursion in opaque machine callbacks.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      inductive Miri.Interpreter.Call.DispatchPrefix {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) :
                                      CallRequest P Other Extern FnABI → S → CallRequest P Other Extern FnABI → S → Prop

                                      Unbounded finite dispatch prefixes. This relation has no runner budget; resource exhaustion of initFnCall says nothing about later UB freedom.

                                      • refl {P S C E Other Extern FnABI ArgABI : Type} {h : CallHooks P S C E Other Extern FnABI ArgABI} {choice : C} (request : CallRequest P Other Extern FnABI) (state : S) : DispatchPrefix h choice request state request state
                                      • next {P S C E Other Extern FnABI ArgABI : Type} {h : CallHooks P S C E Other Extern FnABI ArgABI} {choice : C} {request : CallRequest P Other Extern FnABI} {state : S} {nextRequest : CallRequest P Other Extern FnABI} {nextState : S} {finalRequest : CallRequest P Other Extern FnABI} {finalState : S} (step : initFnCallStep h choice request state = EStateM.Result.ok (some nextRequest) nextState) (rest : DispatchPrefix h choice nextRequest nextState finalRequest finalState) : DispatchPrefix h choice request state finalRequest finalState
                                      Instances For
                                        def Miri.Interpreter.Call.initFnCall {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (budget : Nat) (request : CallRequest P Other Extern FnABI) :

                                        Source recursive dispatch is executable with an explicit resource budget. Exhaustion is reported, never successful execution or an omitted arm.

                                        Equations
                                        Instances For
                                          def Miri.Interpreter.Call.initFnTailCall {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (budget : Nat) (evaluated : EvaluatedCall P Other Extern FnABI) :
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            def Miri.Interpreter.Call.evalCallTerminator {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (budget : Nat) (terminator : MIR.Terminator) :
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Miri.Interpreter.Call.evalTailCallTerminator {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (budget : Nat) (terminator : MIR.Terminator) :
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Miri.Interpreter.Call.initDropInPlaceCall {P S C E Other Extern FnABI ArgABI : Type} (h : CallHooks P S C E Other Extern FnABI ArgABI) (choice : C) (budget : Nat) (place : RuntimeStackPlace P) (originalInstance : CallInstance) (target : MIR.BasicBlockId) (unwind : MIR.UnwindAction) :
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  def Miri.Interpreter.Call.liftStackResult {P E Machine A : Type} (operation : Stack P LocalLayout E → Machine → StackRunResult P LocalLayout E Machine A) :
                                                  CallM (StepState P LocalLayout E Machine) A

                                                  Canonical Stack adapters: callbacks receive the full machine state, and all stack/machine mutations are installed before returning an error.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    def Miri.Interpreter.Call.pushRawFromStack {P E Machine : Type} (hooks : StackLifecycleHooks P LocalLayout E Machine) (bodySpan : MIR.Body → Except StepError MIR.SpanRef) (fnInstance : CallInstance) (body : LoadedBody) (destination : RuntimeStackPlace P) (cont : ReturnContinuation) :
                                                    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
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          def Miri.Interpreter.Call.cleanupFromStack {P E Machine : Type} (hooks : StackLifecycleHooks P LocalLayout E Machine) (unwinding : Bool) (frame : Frame P LocalLayout E) :
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            def Miri.Interpreter.Call.run {S A : Type} (computation : CallM S A) (state : S) :

                                                            Adapt to ControlFlow.TerminatorHooks while retaining EStateM error state.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              @[reducible, inline]
                                                              abbrev Miri.Interpreter.Call.ZeroHooks (P S C E Other Extern : Type) :
                                                              Equations
                                                              Instances For
                                                                def Miri.Interpreter.Call.zeroCore {P S C E Other Extern : Type} (h : ZeroHooks P S C E Other Extern) (choice : C) (fnInstance : CallInstance) (body : LoadedBody) (abi : ABI.FnAbi MIR.TyId) (destination : MPlaceTy P) (cont : ReturnContinuation) :
                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  theorem Miri.Interpreter.Call.zero_entry_core {P S C E Other Extern : Type} (h : ZeroHooks P S C E Other Extern) (choice : C) (fnInstance : CallInstance) (body : LoadedBody) (abi : ABI.FnAbi MIR.TyId) (destination : MPlaceTy P) (cont : ReturnContinuation) (requires : h.requiresCallerLocation fnInstance = pure false) (instanceAbi : h.fnAbiOfInstance choice fnInstance #[] = pure abi) (features : h.checkTargetFeatures choice fnInstance = pure ()) (memory : h.placeToOp choice (RuntimeStackPlace.memory destination) = pure { op := Operand.indirect destination.mplace, layout := destination.layout }) (closure : h.nonCapturingClosure choice fnInstance abi = pure false) (variadic : h.abiVariadic abi = false) (convention : h.sameConvention abi abi = true) (arguments : h.abiArgs abi = #[]) (ret : h.abiReturn abi = abi.ret) (count : body.body.argumentCount = 0) :
                                                                  initStackFrame h choice fnInstance body abi #[] false (RuntimeStackPlace.memory destination) cont = zeroCore h choice fnInstance body abi destination cont
                                                                  def Miri.Interpreter.Call.zeroImmediateCore {P S C E Other Extern : Type} (h : ZeroHooks P S C E Other Extern) (choice : C) (fnInstance : CallInstance) (body : LoadedBody) (abi : ABI.FnAbi MIR.TyId) (destination : RuntimeStackPlace P) (cont : ReturnContinuation) :

                                                                  Source specialization for a zero-argument call whose actual preflight operand is immediate. The preflight equation is an internal composition edge.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    theorem Miri.Interpreter.Call.zero_entry_immediate {P S C E Other Extern : Type} (h : ZeroHooks P S C E Other Extern) (choice : C) (fnInstance : CallInstance) (body : LoadedBody) (abi : ABI.FnAbi MIR.TyId) (destination : RuntimeStackPlace P) (cont : ReturnContinuation) (before cached : S) (value : Immediate P) (layout : LocalLayout) (requires : h.requiresCallerLocation fnInstance = pure false) (instanceAbi : h.fnAbiOfInstance choice fnInstance #[] = pure abi) (features : h.checkTargetFeatures choice fnInstance = pure ()) (immediate : h.placeToOp choice destination before = EStateM.Result.ok { op := Operand.immediate value, layout := layout } cached) (closure : h.nonCapturingClosure choice fnInstance abi = pure false) (variadic : h.abiVariadic abi = false) (convention : h.sameConvention abi abi = true) (arguments : h.abiArgs abi = #[]) (ret : h.abiReturn abi = abi.ret) (count : body.body.argumentCount = 0) :
                                                                    initStackFrame h choice fnInstance body abi #[] false destination cont before = zeroImmediateCore h choice fnInstance body abi destination cont cached
                                                                    def Miri.Interpreter.Call.zeroIndirectCore {P S C E Other Extern : Type} (h : ZeroHooks P S C E Other Extern) (choice : C) (fnInstance : CallInstance) (body : LoadedBody) (abi : ABI.FnAbi MIR.TyId) (destination : RuntimeStackPlace P) (memory : MPlaceTy P) (cont : ReturnContinuation) :
                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      theorem Miri.Interpreter.Call.zero_entry_indirect {P S C E Other Extern : Type} (h : ZeroHooks P S C E Other Extern) (choice : C) (fnInstance : CallInstance) (body : LoadedBody) (abi : ABI.FnAbi MIR.TyId) (destination : RuntimeStackPlace P) (cont : ReturnContinuation) (before cached : S) (memory : MPlaceTy P) (requires : h.requiresCallerLocation fnInstance = pure false) (instanceAbi : h.fnAbiOfInstance choice fnInstance #[] = pure abi) (features : h.checkTargetFeatures choice fnInstance = pure ()) (indirect : h.placeToOp choice destination before = EStateM.Result.ok { op := Operand.indirect memory.mplace, layout := memory.layout } cached) (closure : h.nonCapturingClosure choice fnInstance abi = pure false) (variadic : h.abiVariadic abi = false) (convention : h.sameConvention abi abi = true) (arguments : h.abiArgs abi = #[]) (ret : h.abiReturn abi = abi.ret) (count : body.body.argumentCount = 0) :
                                                                      initStackFrame h choice fnInstance body abi #[] false destination cont before = zeroIndirectCore h choice fnInstance body abi destination memory cont cached