|
15 | 15 | import org.truffleruby.cext.ValueWrapper;
|
16 | 16 | import org.truffleruby.interop.ForeignToRubyArgumentsNode;
|
17 | 17 | import org.truffleruby.interop.ForeignToRubyNode;
|
| 18 | +import org.truffleruby.language.dispatch.DispatchConfiguration; |
18 | 19 | import org.truffleruby.language.dispatch.DispatchNode;
|
19 | 20 | import org.truffleruby.language.dispatch.InternalRespondToNode;
|
20 | 21 | import org.truffleruby.language.library.RubyLibrary;
|
|
28 | 29 | import com.oracle.truffle.api.library.ExportLibrary;
|
29 | 30 | import com.oracle.truffle.api.library.ExportMessage;
|
30 | 31 | import com.oracle.truffle.api.profiles.BranchProfile;
|
| 32 | +import org.truffleruby.language.methods.GetMethodObjectNode; |
31 | 33 |
|
32 | 34 | /** A subset of messages from {@link org.truffleruby.language.RubyDynamicObject} for immutable objects. Such objects
|
33 | 35 | * have no instance variables, so the logic is simpler. We cannot easily reuse RubyDynamicObject messages since the
|
@@ -111,12 +113,12 @@ public boolean isMemberReadable(String name,
|
111 | 113 | public Object readMember(String name,
|
112 | 114 | @Cached @Shared("definedNode") InternalRespondToNode definedNode,
|
113 | 115 | @Cached ForeignToRubyNode nameToRubyNode,
|
114 |
| - @Cached @Exclusive DispatchNode dispatch, |
| 116 | + @Cached GetMethodObjectNode getMethodObjectNode, |
115 | 117 | @Shared("errorProfile") @Cached BranchProfile errorProfile)
|
116 | 118 | throws UnknownIdentifierException {
|
117 | 119 | if (definedNode.execute(null, this, name)) {
|
118 | 120 | Object rubyName = nameToRubyNode.executeConvert(name);
|
119 |
| - return dispatch.call(this, "method", rubyName); |
| 121 | + return getMethodObjectNode.execute(null, this, rubyName, DispatchConfiguration.PRIVATE, null); |
120 | 122 | } else {
|
121 | 123 | errorProfile.enter();
|
122 | 124 | throw UnknownIdentifierException.create(name);
|
|
0 commit comments