Source/Packages

Runtime.NativePhysicalNative

packages/execution/src/Runtime/NativePhysicalNative.alpha

3,420 lines207 declarations187.4 KiBSHA-256 9c16b0741974

def · lines 964–1002

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.
964def nativePhysicalNativeMemoryGuard =
965  (lambda unrestricted tail : (family X86NativeAssembly) .
966    (nativePhysicalNativeEmit
967      (nativePhysicalNativeMoveImmediate64
968        (constructor X86NativeRegister64 X86NativeRDX)
969        nativePhysicalNativeI64NegativeOne)
970      (nativePhysicalNativeEmit
971        (nativePhysicalNativeMoveImmediate32
972          (constructor X86NativeRegister64 X86NativeR10)
973          (x86NativeImmediate32FromNatural nativePhysicalMemoryScratchBytes))
974        (nativePhysicalNativeEmit
975          (nativePhysicalNativeSubtract
976            (constructor X86NativeRegister64 X86NativeR10)
977            (constructor X86NativeRegister64 X86NativeRDX))
978          (nativePhysicalNativeEmit
979            (nativePhysicalNativeCompare
980              (constructor X86NativeRegister64 X86NativeRDX)
981              (constructor X86NativeRegister64 X86NativeRSI))
982            (nativePhysicalNativeJumpCondition
983              (constructor X86NativeCondition X86NativeConditionAbove)
984              nativePhysicalNativeLabelFatalFormat
985              (nativePhysicalNativeEmit
986                (nativePhysicalNativeSubtract
987                  (constructor X86NativeRegister64 X86NativeRSI)
988                  (constructor X86NativeRegister64 X86NativeRDX))
989                (nativePhysicalNativeEmit
990                  (constructor
991                    X86NativeInstruction
992                    X86NativeShiftRightImmediate64
993                    (constructor X86NativeRegister64 X86NativeRDX)
994                    (nativePhysicalNativeImmediate8 (nat-to-byte nativePhysicalMemoryWordShift)))
995                  (nativePhysicalNativeEmit
996                    (nativePhysicalNativeCompare
997                      (constructor X86NativeRegister64 X86NativeRDX)
998                      (constructor X86NativeRegister64 X86NativeRAX))
999                    (nativePhysicalNativeJumpCondition
1000                      (constructor X86NativeCondition X86NativeConditionAbove)
1001                      nativePhysicalNativeLabelFatalFormat
1002                      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.