Skip to content

Commit

Permalink
Talk more about shadow bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vext01 committed Sep 20, 2024
1 parent a47d09a commit 2ab9891
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion llvm/lib/Transforms/Yk/ControlPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ const unsigned CPStackMapID = 0;
// The number of shadow bytes required for the control point's patchpoint.
//
// This must be large enough to accommodate the call to patchpoint target
// function. LLVM will assert this in debug builds.
// function and if you use a too-big value LLVM will pad the space with NOP
// bytes.
//
// This early in the pipeline we have no idea how the backend will choose the
// encode this call, so for now we use the exact size of the observed
// instruction at the time of writing, as determined by disassembling the binary
// and eyeballing it.
//
// The good news is that LLVM will assert fail if you use a too small value.
#if defined(__x86_64__) || defined(_M_X64)
const unsigned CPShadow = 13;
#else
Expand Down

0 comments on commit 2ab9891

Please sign in to comment.