Changes between Version 30 and Version 31 of Commentary/Compiler/BackendOpt


Ignore:
Timestamp:
May 22, 2018 3:39:58 AM (17 months ago)
Author:
kavon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/BackendOpt

    v30 v31  
    153153The `extractvalue` instructions are standard struct accessors.
    154154
     155The importance of the "all live values are passed" property comes into play here,
     156because we know that there are no SSA-values that are live across the `cpscall`,
     157by construction.
     158Thus, we know that LLVM does not need to save any values to its internal stack,
     159i.e., the call stack that is implicit in LLVM where `allocas` and other values
     160are automatically stored.
     161If LLVM *were* to save values to its internal stack, we would not have a complete
     162continuation in the explicit `Sp` argument, and would not be able to find the
     163value at runtime.
     164
    155165A few notes about the other arguments to the intrinsic:
    156166
    157 - `SP_ARGNUM` is a constant integer that describes the offset within the argument
    158 list to the `cpscall` where the explicit stack pointer is passed as an argument to the call. In this example, it would be 1, since we start counting from `Base`.
     167- `SP_ARGNUM` is a constant integer that describes the offset within the argument list to the `cpscall` where the explicit stack pointer is passed as an argument to the call. In this example, it would be 1, since we start counting from `Base`.
    159168- `RA_OFFSET` is the constant integer representing a byte offset from the explicit stack pointer where the return address should be written. It is typically 0 but not always (e.g., over-saturated calls and update frames).
    160169- `ID` is an arbitrary constant-integer value that is used for the purposes of identifying the return point to help the garbage collector understand the stack frame that was captured at that point.