Table of Contents

Class FrameLayout

Namespace
RDCore.SDK.Semantics.Binding
Assembly
RDCore.SDK.dll

The slots of an activation of a procedure (IR lowering §3.1, D2): one for each of its parameters and of the variables it declares, which a bound name of the procedure is bound to by number rather than looked up by its symbol each time it is read.

public sealed class FrameLayout
Inheritance
FrameLayout
Inherited Members

Remarks

A slot is a position, which each activation fills with what it holds there - the runtime decides what that is. Two activations of a procedure share its layout, and the layout of a procedure is the same whatever its activations hold: the numbering is the order its parameters, then its variables, are declared in.

A Static variable has no slot: it lives as long as the procedure's module does, not as long as an activation, and is not the activation's to hold. Neither has a constant, which has a value rather than storage.

A layout is made for one definition of a procedure: a procedure that is defined again has a layout of its own. An activation that holds the slots of one layout is no activation of another, so a slot is only read where its layout is the activation's (Layout).

Properties

Count

How many slots an activation of the procedure has.

public int Count { get; }

Property Value

int

LocalSlots

The number of the slot of each variable and constant the procedure declares, in the order they are declared - -1 for one that has none: a Static variable, a constant.

public ImmutableArray<int> LocalSlots { get; }

Property Value

ImmutableArray<int>

ParameterSlots

The number of the slot of each parameter of the procedure, in the order they are declared - -1 for one that has none: what an activation fills with its arguments, by number rather than by looking each parameter's symbol up.

public ImmutableArray<int> ParameterSlots { get; }

Property Value

ImmutableArray<int>

Procedure

The procedure this is the layout of.

public Symbol Procedure { get; }

Property Value

Symbol

Methods

For(Symbol)

The layout of an activation of procedure, the same instance every time it is asked for that very symbol: what binds a name of the procedure to a slot and what lays out its activations agree on it by identity (Layout).

public static FrameLayout For(Symbol procedure)

Parameters

procedure Symbol

The procedure: a Sub, a Function or a property accessor. Anything else has no slots.

Returns

FrameLayout

Of(Symbol)

The layout of an activation of procedure.

public static FrameLayout Of(Symbol procedure)

Parameters

procedure Symbol

The procedure: a Sub, a Function or a property accessor. Anything else has no slots.

Returns

FrameLayout

TryGetSlot(Symbol, out FrameSlot)

The slot of a parameter or a variable of the procedure, if it has one.

public bool TryGetSlot(Symbol symbol, out FrameSlot slot)

Parameters

symbol Symbol

The symbol a name of the procedure resolves to.

slot FrameSlot

The slot.

Returns

bool

false for anything that is no parameter or variable of this procedure, or is Static.