10
10
package org .truffleruby .language .methods ;
11
11
12
12
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
13
- import com .oracle .truffle .api .dsl .Bind ;
14
13
import com .oracle .truffle .api .dsl .Cached ;
15
14
import com .oracle .truffle .api .dsl .Cached .Shared ;
16
15
import com .oracle .truffle .api .dsl .GenerateCached ;
@@ -89,10 +88,10 @@ protected static Object invokeOrRead(Node node, Object receiver, String name, Ob
89
88
}
90
89
91
90
@ Specialization (guards = { "name == cachedName" , "isOperatorMethod(cachedName)" }, limit = "1" )
92
- protected static Object operatorMethod (Object receiver , String name , Object [] args ,
91
+ protected static Object operatorMethod (Node node , Object receiver , String name , Object [] args ,
93
92
@ Cached ("name" ) String cachedName ,
94
93
@ Cached ConvertForOperatorAndReDispatchNode operatorNode ) {
95
- return operatorNode .execute (receiver , name , args );
94
+ return operatorNode .execute (node , receiver , name , args );
96
95
}
97
96
98
97
@ Specialization (guards = { "name == cachedName" , "isAssignmentMethod(cachedName)" }, limit = "1" )
@@ -156,16 +155,17 @@ protected static Object invoke(Node node, Object receiver, String name, Object[]
156
155
}
157
156
158
157
@ GenerateUncached
158
+ @ GenerateCached (false )
159
+ @ GenerateInline
159
160
protected abstract static class ConvertForOperatorAndReDispatchNode extends RubyBaseNode {
160
161
161
- protected abstract Object execute (Object receiver , String name , Object [] args );
162
+ protected abstract Object execute (Node node , Object receiver , String name , Object [] args );
162
163
163
164
@ Specialization (guards = "receivers.isBoolean(receiver)" , limit = "getInteropCacheLimit()" )
164
- protected static Object callBoolean (Object receiver , String name , Object [] args ,
165
+ protected static Object callBoolean (Node node , Object receiver , String name , Object [] args ,
165
166
@ CachedLibrary ("receiver" ) InteropLibrary receivers ,
166
167
@ Cached @ Shared TranslateInteropExceptionNode translateInteropException ,
167
- @ Cached @ Shared DispatchNode dispatch ,
168
- @ Bind ("this" ) Node node ) {
168
+ @ Cached @ Shared DispatchNode dispatch ) {
169
169
try {
170
170
return dispatch .call (receivers .asBoolean (receiver ), name , args );
171
171
} catch (InteropException e ) {
@@ -176,11 +176,10 @@ protected static Object callBoolean(Object receiver, String name, Object[] args,
176
176
@ Specialization (
177
177
guards = { "receivers.isNumber(receiver)" , "receivers.fitsInInt(receiver)" },
178
178
limit = "getInteropCacheLimit()" )
179
- protected static Object callInt (Object receiver , String name , Object [] args ,
179
+ protected static Object callInt (Node node , Object receiver , String name , Object [] args ,
180
180
@ CachedLibrary ("receiver" ) InteropLibrary receivers ,
181
181
@ Cached @ Shared TranslateInteropExceptionNode translateInteropException ,
182
- @ Cached @ Shared DispatchNode dispatch ,
183
- @ Bind ("this" ) Node node ) {
182
+ @ Cached @ Shared DispatchNode dispatch ) {
184
183
try {
185
184
return dispatch .call (receivers .asInt (receiver ), name , args );
186
185
} catch (InteropException e ) {
@@ -194,11 +193,10 @@ protected static Object callInt(Object receiver, String name, Object[] args,
194
193
"!receivers.fitsInInt(receiver)" ,
195
194
"receivers.fitsInLong(receiver)" },
196
195
limit = "getInteropCacheLimit()" )
197
- protected static Object callLong (Object receiver , String name , Object [] args ,
196
+ protected static Object callLong (Node node , Object receiver , String name , Object [] args ,
198
197
@ CachedLibrary ("receiver" ) InteropLibrary receivers ,
199
198
@ Cached @ Shared TranslateInteropExceptionNode translateInteropException ,
200
- @ Cached @ Shared DispatchNode dispatch ,
201
- @ Bind ("this" ) Node node ) {
199
+ @ Cached @ Shared DispatchNode dispatch ) {
202
200
try {
203
201
return dispatch .call (receivers .asLong (receiver ), name , args );
204
202
} catch (InteropException e ) {
@@ -212,11 +210,10 @@ protected static Object callLong(Object receiver, String name, Object[] args,
212
210
"!receivers.fitsInLong(receiver)" ,
213
211
"receivers.fitsInBigInteger(receiver)" },
214
212
limit = "getInteropCacheLimit()" )
215
- protected static Object callBigInteger (Object receiver , String name , Object [] args ,
213
+ protected static Object callBigInteger (Node node , Object receiver , String name , Object [] args ,
216
214
@ CachedLibrary ("receiver" ) InteropLibrary receivers ,
217
215
@ Cached @ Shared TranslateInteropExceptionNode translateInteropException ,
218
- @ Cached @ Shared DispatchNode dispatch ,
219
- @ Bind ("this" ) Node node ) {
216
+ @ Cached @ Shared DispatchNode dispatch ) {
220
217
try {
221
218
return dispatch .call (new RubyBignum (receivers .asBigInteger (receiver )), name , args );
222
219
} catch (InteropException e ) {
@@ -230,11 +227,10 @@ protected static Object callBigInteger(Object receiver, String name, Object[] ar
230
227
"!receivers.fitsInBigInteger(receiver)" ,
231
228
"receivers.fitsInDouble(receiver)" },
232
229
limit = "getInteropCacheLimit()" )
233
- protected static Object callDouble (Object receiver , String name , Object [] args ,
230
+ protected static Object callDouble (Node node , Object receiver , String name , Object [] args ,
234
231
@ CachedLibrary ("receiver" ) InteropLibrary receivers ,
235
232
@ Cached @ Shared TranslateInteropExceptionNode translateInteropException ,
236
- @ Cached @ Shared DispatchNode dispatch ,
237
- @ Bind ("this" ) Node node ) {
233
+ @ Cached @ Shared DispatchNode dispatch ) {
238
234
try {
239
235
return dispatch .call (receivers .asDouble (receiver ), name , args );
240
236
} catch (InteropException e ) {
@@ -244,10 +240,9 @@ protected static Object callDouble(Object receiver, String name, Object[] args,
244
240
245
241
@ Specialization (guards = { "!receivers.isBoolean(receiver)" , "!receivers.isNumber(receiver)" },
246
242
limit = "getInteropCacheLimit()" )
247
- protected static Object call (Object receiver , String name , Object [] args ,
243
+ protected static Object call (Node node , Object receiver , String name , Object [] args ,
248
244
@ CachedLibrary ("receiver" ) InteropLibrary receivers ,
249
- @ Cached InteropNodes .InvokeMemberNode invokeNode ,
250
- @ Bind ("this" ) Node node ) {
245
+ @ Cached InteropNodes .InvokeMemberNode invokeNode ) {
251
246
return invokeNode .execute (node , receiver , name , args );
252
247
}
253
248
}
0 commit comments