|
45 | 45 | import org.truffleruby.core.hash.ReHashable;
|
46 | 46 | import org.truffleruby.core.inlined.CoreMethods;
|
47 | 47 | import org.truffleruby.core.kernel.AtExitManager;
|
48 |
| -import org.truffleruby.core.kernel.KernelNodes; |
49 | 48 | import org.truffleruby.core.kernel.TraceManager;
|
50 |
| -import org.truffleruby.core.module.ModuleOperations; |
51 | 49 | import org.truffleruby.core.module.RubyModule;
|
52 | 50 | import org.truffleruby.core.objectspace.ObjectSpaceManager;
|
53 | 51 | import org.truffleruby.core.proc.ProcOperations;
|
|
63 | 61 | import org.truffleruby.language.CallStackManager;
|
64 | 62 | import org.truffleruby.core.string.ImmutableRubyString;
|
65 | 63 | import org.truffleruby.language.LexicalScope;
|
66 |
| -import org.truffleruby.language.Nil; |
67 | 64 | import org.truffleruby.language.RubyBaseNode;
|
68 | 65 | import org.truffleruby.language.SafepointManager;
|
69 |
| -import org.truffleruby.language.arguments.RubyArguments; |
70 | 66 | import org.truffleruby.language.backtrace.BacktraceFormatter;
|
71 | 67 | import org.truffleruby.language.control.RaiseException;
|
| 68 | +import org.truffleruby.language.dispatch.DispatchNode; |
72 | 69 | import org.truffleruby.language.loader.CodeLoader;
|
73 | 70 | import org.truffleruby.language.loader.FeatureLoader;
|
74 |
| -import org.truffleruby.language.methods.InternalMethod; |
75 |
| -import org.truffleruby.language.objects.MetaClassNode; |
76 | 71 | import org.truffleruby.language.objects.shared.SharedObjects;
|
77 | 72 | import org.truffleruby.options.LanguageOptions;
|
78 | 73 | import org.truffleruby.options.Options;
|
@@ -435,27 +430,7 @@ private TruffleNFIPlatform createNativePlatform() {
|
435 | 430 |
|
436 | 431 | @TruffleBoundary
|
437 | 432 | public static Object send(Object receiver, String methodName, Object... arguments) {
|
438 |
| - final InternalMethod method = ModuleOperations |
439 |
| - .lookupMethodUncached(MetaClassNode.getUncached().execute(receiver), methodName, null); |
440 |
| - if (method == null || method.isUndefined()) { |
441 |
| - final RubyContext context = RubyLanguage.getCurrentContext(); |
442 |
| - final String message = String.format( |
443 |
| - "undefined method `%s' for %s when using RubyContext#send() which ignores #method_missing", |
444 |
| - methodName, |
445 |
| - KernelNodes.ToSNode.uncachedBasicToS(receiver)); |
446 |
| - throw new RaiseException( |
447 |
| - context, |
448 |
| - context.getCoreExceptions().noMethodError( |
449 |
| - message, |
450 |
| - receiver, |
451 |
| - methodName, |
452 |
| - arguments, |
453 |
| - EncapsulatingNodeReference.getCurrent().get())); |
454 |
| - } |
455 |
| - |
456 |
| - return IndirectCallNode.getUncached().call( |
457 |
| - method.getCallTarget(), |
458 |
| - RubyArguments.pack(null, null, method, null, receiver, Nil.INSTANCE, arguments)); |
| 433 | + return DispatchNode.getUncached().call(receiver, methodName, arguments); |
459 | 434 | }
|
460 | 435 |
|
461 | 436 | @TruffleBoundary
|
|
0 commit comments