57
57
size = SIZE_UNKNOWN , sizeRationale = SIZE_UNKNOWN_RATIONALE )
58
58
// @formatter:on
59
59
@ NodeIntrinsicFactory
60
- public class InvokeJavaMethodNode extends DeoptimizingFixedWithNextNode implements Invokable , Lowerable {
61
- public static final NodeClass <InvokeJavaMethodNode > TYPE = NodeClass .create (InvokeJavaMethodNode .class );
60
+ public class InvokeStaticJavaMethodNode extends DeoptimizingFixedWithNextNode implements Invokable , Lowerable {
61
+ public static final NodeClass <InvokeStaticJavaMethodNode > TYPE = NodeClass .create (InvokeStaticJavaMethodNode .class );
62
62
63
63
/**
64
64
* Enables passing a method (to be invoked by this node) as a constant within an intrinsic
65
65
* context. This is required when the specific method to invoke is known, but the corresponding
66
66
* {@link ResolvedJavaMethod} instance is not available at the time of
67
- * {@link InvokeJavaMethodNode } creation. See
67
+ * {@link InvokeStaticJavaMethodNode } creation. See
68
68
* {@code HotSpotTruffleSafepointLoweringSnippet#pollSnippet} for usage details.
69
69
*/
70
70
public static final class MethodReference {
@@ -96,7 +96,7 @@ public String getName() {
96
96
private MethodReference methodReference ;
97
97
98
98
@ SuppressWarnings ("this-escape" )
99
- protected InvokeJavaMethodNode (NodeClass <? extends InvokeJavaMethodNode > c , ResolvedJavaMethod targetMethod , ResolvedJavaMethod callerMethod ,
99
+ protected InvokeStaticJavaMethodNode (NodeClass <? extends InvokeStaticJavaMethodNode > c , ResolvedJavaMethod targetMethod , ResolvedJavaMethod callerMethod ,
100
100
StampPair returnStamp , int bci , ValueNode ... args ) {
101
101
super (c , returnStamp .getTrustedStamp ());
102
102
this .arguments = new NodeInputList <>(this , args );
@@ -108,31 +108,31 @@ protected InvokeJavaMethodNode(NodeClass<? extends InvokeJavaMethodNode> c, Reso
108
108
}
109
109
110
110
@ SuppressWarnings ("unused" )
111
- public static InvokeJavaMethodNode create (MethodReference wrapper , ResolvedJavaMethod callerMethod , int bci , ValueNode ... args ) {
111
+ public static InvokeStaticJavaMethodNode create (MethodReference wrapper , ResolvedJavaMethod callerMethod , int bci , ValueNode ... args ) {
112
112
verifyTargetMethod (wrapper .targetMethod );
113
113
ResolvedJavaMethod targetMethod = wrapper .targetMethod ;
114
114
JavaKind returnKind = targetMethod .getSignature ().getReturnKind ();
115
- return new InvokeJavaMethodNode (TYPE , targetMethod , callerMethod , StampPair .createSingle (StampFactory .forKind (returnKind )), bci , args );
115
+ return new InvokeStaticJavaMethodNode (TYPE , targetMethod , callerMethod , StampPair .createSingle (StampFactory .forKind (returnKind )), bci , args );
116
116
}
117
117
118
- public static InvokeJavaMethodNode create (GraphBuilderContext b , ResolvedJavaMethod targetMethod , int bci , ValueNode ... args ) {
118
+ public static InvokeStaticJavaMethodNode create (GraphBuilderContext b , ResolvedJavaMethod targetMethod , int bci , ValueNode ... args ) {
119
119
Signature signature = targetMethod .getSignature ();
120
120
JavaType returnType = signature .getReturnType (null );
121
121
StructuredGraph graph = b .getGraph ();
122
122
StampPair returnStamp = StampFactory .forDeclaredType (graph .getAssumptions (), returnType , false );
123
123
return create (b , targetMethod , b .getMethod (), returnStamp , bci , args );
124
124
}
125
125
126
- private static InvokeJavaMethodNode createWithoutTargetMethod (GraphBuilderContext b , MethodReference method , Stamp returnStamp , int bci , ValueNode ... args ) {
127
- InvokeJavaMethodNode invoke = create (b , null , b .getMethod (), StampPair .createSingle (returnStamp ), bci , args );
126
+ private static InvokeStaticJavaMethodNode createWithoutTargetMethod (GraphBuilderContext b , MethodReference method , Stamp returnStamp , int bci , ValueNode ... args ) {
127
+ InvokeStaticJavaMethodNode invoke = create (b , null , b .getMethod (), StampPair .createSingle (returnStamp ), bci , args );
128
128
invoke .methodReference = method ;
129
129
return invoke ;
130
130
}
131
131
132
- private static InvokeJavaMethodNode create (GraphBuilderContext b , ResolvedJavaMethod targetMethod , ResolvedJavaMethod callerMethod ,
132
+ private static InvokeStaticJavaMethodNode create (GraphBuilderContext b , ResolvedJavaMethod targetMethod , ResolvedJavaMethod callerMethod ,
133
133
StampPair returnStamp , int bci , ValueNode ... args ) {
134
134
GraalError .guarantee (b .getInvokeKind () == CallTargetNode .InvokeKind .Static , "can only invoke static methods" );
135
- return new InvokeJavaMethodNode (TYPE , targetMethod , callerMethod , returnStamp , bci , args );
135
+ return new InvokeStaticJavaMethodNode (TYPE , targetMethod , callerMethod , returnStamp , bci , args );
136
136
}
137
137
138
138
@ Override
@@ -207,7 +207,7 @@ public Map<Object, Object> getDebugProperties(Map<Object, Object> map) {
207
207
public static boolean intrinsify (GraphBuilderContext b , @ InjectedNodeParameter Stamp returnStamp , MethodReference method , ValueNode ... args ) {
208
208
GraphBuilderContext nonIntrinsicAncestor = b .getNonIntrinsicAncestor ();
209
209
int bci = nonIntrinsicAncestor == null ? BytecodeFrame .UNKNOWN_BCI : b .bci ();
210
- InvokeJavaMethodNode invoke = InvokeJavaMethodNode .createWithoutTargetMethod (b , method , returnStamp , bci , args );
210
+ InvokeStaticJavaMethodNode invoke = InvokeStaticJavaMethodNode .createWithoutTargetMethod (b , method , returnStamp , bci , args );
211
211
JavaKind returnKind = returnStamp .getStackKind ();
212
212
if (returnKind == JavaKind .Void ) {
213
213
b .add (invoke );
0 commit comments