public abstract class SLWriteLocalVariableNode extends SLExpressionNode
frame. The Truffle frame API
allows to store primitive values of all Java primitive types, and Object values.| Constructor and Description |
|---|
SLWriteLocalVariableNode() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
executeWrite(com.oracle.truffle.api.frame.VirtualFrame frame,
Object value) |
protected abstract SLExpressionNode |
getNameNode()
Returns the child node
nameNode. |
Object |
getNodeObject() |
protected abstract int |
getSlot()
Returns the descriptor of the accessed local variable.
|
com.oracle.truffle.api.strings.TruffleString |
getSlotName() |
boolean |
hasTag(Class<? extends com.oracle.truffle.api.instrumentation.Tag> tag) |
protected boolean |
isBooleanOrIllegal(com.oracle.truffle.api.frame.VirtualFrame frame) |
abstract boolean |
isDeclaration() |
protected boolean |
isLongOrIllegal(com.oracle.truffle.api.frame.VirtualFrame frame)
Guard function that the local variable has the type
long. |
protected Object |
write(com.oracle.truffle.api.frame.VirtualFrame frame,
Object value)
Generic write method that works for all possible types.
|
protected boolean |
writeBoolean(com.oracle.truffle.api.frame.VirtualFrame frame,
boolean value) |
protected long |
writeLong(com.oracle.truffle.api.frame.VirtualFrame frame,
long value)
Specialized method to write a primitive
long value. |
addExpressionTag, createWrapper, executeBoolean, executeGeneric, executeLong, executeVoidaddRootTag, addStatementTag, formatSourceSection, getSourceCharIndex, getSourceEndIndex, getSourceLength, getSourceSection, hasSource, isInstrumentable, setSourceSection, setUnavailableSourceSection, toStringfindBlock, getVisibleVariablesIndexOnEnter, hasScope, setVisibleVariablesIndexOnEnter, setVisibleVariablesIndexOnExitaccept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecializeprotected abstract int getSlot()
NodeField annotation on the class.protected abstract SLExpressionNode getNameNode()
nameNode. The implementation of this method is created by
the Truffle DSL based on the NodeChild annotation on the class.public abstract boolean isDeclaration()
public final com.oracle.truffle.api.strings.TruffleString getSlotName()
protected long writeLong(com.oracle.truffle.api.frame.VirtualFrame frame,
long value)
long value. This is only possible if the
local variable also has currently the type long or was never written before,
therefore a Truffle DSL custom guard is specified.protected boolean writeBoolean(com.oracle.truffle.api.frame.VirtualFrame frame,
boolean value)
protected Object write(com.oracle.truffle.api.frame.VirtualFrame frame, Object value)
Why is this method annotated with Specialization and not Fallback? For a
Fallback method, the Truffle DSL generated code would try all other specializations
first before calling this method. We know that all these specializations would fail their
guards, so there is no point in calling them. Since this method takes a value of type
Object, it is guaranteed to never fail, i.e., once we are in this specialization the
node will never be re-specialized.
public abstract void executeWrite(com.oracle.truffle.api.frame.VirtualFrame frame,
Object value)
protected boolean isLongOrIllegal(com.oracle.truffle.api.frame.VirtualFrame frame)
long.frame - The parameter seems unnecessary, but it is required: Without the parameter, the
Truffle DSL would not check the guard on every execution of the specialization.
Guards without parameters are assumed to be pure, but our guard depends on the
slot kind which can change.protected boolean isBooleanOrIllegal(com.oracle.truffle.api.frame.VirtualFrame frame)
public boolean hasTag(Class<? extends com.oracle.truffle.api.instrumentation.Tag> tag)
hasTag in interface com.oracle.truffle.api.instrumentation.InstrumentableNodehasTag in class SLExpressionNodepublic Object getNodeObject()