Interface CodeBlock
- All Superinterfaces:
org.eclipse.emf.ecore.EObject
,org.eclipse.emf.common.notify.Notifier
- All Known Implementing Classes:
CodeBlockImpl
,NativeCodeBlock
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(StackFrame frame) Executes the instructions in thisCodeBlock
, using the parameters stored inframe
.org.eclipse.emf.common.util.EList<Instruction>
Collects the transitive closure of predecessor instructions fori
.Returns the value of the 'Applier For' container reference.Returns the value of the 'Binding For' container reference.Returns the value of the 'Body For' container reference.org.eclipse.emf.common.util.EList<Instruction>
getCode()
Returns the value of the 'Code' containment reference list.getField()
Returns the value of the 'Initialiser For' container reference.Returns the compiledJITCodeBlock
, if any.org.eclipse.emf.common.util.EList<LineNumber>
Returns the value of the 'Line Numbers' containment reference list.org.eclipse.emf.common.util.EList<LocalVariable>
Returns the value of the 'Local Variables' containment reference list.Returns the value of the 'Matcher For' container reference.int
Returns the value of the 'Max Locals' attribute.int
Returns the value of the 'Max Stack' attribute.org.eclipse.emf.common.util.EList<CodeBlock>
Returns the value of the 'Nested' containment reference list.Returns the value of the 'Nested For' container reference.org.eclipse.emf.common.util.EList<Instruction>
Collects the direct predecessor instructions fori
that do not containi
in their transitive closure of predecessors.Returns the value of the 'Parent Frame' attribute.Returns the value of the 'Post Apply For' container reference.org.eclipse.emf.common.util.EList<Instruction>
Collects the direct predecessor instructions fori
.getRule()
Finds the theRule
that contains this codeblock.int
Calculates the amount of elements on the stack after executing thisCodeBlock
.void
setApplierFor
(Rule value) Sets the value of the 'Applier For
' container reference.void
setBindingFor
(InputRuleElement value) Sets the value of the 'Binding For
' container reference.void
setBodyFor
(Operation value) Sets the value of the 'Body For
' container reference.void
setInitialiserFor
(Field value) Sets the value of the 'Initialiser For
' container reference.void
Sets the compiledJITCodeBlock
.void
setMatcherFor
(Rule value) Sets the value of the 'Matcher For
' container reference.void
setMaxLocals
(int value) Sets the value of the 'Max Locals
' attribute.void
setMaxStack
(int value) Sets the value of the 'Max Stack
' attribute.void
setNestedFor
(CodeBlock value) Sets the value of the 'Nested For
' container reference.void
setParentFrame
(StackFrame value) Sets the value of the 'Parent Frame
' attribute.void
setPostApplyFor
(Rule value) Sets the value of the 'Post Apply For
' container reference.Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
-
Method Details
-
getMaxLocals
int getMaxLocals()Returns the value of the 'Max Locals' attribute. The default value is"-1"
.Represents the amount of local variables slots required. This value is derived automatically from the list of instructions.
- Returns:
- the value of the 'Max Locals' attribute.
- See Also:
-
setMaxLocals
void setMaxLocals(int value) Sets the value of the 'Max Locals
' attribute.Represents the amount of local variables slots required. This value is derived automatically from the list of instructions.
- Parameters:
value
- the new value of the 'Max Locals' attribute.- See Also:
-
getMaxStack
int getMaxStack()Returns the value of the 'Max Stack' attribute. The default value is"-1"
.Represents the amount of stack slots required. This value is derived automatically from the list of instructions.
- Returns:
- the value of the 'Max Stack' attribute.
- See Also:
-
setMaxStack
void setMaxStack(int value) Sets the value of the 'Max Stack
' attribute.Represents the amount of stack slots required. This value is derived automatically from the list of instructions.
- Parameters:
value
- the new value of the 'Max Stack' attribute.- See Also:
-
getCode
org.eclipse.emf.common.util.EList<Instruction> getCode()Returns the value of the 'Code' containment reference list. The list contents are of typeInstruction
. It is bidirectional and its opposite is 'Owning Block
'.Represents the list of instructions to execute.
- Returns:
- the value of the 'Code' containment reference list.
- See Also:
-
getLineNumbers
org.eclipse.emf.common.util.EList<LineNumber> getLineNumbers()Returns the value of the 'Line Numbers' containment reference list. The list contents are of typeLineNumber
. It is bidirectional and its opposite is 'Owning Block
'.Represents the line number information elements for this code block's instructions.
- Returns:
- the value of the 'Line Numbers' containment reference list.
- See Also:
-
getLocalVariables
org.eclipse.emf.common.util.EList<LocalVariable> getLocalVariables()Returns the value of the 'Local Variables' containment reference list. The list contents are of typeLocalVariable
. It is bidirectional and its opposite is 'Owning Block
'.Represents the local variable information elements for this code block. This information is used to calculate '
Max Locals
' and local variable slot assignment for the instructions of this code block. The actual local variables are stored inStackFrame
s.- Returns:
- the value of the 'Local Variables' containment reference list.
- See Also:
-
getMatcherFor
Rule getMatcherFor()Returns the value of the 'Matcher For' container reference. It is bidirectional and its opposite is 'Matcher
'.This reference is set if this code block serves as a '
Matcher
' code block for aRule
.- Returns:
- the value of the 'Matcher For' container reference.
- See Also:
-
setMatcherFor
Sets the value of the 'Matcher For
' container reference. This reference is set if this code block serves as a 'Matcher
' code block for aRule
.- Parameters:
value
- the new value of the 'Matcher For' container reference.- See Also:
-
getApplierFor
Rule getApplierFor()Returns the value of the 'Applier For' container reference. It is bidirectional and its opposite is 'Applier
'.This reference is set if this code block serves as an '
Applier
' code block for aRule
.- Returns:
- the value of the 'Applier For' container reference.
- See Also:
-
setApplierFor
Sets the value of the 'Applier For
' container reference.This reference is set if this code block serves as an '
Applier
' code block for aRule
.- Parameters:
value
- the new value of the 'Applier For' container reference.- See Also:
-
getPostApplyFor
Rule getPostApplyFor()Returns the value of the 'Post Apply For' container reference. It is bidirectional and its opposite is 'Post Apply
'.This reference is set if this code block serves as a '
Post Apply
' code block for aRule
.- Returns:
- the value of the 'Post Apply For' container reference.
- See Also:
-
setPostApplyFor
Sets the value of the 'Post Apply For
' container reference.This reference is set if this code block serves as a '
Post Apply
' code block for aRule
.- Parameters:
value
- the new value of the 'Post Apply For' container reference.- See Also:
-
getBodyFor
Operation getBodyFor()Returns the value of the 'Body For' container reference. It is bidirectional and its opposite is 'Body
'.This reference is set if this code block serves as a '
Body
' code block for anOperation
.- Returns:
- the value of the 'Body For' container reference.
- See Also:
-
setBodyFor
Sets the value of the 'Body For
' container reference.This reference is set if this code block serves as a '
Body
' code block for anOperation
.- Parameters:
value
- the new value of the 'Body For' container reference.- See Also:
-
getInitialiserFor
Field getInitialiserFor()Returns the value of the 'Initialiser For' container reference. It is bidirectional and its opposite is 'Initialiser
'.This reference is set if this code block serves as an '
Initialiser
' code block for aField
.- Returns:
- the value of the 'Initialiser For' container reference.
- See Also:
-
setInitialiserFor
Sets the value of the 'Initialiser For
' container reference.This reference is set if this code block serves as an '
Initialiser
' code block for aField
.- Parameters:
value
- the new value of the 'Initialiser For' container reference.- See Also:
-
getNested
org.eclipse.emf.common.util.EList<CodeBlock> getNested()Returns the value of the 'Nested' containment reference list. The list contents are of typeCodeBlock
. It is bidirectional and its opposite is 'Nested For
'.Represents the list of nested code blocks (i.e. closures).
- Returns:
- the value of the 'Nested' containment reference list.
- See Also:
-
getNestedFor
CodeBlock getNestedFor()Returns the value of the 'Nested For' container reference. It is bidirectional and its opposite is 'Nested
'.This reference is set if this code block serves as a '
Nested
' code block (i.e. closure) for a parentCodeBlock
.- Returns:
- the value of the 'Nested For' container reference.
- See Also:
-
setNestedFor
Sets the value of the 'Nested For
' container reference.This reference is set if this code block serves as a '
Nested
' code block (i.e. closure) for a parentCodeBlock
.- Parameters:
value
- the new value of the 'Nested For' container reference.- See Also:
-
getParentFrame
StackFrame getParentFrame()Returns the value of the 'Parent Frame' attribute.Represents a placeholder for the
StackFrame
of the invoking native Java method, and allows re-entry into the EMFTVM (with access to lexically scoped local variables, etc.).Stack frames are stored per thread, which enables the concurrent execution of code blocks.
- Returns:
- the value of the 'Parent Frame' attribute.
- See Also:
-
setParentFrame
Sets the value of the 'Parent Frame
' attribute.Represents a placeholder for the
StackFrame
of the invoking native Java method, and allows re-entry into the EMFTVM (with access to lexically scoped local variables, etc.).Stack frames are stored per thread, which enables the concurrent execution of code blocks.
- Parameters:
value
- the new value of the 'Parent Frame' attribute.- See Also:
-
getBindingFor
InputRuleElement getBindingFor()Returns the value of the 'Binding For' container reference. It is bidirectional and its opposite is 'Binding
'.This reference is set if this code block serves as a '
Binding
' code block for a rule'sInputRuleElement
. Bindings allow for the EMFTVMMatcher
to implement a search plan strategy.- Returns:
- the value of the 'Binding For' container reference.
- See Also:
-
setBindingFor
Sets the value of the 'Binding For
' container reference.This reference is set if this code block serves as a '
Binding
' code block for a rule'sInputRuleElement
. Bindings allow for the EMFTVMMatcher
to implement a search plan strategy.- Parameters:
value
- the new value of the 'Binding For' container reference.- See Also:
-
execute
Executes the instructions in thisCodeBlock
, using the parameters stored inframe
.- Parameters:
frame
- theStackFrame
to use during execution.- Returns:
- the return value.
-
getStackLevel
int getStackLevel()Calculates the amount of elements on the stack after executing thisCodeBlock
.- Returns:
- the amount of elements on the stack after executing this
CodeBlock
.
-
getModule
Module getModule() -
getOperation
Operation getOperation() -
getField
Field getField() -
getPredecessors
Collects the direct predecessor instructions fori
.- Parameters:
i
- the instruction to collect the predecessors for.- Returns:
- the direct predecessor instructions for
i
.
-
getAllPredecessors
Collects the transitive closure of predecessor instructions fori
.- Parameters:
i
- the instruction to collect the predecessors for.- Returns:
- the transitive closure of predecessor instructions for
i
.
-
getNonLoopingPredecessors
Collects the direct predecessor instructions fori
that do not containi
in their transitive closure of predecessors.- Parameters:
i
- the instruction to collect the predecessors for.- Returns:
- the non-looping predecessor instructions for
i
.
-
getRule
Rule getRule()Finds the theRule
that contains this codeblock. -
getJITCodeBlock
JITCodeBlock getJITCodeBlock()Returns the compiledJITCodeBlock
, if any.- Returns:
- the compiled
JITCodeBlock
, ornull
-
setJITCodeBlock
Sets the compiledJITCodeBlock
.- Parameters:
jcb
- the compiledJITCodeBlock
-