102
102
import org .truffleruby .language .library .RubyStringLibrary ;
103
103
import org .truffleruby .language .loader .CodeLoader ;
104
104
import org .truffleruby .language .methods .Arity ;
105
- import org .truffleruby .language .methods .CanBindMethodToModuleNode ;
106
105
import org .truffleruby .language .methods .DeclarationContext ;
107
106
import org .truffleruby .language .methods .DeclarationContext .FixedDefaultDefinee ;
108
107
import org .truffleruby .language .methods .InternalMethod ;
@@ -1241,12 +1240,11 @@ public abstract static class DefineMethodNode extends AlwaysInlinedMethodNode {
1241
1240
//Checkstyle: resume
1242
1241
protected RubySymbol defineMethodWithMethod (
1243
1242
Frame callerFrame , RubyModule module , Object [] rubyArgs , RootCallTarget target ,
1244
- @ Cached NameToJavaStringNode nameToJavaStringNode ,
1245
- @ Cached (allowUncached = true ) CanBindMethodToModuleNode canBindMethodToModuleNode ) {
1243
+ @ Cached NameToJavaStringNode nameToJavaStringNode ) {
1246
1244
final String name = nameToJavaStringNode .execute (RubyArguments .getArgument (rubyArgs , 0 ));
1247
1245
final Object method = RubyArguments .getArgument (rubyArgs , 1 );
1248
1246
1249
- return addMethod (module , name , (RubyMethod ) method , canBindMethodToModuleNode );
1247
+ return addMethod (module , name , (RubyMethod ) method );
1250
1248
}
1251
1249
1252
1250
//Checkstyle: stop
@@ -1292,6 +1290,7 @@ protected RubySymbol defineMethodWithBlock(
1292
1290
@ Cached NameToJavaStringNode nameToJavaStringNode ) {
1293
1291
final String name = nameToJavaStringNode .execute (RubyArguments .getArgument (rubyArgs , 0 ));
1294
1292
final Object block = RubyArguments .getBlock (rubyArgs );
1293
+
1295
1294
needCallerFrame (callerFrame , target );
1296
1295
return addProc (module , name , (RubyProc ) block , callerFrame .materialize ());
1297
1296
}
@@ -1303,11 +1302,10 @@ protected RubySymbol defineMethodWithoutMethodAndBlock(
1303
1302
}
1304
1303
1305
1304
@ TruffleBoundary
1306
- private RubySymbol addMethod (RubyModule module , String name , RubyMethod method ,
1307
- @ Cached CanBindMethodToModuleNode canBindMethodToModuleNode ) {
1305
+ private RubySymbol addMethod (RubyModule module , String name , RubyMethod method ) {
1308
1306
final InternalMethod internalMethod = method .method ;
1309
1307
1310
- if (!canBindMethodToModuleNode . executeCanBindMethodToModule (internalMethod , module )) {
1308
+ if (!ModuleOperations . canBindMethodTo (internalMethod , module )) {
1311
1309
final RubyModule declaringModule = internalMethod .getDeclaringModule ();
1312
1310
if (RubyGuards .isSingletonClass (declaringModule )) {
1313
1311
throw new RaiseException (getContext (), coreExceptions ().typeError (
0 commit comments