public final class HotSpotNodePlugin extends Object implements NodePlugin, ParameterPlugin
Word
-type rewriting for intrinsic
functions
(snippets and method substitutions), by forwarding to the WordOperationPlugin
. Note that
we forward the NodePlugin
and ParameterPlugin
methods, but not the
InlineInvokePlugin
methods implemented by WordOperationPlugin
. The latter is not
necessary because HotSpot only uses the Word
type in methods that are force-inlined,
i.e., there are never non-inlined invokes that involve the Word
type.
Handling of Fold
and Node.NodeIntrinsic
annotated methods, by forwarding to the
NodeIntrinsificationPlugin
when parsing intrinsic functions.
Constant folding of field loads.
Modifier and Type | Field and Description |
---|---|
protected NodeIntrinsificationPlugin |
nodeIntrinsificationPlugin |
protected WordOperationPlugin |
wordOperationPlugin |
Constructor and Description |
---|
HotSpotNodePlugin(WordOperationPlugin wordOperationPlugin,
NodeIntrinsificationPlugin nodeIntrinsificationPlugin) |
Modifier and Type | Method and Description |
---|---|
boolean |
canChangeStackKind(GraphBuilderContext b)
|
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)
Handle the parsing of a method invocation bytecode to a method that can be bound statically.
|
boolean |
handleLoadField(GraphBuilderContext b,
ValueNode object,
ResolvedJavaField field)
Handle the parsing of a GETFIELD bytecode.
|
boolean |
handleLoadIndexed(GraphBuilderContext b,
ValueNode array,
ValueNode index,
Kind elementKind)
Handle the parsing of an array load bytecode.
|
boolean |
handleLoadStaticField(GraphBuilderContext b,
ResolvedJavaField field)
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,
Kind 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.
|
FloatingNode |
interceptParameter(GraphBuilderContext b,
int index,
Stamp stamp) |
private static boolean |
tryConstantFold(GraphBuilderContext b,
ResolvedJavaField field,
JavaConstant object) |
private static boolean |
tryReadField(GraphBuilderContext b,
ResolvedJavaField field,
JavaConstant object) |
protected final WordOperationPlugin wordOperationPlugin
protected final NodeIntrinsificationPlugin nodeIntrinsificationPlugin
public HotSpotNodePlugin(WordOperationPlugin wordOperationPlugin, NodeIntrinsificationPlugin nodeIntrinsificationPlugin)
public boolean canChangeStackKind(GraphBuilderContext b)
NodePlugin
pushes
a value with a different Kind
than specified by the bytecode, it must override this method and return true
. This
disables assertion checking for value kinds.canChangeStackKind
in interface NodePlugin
b
- the contextpublic FloatingNode interceptParameter(GraphBuilderContext b, int index, Stamp stamp)
interceptParameter
in interface ParameterPlugin
public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args)
NodePlugin
push
a value as the
result of the method invocation using the return kind
of the
method.handleInvoke
in interface NodePlugin
b
- the contextmethod
- the statically bound, invoked methodargs
- the arguments of the method invocationpublic boolean handleLoadField(GraphBuilderContext b, ValueNode object, ResolvedJavaField field)
NodePlugin
push
a value using the kind
of the field.handleLoadField
in interface NodePlugin
b
- the contextobject
- the receiver object for the field accessfield
- the accessed fieldpublic boolean handleLoadStaticField(GraphBuilderContext b, ResolvedJavaField field)
NodePlugin
push
a value using the kind
of the field.handleLoadStaticField
in interface NodePlugin
b
- the contextfield
- the accessed fieldprivate static boolean tryReadField(GraphBuilderContext b, ResolvedJavaField field, JavaConstant object)
private static boolean tryConstantFold(GraphBuilderContext b, ResolvedJavaField field, JavaConstant object)
public boolean handleStoreField(GraphBuilderContext b, ValueNode object, ResolvedJavaField field, ValueNode value)
NodePlugin
handleStoreField
in interface NodePlugin
b
- 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)
NodePlugin
handleStoreStaticField
in interface NodePlugin
b
- the contextfield
- the accessed fieldvalue
- the value to be stored into the fieldpublic boolean handleLoadIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, Kind elementKind)
NodePlugin
push
a value using the provided elementKind.handleLoadIndexed
in interface NodePlugin
b
- the contextarray
- the accessed arrayindex
- the index for the array accesselementKind
- the element kind of the accessed arraypublic boolean handleStoreIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, Kind elementKind, ValueNode value)
NodePlugin
handleStoreIndexed
in interface NodePlugin
b
- the contextarray
- the accessed arrayindex
- the index for the array accesselementKind
- the element kind of the accessed arrayvalue
- the value to be stored into the arraypublic boolean handleCheckCast(GraphBuilderContext b, ValueNode object, ResolvedJavaType type, JavaTypeProfile profile)
NodePlugin
push
a value with the result of the cast using
Kind.Object
.handleCheckCast
in interface NodePlugin
b
- 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)
NodePlugin
push
a value with the result of the instanceof using
Kind.Int
.handleInstanceOf
in interface NodePlugin
b
- 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 available