Source/Packages

Runtime.NativePhysicalNative

packages/execution/src/Runtime/NativePhysicalNative.alpha

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

def · lines 2532–2637

nativePhysicalNativeScanRecord

Full file
RepeatBegin: iteration 0, the count from operand 0, the first body record, and the number of body records found by scanning forward to the matching RepeatEnd (tag 10). A nested RepeatBegin (tag 9) or running off the image is a malformed record. A count of zero skips the body: the records left lose the body's and this one, and the advance steps past the end -- so a count read from the state makes a block conditional. Both forward branches and repeat-boundary search traverse unexecuted records. Validate before every load/advance: malformed extents must fail, never wrap the cursor or leave a zero-length scan spinning indefinitely. Registers are distinct; pointer and extent survive, scratch/field are dead.
2532def nativePhysicalNativeScanRecord =
2533  (lambda unrestricted pointer : (family X86NativeRegister64) .
2534    (lambda unrestricted extent : (family X86NativeRegister64) .
2535      (lambda unrestricted scratch : (family X86NativeRegister64) .
2536        (lambda unrestricted field : (family X86NativeRegister64) .
2537          (lambda unrestricted tail : (family X86NativeAssembly) .
2538            (npCompare
2539              npR12
2540              pointer
2541              (nativePhysicalNativeJumpCondition
2542                npBelow
2543                nativePhysicalNativeLabelFatalBounds
2544                (npMove
2545                  scratch
2546                  npR12
2547                  (nativePhysicalNativeEmit
2548                    (nativePhysicalNativeSubtract pointer scratch)
2549                    (npCompareImmediate
2550                      scratch
2551                      (nativePhysicalNativeI32Byte
2552                        (nat-to-byte nativePhysicalImageCommandHeaderBytes))
2553                      (nativePhysicalNativeJumpCondition
2554                        npBelow
2555                        nativePhysicalNativeLabelFatalRecord
2556                        (npLoad64
2557                          extent
2558                          pointer
2559                          nativePhysicalNativeD8
2560                          (npCompareImmediate
2561                            extent
2562                            (nativePhysicalNativeI32Byte
2563                              (nat-to-byte nativePhysicalImageCommandHeaderBytes))
2564                            (nativePhysicalNativeJumpCondition
2565                              npBelow
2566                              nativePhysicalNativeLabelFatalRecord
2567                              (npCompare
2568                                scratch
2569                                extent
2570                                (nativePhysicalNativeJumpCondition
2571                                  npBelow
2572                                  nativePhysicalNativeLabelFatalBounds
2573                                  (npMove
2574                                    scratch
2575                                    extent
2576                                    (nativePhysicalNativeScanFixedPart
2577                                        pointer
2578                                        scratch
2579                                        field
2580                                        (npLoad64
2581                                        field
2582                                        pointer
2583                                        (npD (byte 32))
2584                                        (npCompare
2585                                        scratch
2586                                        field
2587                                        (nativePhysicalNativeJumpCondition
2588                                        npBelow
2589                                        nativePhysicalNativeLabelFatalRecord
2590                                        (nativePhysicalNativeEmit
2591                                        (nativePhysicalNativeSubtract field scratch)
2592                                        (npLoad64
2593                                        field
2594                                        pointer
2595                                        (npD (byte 40))
2596                                        (npCompare
2597                                        scratch
2598                                        field
2599                                        (nativePhysicalNativeJumpCondition
2600                                        npBelow
2601                                        nativePhysicalNativeLabelFatalRecord
2602                                        (nativePhysicalNativeEmit
2603                                        (nativePhysicalNativeSubtract field scratch)
2604                                        (npLoad64
2605                                        field
2606                                        pointer
2607                                        (npD (byte 48))
2608                                        (npCompare
2609                                        scratch
2610                                        field
2611                                        (nativePhysicalNativeJumpCondition
2612                                        npBelow
2613                                        nativePhysicalNativeLabelFatalRecord
2614                                        (nativePhysicalNativeEmit
2615                                        (nativePhysicalNativeSubtract field scratch)
2616                                        (npTest
2617                                        scratch
2618                                        (nativePhysicalNativeJumpCondition
2619                                        npNotZero
2620                                        nativePhysicalNativeLabelFatalRecord
2621                                        (npLoad64
2622                                        field
2623                                        pointer
2624                                        nativePhysicalNativeD0
2625                                        (npCompareImmediate
2626                                        field
2627                                        (nativePhysicalNativeI32Byte (byte 1))
2628                                        (nativePhysicalNativeJumpCondition
2629                                        npBelow
2630                                        nativePhysicalNativeLabelFatalRecord
2631                                        (npCompareImmediate
2632                                        field
2633                                        (nativePhysicalNativeI32Byte (byte 23))
2634                                        (nativePhysicalNativeJumpCondition
2635                                        (constructor X86NativeCondition X86NativeConditionAbove)
2636                                        nativePhysicalNativeLabelFatalRecord
2637                                        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.