Record Class OperationBodyPlan
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.generator.OperationBodyPlan
public record OperationBodyPlan(OperationBodyPlan.Step entry, boolean hasBodyScope, DebugInfo bodyScopeDebugInfo, OperationBodyPlan.Step parameters, OperationBodyPlan.Step prologue, OperationBodyPlan.Step returning, OperationBodyPlan.Step body, OperationBodyPlan.Step bodyEnd, OperationBodyPlan.Step afterScope, OperationBodyPlan.Step exit, OperationBodyPlan.Step tail)
extends Record
THE operation-body skeleton (IR tidy W3.4, OPS-9): what a callable's body is made of, emitted by
generate(IRInstructionBuilder) in the one order every callable has - use it, never another hand-rolled body.
entry- ahead of the body scope: the coverage and profiling entry probes, a constructor's implicitsuper()and_i_init.- The body scope (
IRInstructionBuilder.inNewScope(DebugInfo, Consumer): a fresh scope id, pushed,SCOPE_ENTER), holding in order:parameters(their declarations),prologue(the receiver cleaning its 'sanitized' parameters, the input-variety probe, a hand-written sameness's run-time-type check),returning(the returning variable),body(the statements) andbodyEnd(what a constructor places on its explicitsuper(...)); thenSCOPE_EXIT, popped. An operation with neither statements nor a returning variable has no body scope: the same parts, unbracketed. afterScope- a constructor's partial-construction region.exit- the profiling exit probe and theRETURN.tail- blocks after the return (a hand-written sameness's different-type answer).
Each part is a OperationBodyPlan.Step that adds through the operation's one builder, given the body scope id (null where
there is none, and before the scope is made), so every counter - scope ids, temps, labels - is drawn in exactly
this order. The entry block is labelled last. OperationDfnGenerator (methods, operators, constructors,
function bodies, a program's main), TextBodyMethodGenerator, a dynamic function's _call and an
application's _prepare are plans.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA plan's parts; any part not given is empty, and there is no body scope unlessOperationBodyPlan.Builder.inBodyScope(DebugInfo)is called.static interfaceOne part of a body: adds its instructions through the builder. -
Constructor Summary
ConstructorsConstructorDescriptionOperationBodyPlan(OperationBodyPlan.Step entry, boolean hasBodyScope, DebugInfo bodyScopeDebugInfo, OperationBodyPlan.Step parameters, OperationBodyPlan.Step prologue, OperationBodyPlan.Step returning, OperationBodyPlan.Step body, OperationBodyPlan.Step bodyEnd, OperationBodyPlan.Step afterScope, OperationBodyPlan.Step exit, OperationBodyPlan.Step tail) Creates an instance of aOperationBodyPlanrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theafterScoperecord component.body()Returns the value of thebodyrecord component.bodyEnd()Returns the value of thebodyEndrecord component.Returns the value of thebodyScopeDebugInforecord component.voidemit(IRInstructionBuilder builder) Emit the body into the builder without labelling it - for a body whose entry block is labelled on another frame's counter (a text method's, after its method frame).entry()Returns the value of theentryrecord component.final booleanIndicates whether some other object is "equal to" this one.exit()Returns the value of theexitrecord component.generate(IRInstructionBuilder builder) Emit the body and make it the operation's entry block, labelled on the current frame's counter.booleanReturns the value of thehasBodyScoperecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theparametersrecord component.prologue()Returns the value of theprologuerecord component.Returns the value of thereturningrecord component.tail()Returns the value of thetailrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OperationBodyPlan
public OperationBodyPlan(OperationBodyPlan.Step entry, boolean hasBodyScope, DebugInfo bodyScopeDebugInfo, OperationBodyPlan.Step parameters, OperationBodyPlan.Step prologue, OperationBodyPlan.Step returning, OperationBodyPlan.Step body, OperationBodyPlan.Step bodyEnd, OperationBodyPlan.Step afterScope, OperationBodyPlan.Step exit, OperationBodyPlan.Step tail) Creates an instance of aOperationBodyPlanrecord class.- Parameters:
entry- the value for theentryrecord componenthasBodyScope- the value for thehasBodyScoperecord componentbodyScopeDebugInfo- the value for thebodyScopeDebugInforecord componentparameters- the value for theparametersrecord componentprologue- the value for theprologuerecord componentreturning- the value for thereturningrecord componentbody- the value for thebodyrecord componentbodyEnd- the value for thebodyEndrecord componentafterScope- the value for theafterScoperecord componentexit- the value for theexitrecord componenttail- the value for thetailrecord component
-
-
Method Details
-
generate
Emit the body and make it the operation's entry block, labelled on the current frame's counter. -
emit
Emit the body into the builder without labelling it - for a body whose entry block is labelled on another frame's counter (a text method's, after its method frame). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entry
Returns the value of theentryrecord component.- Returns:
- the value of the
entryrecord component
-
hasBodyScope
public boolean hasBodyScope()Returns the value of thehasBodyScoperecord component.- Returns:
- the value of the
hasBodyScoperecord component
-
bodyScopeDebugInfo
Returns the value of thebodyScopeDebugInforecord component.- Returns:
- the value of the
bodyScopeDebugInforecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
prologue
Returns the value of theprologuerecord component.- Returns:
- the value of the
prologuerecord component
-
returning
Returns the value of thereturningrecord component.- Returns:
- the value of the
returningrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
bodyEnd
Returns the value of thebodyEndrecord component.- Returns:
- the value of the
bodyEndrecord component
-
afterScope
Returns the value of theafterScoperecord component.- Returns:
- the value of the
afterScoperecord component
-
exit
Returns the value of theexitrecord component.- Returns:
- the value of the
exitrecord component
-
tail
Returns the value of thetailrecord component.- Returns:
- the value of the
tailrecord component
-