Skip to content
← Back

src/ir/values/instruction.ghul

1
namespace IR.Values is
2
// The stack-depth bound a method body reserves.
3
//
4
// Metadata carries the bound in the body header rather than as an
5
// instruction, and the emitter reserves the same depth for every
6
// body it writes, so nothing is encoded where this value sits. It
7
// stays a value rather than being dropped from the block because
8
// the walk that builds the block does not know that.
9
class MAX_STACK: Value is
10
depth: int
11
12
init(depth: int) is
13
super.init()
14
15
self.depth = depth
16
si
17
18
accept(visitor: Visitor) is
19
visitor.visit(self)
20
si
21
22
to_string() -> string => ".maxstack {depth}"
23
si
24
si