public class WordOperationPlugin extends Object implements NodePlugin, TypePlugin, InlineInvokePlugin
Word types.InlineInvokePlugin.InlineInfo| Modifier and Type | Field and Description |
|---|---|
protected SnippetReflectionProvider |
snippetReflection |
protected JavaKind |
wordKind |
protected WordTypes |
wordTypes |
| Constructor and Description |
|---|
WordOperationPlugin(SnippetReflectionProvider snippetReflection,
WordTypes wordTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canChangeStackKind(GraphBuilderContext b)
If the plugin
pushes a value with a different
JavaKind than specified by the bytecode, it must override this method and return
true. |
protected AbstractCompareAndSwapNode |
casOp(JavaKind writeKind,
JavaKind returnKind,
AddressNode address,
org.graalvm.word.LocationIdentity location,
ValueNode expectedValue,
ValueNode newValue) |
ValueNode |
convert(GraphBuilderContext b,
ValueNode value,
JavaKind toKind,
boolean unsigned) |
protected LoadIndexedNode |
createLoadIndexedNode(ValueNode array,
ValueNode index,
GuardingNode boundsCheck) |
protected StoreIndexedNode |
createStoreIndexedNode(ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
ValueNode value) |
ValueNode |
fromSigned(GraphBuilderContext b,
ValueNode value) |
ValueNode |
fromUnsigned(GraphBuilderContext b,
ValueNode value) |
boolean |
handleCheckCast(GraphBuilderContext b,
ValueNode object,
ResolvedJavaType type,
JavaTypeProfile profile)
Handle the parsing of a CHECKCAST bytecode.
|
boolean |
handleInstanceOf(GraphBuilderContext b,
ValueNode object,
ResolvedJavaType type,
JavaTypeProfile profile)
Handle the parsing of a INSTANCEOF bytecode.
|
boolean |
handleInvoke(GraphBuilderContext b,
ResolvedJavaMethod method,
ValueNode[] args)
Processes a call to a method if it is annotated as a word operation by adding nodes to the
graph being built that implement the denoted operation.
|
boolean |
handleLoadField(GraphBuilderContext b,
ValueNode receiver,
ResolvedJavaField field)
Handle the parsing of a GETFIELD bytecode.
|
boolean |
handleLoadIndexed(GraphBuilderContext b,
ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
JavaKind elementKind)
Handle the parsing of an array load bytecode.
|
boolean |
handleLoadStaticField(GraphBuilderContext b,
ResolvedJavaField staticField)
Handle the parsing of a GETSTATIC bytecode.
|
boolean |
handleStoreField(GraphBuilderContext b,
ValueNode object,
ResolvedJavaField field,
ValueNode value)
Handle the parsing of a PUTFIELD bytecode.
|
boolean |
handleStoreIndexed(GraphBuilderContext b,
ValueNode array,
ValueNode index,
GuardingNode boundsCheck,
GuardingNode storeCheck,
JavaKind elementKind,
ValueNode value)
Handle the parsing of an array store bytecode.
|
boolean |
handleStoreStaticField(GraphBuilderContext b,
ResolvedJavaField field,
ValueNode value)
Handle the parsing of a PUTSTATIC bytecode.
|
StampPair |
interceptType(GraphBuilderTool b,
JavaType declaredType,
boolean nonNull)
Intercept the type of arguments or return values.
|
AddressNode |
makeAddress(GraphBuilderContext b,
ValueNode base,
ValueNode offset) |
void |
notifyNotInlined(GraphBuilderContext b,
ResolvedJavaMethod method,
Invoke invoke)
Notifies this plugin of the
Invoke node created for a method that was not inlined per
InlineInvokePlugin.shouldInlineInvoke(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext, ResolvedJavaMethod, org.graalvm.compiler.nodes.ValueNode[]). |
protected void |
processWordOperation(GraphBuilderContext b,
ValueNode[] args,
ResolvedJavaMethod wordMethod) |
static ValueNode |
readOp(GraphBuilderContext b,
JavaKind readKind,
AddressNode address,
org.graalvm.word.LocationIdentity location,
OnHeapMemoryAccess.BarrierType barrierType,
boolean compressible) |
protected ValueNode |
readOp(GraphBuilderContext b,
JavaKind readKind,
AddressNode address,
org.graalvm.word.LocationIdentity location,
Word.Opcode op) |
protected ValueNode |
readVolatileOp(GraphBuilderContext b,
JavaKind readKind,
AddressNode address,
org.graalvm.word.LocationIdentity location,
Word.Opcode op) |
ValueNode |
toUnsigned(GraphBuilderContext b,
ValueNode value,
JavaKind toKind) |
protected void |
writeOp(GraphBuilderContext b,
JavaKind writeKind,
AddressNode address,
org.graalvm.word.LocationIdentity location,
ValueNode value,
Word.Opcode op) |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertInvokeDynamic, handleNewArray, handleNewInstance, handleNewMultiArray, instrumentExceptionDispatchnotifyAfterInline, notifyBeforeInline, shouldInlineInvokeprotected final WordTypes wordTypes
protected final JavaKind wordKind
protected final SnippetReflectionProvider snippetReflection
public WordOperationPlugin(SnippetReflectionProvider snippetReflection, WordTypes wordTypes)
public boolean canChangeStackKind(GraphBuilderContext b)
NodePluginpushes a value with a different
JavaKind than specified by the bytecode, it must override this method and return
true. This disables assertion checking for value kinds.canChangeStackKind in interface NodePluginb - the contextpublic boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args)
handleInvoke in interface NodePluginb - the contextmethod - the statically bound, invoked methodargs - the arguments of the method invocationtrue iff method is annotated with Word.Operation (and was thus
processed by this method)public StampPair interceptType(GraphBuilderTool b, JavaType declaredType, boolean nonNull)
TypePlugininterceptType in interface TypePluginpublic void notifyNotInlined(GraphBuilderContext b, ResolvedJavaMethod method, Invoke invoke)
InlineInvokePluginInvoke node created for a method that was not inlined per
InlineInvokePlugin.shouldInlineInvoke(org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext, ResolvedJavaMethod, org.graalvm.compiler.nodes.ValueNode[]).notifyNotInlined in interface InlineInvokePluginb - the contextmethod - the method that was not inlinedinvoke - the invoke node created for the call to methodpublic boolean handleLoadField(GraphBuilderContext b, ValueNode receiver, ResolvedJavaField field)
NodePluginpush a value using the
kind of the field.handleLoadField in interface NodePluginb - the contextreceiver - the receiver object for the field accessfield - the accessed fieldpublic boolean handleLoadStaticField(GraphBuilderContext b, ResolvedJavaField staticField)
NodePluginpush a value using the
kind of the field.handleLoadStaticField in interface NodePluginb - the contextstaticField - the accessed fieldpublic boolean handleLoadIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, GuardingNode boundsCheck, JavaKind elementKind)
NodePluginpush a value using the provided elementKind.handleLoadIndexed in interface NodePluginb - the contextarray - the accessed arrayindex - the index for the array accessboundsCheck - the explicit bounds check already emitted, or null if no bounds check was
emitted yetelementKind - the element kind of the accessed arrayprotected LoadIndexedNode createLoadIndexedNode(ValueNode array, ValueNode index, GuardingNode boundsCheck)
public boolean handleStoreField(GraphBuilderContext b, ValueNode object, ResolvedJavaField field, ValueNode value)
NodePluginhandleStoreField in interface NodePluginb - the contextobject - the receiver object for the field accessfield - the accessed fieldvalue - the value to be stored into the fieldpublic boolean handleStoreStaticField(GraphBuilderContext b, ResolvedJavaField field, ValueNode value)
NodePluginhandleStoreStaticField in interface NodePluginb - the contextfield - the accessed fieldvalue - the value to be stored into the fieldpublic boolean handleStoreIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, GuardingNode boundsCheck, GuardingNode storeCheck, JavaKind elementKind, ValueNode value)
NodePluginhandleStoreIndexed in interface NodePluginb - the contextarray - the accessed arrayindex - the index for the array accessboundsCheck - the explicit array bounds check already emitted, or null if no array
bounds check was emitted yetstoreCheck - the explicit array store check already emitted, or null if no array store
check was emitted yetelementKind - the element kind of the accessed arrayvalue - the value to be stored into the arrayprotected StoreIndexedNode createStoreIndexedNode(ValueNode array, ValueNode index, GuardingNode boundsCheck, ValueNode value)
public boolean handleCheckCast(GraphBuilderContext b, ValueNode object, ResolvedJavaType type, JavaTypeProfile profile)
NodePluginpush a value with the result of the cast using
JavaKind.Object.handleCheckCast in interface NodePluginb - the contextobject - the object to be type checkedtype - the type that the object is checked againstprofile - the profiling information for the type check, or null if no profiling
information is availablepublic boolean handleInstanceOf(GraphBuilderContext b, ValueNode object, ResolvedJavaType type, JavaTypeProfile profile)
NodePluginpush a value with the result of the instanceof using
JavaKind.Int.handleInstanceOf in interface NodePluginb - the contextobject - the object to be type checkedtype - the type that the object is checked againstprofile - the profiling information for the type check, or null if no profiling
information is availableprotected void processWordOperation(GraphBuilderContext b, ValueNode[] args, ResolvedJavaMethod wordMethod) throws GraalError
GraalErrorprotected ValueNode readOp(GraphBuilderContext b, JavaKind readKind, AddressNode address, org.graalvm.word.LocationIdentity location, Word.Opcode op)
public static ValueNode readOp(GraphBuilderContext b, JavaKind readKind, AddressNode address, org.graalvm.word.LocationIdentity location, OnHeapMemoryAccess.BarrierType barrierType, boolean compressible)
protected ValueNode readVolatileOp(GraphBuilderContext b, JavaKind readKind, AddressNode address, org.graalvm.word.LocationIdentity location, Word.Opcode op)
protected void writeOp(GraphBuilderContext b, JavaKind writeKind, AddressNode address, org.graalvm.word.LocationIdentity location, ValueNode value, Word.Opcode op)
protected AbstractCompareAndSwapNode casOp(JavaKind writeKind, JavaKind returnKind, AddressNode address, org.graalvm.word.LocationIdentity location, ValueNode expectedValue, ValueNode newValue)
public AddressNode makeAddress(GraphBuilderContext b, ValueNode base, ValueNode offset)
public ValueNode fromUnsigned(GraphBuilderContext b, ValueNode value)
public ValueNode fromSigned(GraphBuilderContext b, ValueNode value)
public ValueNode toUnsigned(GraphBuilderContext b, ValueNode value, JavaKind toKind)
public ValueNode convert(GraphBuilderContext b, ValueNode value, JavaKind toKind, boolean unsigned)