Source/Packages

Runtime.NativePhysicalNative

packages/execution/src/Runtime/NativePhysicalNative.alpha

3,650 lines210 declarations198.6 KiBSHA-256 028b70105699

def · lines 968–1007

nativePhysicalNativeMemoryGuard

Full file
RSI is state extent and RAX is the result count. Compare with the remaining capacity BEFORE shifting or adding; wrapped allocation lengths are never passed to mmap. RDX/R10 are scratch until the following syscall setup. scratchBytes is the interpreter scratch the caller derives (repeat frames included), so the guard and the allocation reserve the same extent.
968def nativePhysicalNativeMemoryGuard =
969  (lambda unrestricted scratchBytes : Nat .
970  (lambda unrestricted tail : (family X86NativeAssembly) .
971    (nativePhysicalNativeEmit
972      (nativePhysicalNativeMoveImmediate64
973        (constructor X86NativeRegister64 X86NativeRDX)
974        nativePhysicalNativeI64NegativeOne)
975      (nativePhysicalNativeEmit
976        (nativePhysicalNativeMoveImmediate32
977          (constructor X86NativeRegister64 X86NativeR10)
978          (x86NativeImmediate32FromNatural scratchBytes))
979        (nativePhysicalNativeEmit
980          (nativePhysicalNativeSubtract
981            (constructor X86NativeRegister64 X86NativeR10)
982            (constructor X86NativeRegister64 X86NativeRDX))
983          (nativePhysicalNativeEmit
984            (nativePhysicalNativeCompare
985              (constructor X86NativeRegister64 X86NativeRDX)
986              (constructor X86NativeRegister64 X86NativeRSI))
987            (nativePhysicalNativeJumpCondition
988              (constructor X86NativeCondition X86NativeConditionAbove)
989              nativePhysicalNativeLabelFatalFormat
990              (nativePhysicalNativeEmit
991                (nativePhysicalNativeSubtract
992                  (constructor X86NativeRegister64 X86NativeRSI)
993                  (constructor X86NativeRegister64 X86NativeRDX))
994                (nativePhysicalNativeEmit
995                  (constructor
996                    X86NativeInstruction
997                    X86NativeShiftRightImmediate64
998                    (constructor X86NativeRegister64 X86NativeRDX)
999                    (nativePhysicalNativeImmediate8 (nat-to-byte nativePhysicalMemoryWordShift)))
1000                  (nativePhysicalNativeEmit
1001                    (nativePhysicalNativeCompare
1002                      (constructor X86NativeRegister64 X86NativeRDX)
1003                      (constructor X86NativeRegister64 X86NativeRAX))
1004                    (nativePhysicalNativeJumpCondition
1005                      (constructor X86NativeCondition X86NativeConditionAbove)
1006                      nativePhysicalNativeLabelFatalFormat
1007                      tail)))))))))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.