|
89 | 89 | import org.truffleruby.language.WarningNode.UncachedWarningNode;
|
90 | 90 | import org.truffleruby.language.arguments.ArgumentsDescriptor;
|
91 | 91 | import org.truffleruby.language.arguments.EmptyArgumentsDescriptor;
|
92 |
| -import org.truffleruby.language.arguments.ReadCallerFrameNode; |
93 | 92 | import org.truffleruby.language.arguments.RubyArguments;
|
94 | 93 | import org.truffleruby.language.backtrace.BacktraceFormatter;
|
95 | 94 | import org.truffleruby.language.constants.ConstantEntry;
|
@@ -1948,22 +1947,18 @@ protected RubyArray instanceMethods(RubyModule module, boolean includeAncestors)
|
1948 | 1947 | }
|
1949 | 1948 | }
|
1950 | 1949 |
|
1951 |
| - @CoreMethod(names = "instance_method", required = 1) |
1952 |
| - @NodeChild(value = "module", type = RubyNode.class) |
1953 |
| - @NodeChild(value = "name", type = RubyBaseNodeWithExecute.class) |
1954 |
| - public abstract static class InstanceMethodNode extends CoreMethodNode { |
1955 |
| - @Child private ReadCallerFrameNode readCallerFrame = ReadCallerFrameNode.create(); |
1956 |
| - |
1957 |
| - @CreateCast("name") |
1958 |
| - protected RubyBaseNodeWithExecute coerceToString(RubyBaseNodeWithExecute name) { |
1959 |
| - return NameToJavaStringNode.create(name); |
1960 |
| - } |
| 1950 | + @GenerateUncached |
| 1951 | + @CoreMethod(names = "instance_method", required = 1, alwaysInlined = true) |
| 1952 | + public abstract static class InstanceMethodNode extends AlwaysInlinedMethodNode { |
1961 | 1953 |
|
1962 | 1954 | @Specialization
|
1963 |
| - protected RubyUnboundMethod instanceMethod(VirtualFrame frame, RubyModule module, String name, |
| 1955 | + protected RubyUnboundMethod instanceMethod( |
| 1956 | + Frame callerFrame, RubyModule module, Object[] rubyArgs, RootCallTarget target, |
| 1957 | + @Cached NameToJavaStringNode nameToJavaStringNode, |
1964 | 1958 | @Cached BranchProfile errorProfile) {
|
1965 |
| - final Frame callerFrame = readCallerFrame.execute(frame); |
| 1959 | + needCallerFrame(callerFrame, target); |
1966 | 1960 | final DeclarationContext declarationContext = RubyArguments.getDeclarationContext(callerFrame);
|
| 1961 | + final String name = nameToJavaStringNode.execute(RubyArguments.getArgument(rubyArgs, 0)); |
1967 | 1962 |
|
1968 | 1963 | // TODO(CS, 11-Jan-15) cache this lookup
|
1969 | 1964 | final InternalMethod method = ModuleOperations.lookupMethodUncached(module, name, declarationContext);
|
|
0 commit comments