@@ -67,11 +67,11 @@ public class InvokeJavaMethodNode extends DeoptimizingFixedWithNextNode implemen
67
67
* {@link InvokeJavaMethodNode} creation. See
68
68
* {@code HotSpotTruffleSafepointLoweringSnippet#pollSnippet} for usage details.
69
69
*/
70
- public static final class MethodWrapper {
70
+ public static final class MethodReference {
71
71
private final String name ;
72
72
private ResolvedJavaMethod targetMethod ;
73
73
74
- public MethodWrapper (String name ) {
74
+ public MethodReference (String name ) {
75
75
this .name = name ;
76
76
}
77
77
@@ -84,7 +84,7 @@ public String getName() {
84
84
}
85
85
}
86
86
87
- public static final MethodWrapper TRUFFLE_SAFEPOINT = new MethodWrapper ("HotSpotThreadLocalHandshake.doHandshake" );
87
+ public static final MethodReference TRUFFLE_SAFEPOINT = new MethodReference ("HotSpotThreadLocalHandshake.doHandshake" );
88
88
89
89
@ Input protected NodeInputList <ValueNode > arguments ;
90
90
@@ -93,7 +93,7 @@ public String getName() {
93
93
private ResolvedJavaMethod targetMethod ;
94
94
private final CallTargetNode .InvokeKind invokeKind ;
95
95
private final StampPair returnStamp ;
96
- private MethodWrapper methodWrapper ;
96
+ private MethodReference methodReference ;
97
97
98
98
@ SuppressWarnings ("this-escape" )
99
99
protected InvokeJavaMethodNode (NodeClass <? extends InvokeJavaMethodNode > c , ResolvedJavaMethod targetMethod , ResolvedJavaMethod callerMethod ,
@@ -108,7 +108,7 @@ protected InvokeJavaMethodNode(NodeClass<? extends InvokeJavaMethodNode> c, Reso
108
108
}
109
109
110
110
@ SuppressWarnings ("unused" )
111
- public static InvokeJavaMethodNode create (MethodWrapper wrapper , ResolvedJavaMethod callerMethod , int bci , ValueNode ... args ) {
111
+ public static InvokeJavaMethodNode 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 ();
@@ -123,8 +123,10 @@ public static InvokeJavaMethodNode create(GraphBuilderContext b, ResolvedJavaMet
123
123
return create (b , targetMethod , b .getMethod (), returnStamp , bci , args );
124
124
}
125
125
126
- private static InvokeJavaMethodNode create (GraphBuilderContext b , Stamp returnStamp , int bci , ValueNode ... args ) {
127
- return create (b , null , b .getMethod (), StampPair .createSingle (returnStamp ), bci , args );
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 );
128
+ invoke .methodReference = method ;
129
+ return invoke ;
128
130
}
129
131
130
132
private static InvokeJavaMethodNode create (GraphBuilderContext b , ResolvedJavaMethod targetMethod , ResolvedJavaMethod callerMethod ,
@@ -186,7 +188,7 @@ public String toString(Verbosity verbosity) {
186
188
sb .append (super .toString (verbosity ));
187
189
sb .append ("#" );
188
190
if (targetMethod == null ) {
189
- sb .append (methodWrapper .getName ());
191
+ sb .append (methodReference .getName ());
190
192
} else {
191
193
sb .append (targetMethod .format ("%h.%n" ));
192
194
}
@@ -198,15 +200,14 @@ public String toString(Verbosity verbosity) {
198
200
@ Override
199
201
public Map <Object , Object > getDebugProperties (Map <Object , Object > map ) {
200
202
Map <Object , Object > debugProperties = super .getDebugProperties (map );
201
- debugProperties .put ("targetMethod" , targetMethod == null ? methodWrapper .getName () : targetMethod .format ("%h.%n" ));
203
+ debugProperties .put ("targetMethod" , targetMethod == null ? methodReference .getName () : targetMethod .format ("%h.%n" ));
202
204
return debugProperties ;
203
205
}
204
206
205
- public static boolean intrinsify (GraphBuilderContext b , @ InjectedNodeParameter Stamp returnStamp , MethodWrapper method , ValueNode ... args ) {
207
+ public static boolean intrinsify (GraphBuilderContext b , @ InjectedNodeParameter Stamp returnStamp , MethodReference method , ValueNode ... args ) {
206
208
GraphBuilderContext nonIntrinsicAncestor = b .getNonIntrinsicAncestor ();
207
209
int bci = nonIntrinsicAncestor == null ? BytecodeFrame .UNKNOWN_BCI : b .bci ();
208
- InvokeJavaMethodNode invoke = InvokeJavaMethodNode .create (b , returnStamp , bci , args );
209
- invoke .methodWrapper = method ;
210
+ InvokeJavaMethodNode invoke = InvokeJavaMethodNode .createWithoutTargetMethod (b , method , returnStamp , bci , args );
210
211
JavaKind returnKind = returnStamp .getStackKind ();
211
212
if (returnKind == JavaKind .Void ) {
212
213
b .add (invoke );
@@ -218,10 +219,10 @@ public static boolean intrinsify(GraphBuilderContext b, @InjectedNodeParameter S
218
219
219
220
/**
220
221
* Calls a static Java method with one argument and no return value. The target method has to be
221
- * set in the {@link MethodWrapper }, otherwise the node cannot be lowered.
222
+ * set in the {@link MethodReference }, otherwise the node cannot be lowered.
222
223
*/
223
224
@ NodeIntrinsic
224
- public static native void invoke (@ ConstantNodeParameter MethodWrapper method , Object arg1 );
225
+ public static native void invoke (@ ConstantNodeParameter MethodReference method , Object arg1 );
225
226
226
227
@ SuppressWarnings ("try" )
227
228
public Invoke replaceWithInvoke () {
@@ -247,8 +248,8 @@ public InvokeNode createInvoke(StructuredGraph graph) {
247
248
public void lower (LoweringTool tool ) {
248
249
if (graph ().getGuardsStage ().areFrameStatesAtDeopts ()) {
249
250
if (targetMethod == null ) {
250
- GraalError .guarantee (methodWrapper != null , "method wrapper shouldn't be null" );
251
- setTargetMethod (methodWrapper .targetMethod );
251
+ GraalError .guarantee (methodReference != null , "method reference shouldn't be null" );
252
+ setTargetMethod (methodReference .targetMethod );
252
253
}
253
254
Invoke invoke = replaceWithInvoke ();
254
255
assert invoke .asNode ().verify ();
0 commit comments