Lines Matching full:stack
2 Stack maps and patch points in LLVM
16 A stack map records the location of ``live values`` at a particular
18 LLVM values live across the stack map. Instead, they are only the
22 containing the stack map.
24 LLVM emits stack map data into the object code within a designated
25 :ref:`stackmap-section`. This stack map data contains a record for
26 each stack map. The record stores the stack map's instruction address
28 value's location as a register, stack offset, or constant.
33 convention and may return a value. They also imply stack map
50 used whenever stack maps or code patching are needed. Because the
54 The stack map functionality described in this document is separate
56 :ref:`stack-map`. `GCFunctionMetadata` provides the location of
58 which can also be considered a "stack map". Unlike the stack maps
59 defined above, the `GCFunctionMetadata` stack map interface does not
62 stack map. The stack maps described here could potentially provide
69 The following two kinds of intrinsics can be used to implement stack
72 stack map record, and they both allow some form of code patching. They
74 implicitly generates a stack map without the need for an additional
80 runtime patches code at the stack map's address, it will destructively
88 Each instance of one of these intrinsics generates a stack map record
90 the runtime to uniquely identify the stack map, and the offset within
108 specified values in the stack map without generating any code.
113 The first operand is an ID to be encoded within the stack map. The
116 values`` for which locations will be recorded in the stack map.
118 To use this intrinsic as a bare-bones stack map, with no code patching
124 The stack map intrinsic generates no code in place, unless nops are
126 function entry is stored in the stack map. This is the relative
128 precede the stack map.
130 The stack map ID allows a runtime to locate the desired stack map
131 record. LLVM passes this ID through directly to the stack map
134 LLVM guarantees a shadow of instructions following the stack map's
139 outside the code. The code for instructions following the stack map
140 may be emitted in the stack map's shadow, and these instructions may
143 current function. We disallow overlapping stack map shadows so that
146 For example, a stack map with 8 byte shadow:
162 0x05 nop <--- stack map address
169 patch 8 bytes of code at the stack map's address at follows:
174 0x05 movl $0xffff, %rax <--- patched code at stack map address
179 stack frame from the values located by the stack map.
201 values in the stack map.
211 the ``live values`` for which locations will be recorded in the stack
217 The patch point intrinsic generates a stack map. It also emits a
235 The location of the arguments are not normally recorded in the stack
238 could be a register, stack location, or constant. A special calling
239 convention has been introduced for use with stack maps, anyregcc,
242 will have their register locations recorded in the stack map in
281 Note that no stack map locations will be recorded. If the patched code
291 The stack map now indicates the location of the %ptr argument and
296 Stack Map: ID=78, Loc0=%r9 Loc1=%r8
312 Stack Map Format
315 The existence of a stack map or patch point intrinsic within an LLVM
322 uint8 : Stack Map Version (current version is 1)
331 uint64 : Stack Size
371 ``Offset`` field will be zero. Values spilled to the stack are encoded
373 stack address, typically in the form ``[BP + Offset]``. If an
374 ``alloca`` value is passed directly to a stack map intrinsic, then
375 LLVM may fold the frame index into the stack map as an optimization to
376 avoid allocating a register or stack slot. These frame indices will be
378 also optimize constants by emitting them directly in the stack map,
398 The stack map format is a contract between an LLVM SVN revision and
401 important. Consequently, the stack map design is motivated by
406 can reuse the same stack map space for multiple modules.
414 Stack Map Section
424 later parse it to recover the stack map data.
426 On Darwin, the stack map section name is "__llvm_stackmaps". The
429 Stack Map Usage
432 The stack map support described in this document can be used to
436 stack map record given only the ID, offset, and the order of the
444 commandeer a stack frame when execution reaches an instruction address
445 associated with a stack map. The runtime must be able to rebuild a
446 stack frame and resume program execution using the information
447 provided by the stack map. For example, execution may resume in an
451 stores across a stack map. However, loads must also be handled
453 above a stack map could be invalid. For example, the runtime may
456 some activation of the load's function exists on the stack, the load
458 load by immediately patching any stack map location that lies between
460 simply patch all stack map locations to invalidate the function). If
461 the compiler had hoisted the load above the stack map, then the
470 stack maps.
472 Direct Stack Map Entries
475 As shown in :ref:`stackmap-section`, a Direct stack map location
478 which refer to a stack locations from which the requested values must
491 stack immediately after compilation, or at any time thereafter. This
494 instruction address of the stack map.
501 stack map's location is a Direct location type.