@@ -176,29 +176,28 @@ private static long getNativeStringCapacity(Pointer pointer) {
176
176
@ Primitive (name = "call_with_c_mutex_and_frame" )
177
177
public abstract static class CallWithCExtLockAndFrameNode extends PrimitiveArrayArgumentsNode {
178
178
179
- @ Specialization ( limit = "getCacheLimit()" )
180
- protected static Object callWithCExtLockAndFrame (
179
+ @ Specialization
180
+ protected Object callWithCExtLockAndFrame (
181
181
VirtualFrame frame , Object receiver , RubyArray argsArray , Object specialVariables , Object block ,
182
- @ CachedLibrary ("receiver " ) InteropLibrary receivers ,
182
+ @ CachedLibrary (limit = "getCacheLimit() " ) InteropLibrary receivers ,
183
183
@ Cached ArrayToObjectArrayNode arrayToObjectArrayNode ,
184
184
@ Cached TranslateInteropExceptionNode translateInteropExceptionNode ,
185
185
@ Cached InlinedConditionProfile ownedProfile ,
186
- @ Cached RunMarkOnExitNode runMarksNode ,
187
- @ Bind ("this" ) Node node ) {
188
- final ExtensionCallStack extensionStack = getLanguage (node )
186
+ @ Cached RunMarkOnExitNode runMarksNode ) {
187
+ final ExtensionCallStack extensionStack = getLanguage ()
189
188
.getCurrentThread ()
190
189
.getCurrentFiber ().extensionCallStack ;
191
190
final boolean keywordsGiven = RubyArguments .getDescriptor (frame ) instanceof KeywordArgumentsDescriptor ;
192
191
extensionStack .push (keywordsGiven , specialVariables , block );
193
192
try {
194
193
final Object [] args = arrayToObjectArrayNode .executeToObjectArray (argsArray );
195
194
196
- if (getContext (node ).getOptions ().CEXT_LOCK ) {
197
- final ReentrantLock lock = getContext (node ).getCExtensionsLock ();
198
- boolean owned = ownedProfile .profile (node , lock .isHeldByCurrentThread ());
195
+ if (getContext ().getOptions ().CEXT_LOCK ) {
196
+ final ReentrantLock lock = getContext ().getCExtensionsLock ();
197
+ boolean owned = ownedProfile .profile (this , lock .isHeldByCurrentThread ());
199
198
200
199
if (!owned ) {
201
- MutexOperations .lockInternal (getContext (node ), lock , node );
200
+ MutexOperations .lockInternal (getContext (), lock , this );
202
201
}
203
202
try {
204
203
return InteropNodes .execute (receiver , args , receivers , translateInteropExceptionNode );
@@ -229,28 +228,27 @@ protected int getCacheLimit() {
229
228
@ Primitive (name = "call_with_c_mutex_and_frame_and_unwrap" )
230
229
public abstract static class CallWithCExtLockAndFrameAndUnwrapNode extends PrimitiveArrayArgumentsNode {
231
230
232
- @ Specialization ( limit = "getCacheLimit()" )
233
- protected static Object callWithCExtLockAndFrame (
231
+ @ Specialization
232
+ protected Object callWithCExtLockAndFrame (
234
233
VirtualFrame frame , Object receiver , RubyArray argsArray , Object specialVariables , Object block ,
235
- @ CachedLibrary ("receiver " ) InteropLibrary receivers ,
234
+ @ CachedLibrary (limit = "getCacheLimit() " ) InteropLibrary receivers ,
236
235
@ Cached ArrayToObjectArrayNode arrayToObjectArrayNode ,
237
236
@ Cached TranslateInteropExceptionNode translateInteropExceptionNode ,
238
237
@ Cached InlinedConditionProfile ownedProfile ,
239
238
@ Cached RunMarkOnExitNode runMarksNode ,
240
- @ Cached UnwrapNode unwrapNode ,
241
- @ Bind ("this" ) Node node ) {
242
- final ExtensionCallStack extensionStack = getLanguage (node ).getCurrentFiber ().extensionCallStack ;
239
+ @ Cached UnwrapNode unwrapNode ) {
240
+ final ExtensionCallStack extensionStack = getLanguage ().getCurrentFiber ().extensionCallStack ;
243
241
final boolean keywordsGiven = RubyArguments .getDescriptor (frame ) instanceof KeywordArgumentsDescriptor ;
244
242
extensionStack .push (keywordsGiven , specialVariables , block );
245
243
try {
246
244
final Object [] args = arrayToObjectArrayNode .executeToObjectArray (argsArray );
247
245
248
- if (getContext (node ).getOptions ().CEXT_LOCK ) {
249
- final ReentrantLock lock = getContext (node ).getCExtensionsLock ();
250
- boolean owned = ownedProfile .profile (node , lock .isHeldByCurrentThread ());
246
+ if (getContext ().getOptions ().CEXT_LOCK ) {
247
+ final ReentrantLock lock = getContext ().getCExtensionsLock ();
248
+ boolean owned = ownedProfile .profile (this , lock .isHeldByCurrentThread ());
251
249
252
250
if (!owned ) {
253
- MutexOperations .lockInternal (getContext (node ), lock , node );
251
+ MutexOperations .lockInternal (getContext (), lock , this );
254
252
}
255
253
try {
256
254
return unwrapNode .execute (
@@ -285,21 +283,20 @@ public abstract static class CallWithCExtLockNode extends PrimitiveArrayArgument
285
283
286
284
public abstract Object execute (Object receiver , RubyArray argsArray );
287
285
288
- @ Specialization ( limit = "getCacheLimit()" )
289
- protected static Object callWithCExtLock (Object receiver , RubyArray argsArray ,
290
- @ CachedLibrary ("receiver " ) InteropLibrary receivers ,
286
+ @ Specialization
287
+ protected Object callWithCExtLock (Object receiver , RubyArray argsArray ,
288
+ @ CachedLibrary (limit = "getCacheLimit() " ) InteropLibrary receivers ,
291
289
@ Cached ArrayToObjectArrayNode arrayToObjectArrayNode ,
292
290
@ Cached TranslateInteropExceptionNode translateInteropExceptionNode ,
293
- @ Cached InlinedConditionProfile ownedProfile ,
294
- @ Bind ("this" ) Node node ) {
291
+ @ Cached InlinedConditionProfile ownedProfile ) {
295
292
final Object [] args = arrayToObjectArrayNode .executeToObjectArray (argsArray );
296
293
297
- if (getContext (node ).getOptions ().CEXT_LOCK ) {
298
- final ReentrantLock lock = getContext (node ).getCExtensionsLock ();
299
- boolean owned = ownedProfile .profile (node , lock .isHeldByCurrentThread ());
294
+ if (getContext ().getOptions ().CEXT_LOCK ) {
295
+ final ReentrantLock lock = getContext ().getCExtensionsLock ();
296
+ boolean owned = ownedProfile .profile (this , lock .isHeldByCurrentThread ());
300
297
301
298
if (!owned ) {
302
- MutexOperations .lockInternal (getContext (node ), lock , node );
299
+ MutexOperations .lockInternal (getContext (), lock , this );
303
300
}
304
301
try {
305
302
return InteropNodes .execute (receiver , args , receivers , translateInteropExceptionNode );
0 commit comments