|
9 | 9 | */
|
10 | 10 | package org.truffleruby.language.methods;
|
11 | 11 |
|
| 12 | +import com.oracle.truffle.api.dsl.GenerateCached; |
| 13 | +import com.oracle.truffle.api.dsl.GenerateInline; |
| 14 | +import com.oracle.truffle.api.nodes.Node; |
12 | 15 | import org.truffleruby.core.module.ModuleOperations;
|
13 | 16 | import org.truffleruby.core.module.RubyModule;
|
14 | 17 | import org.truffleruby.language.RubyBaseNode;
|
|
17 | 20 | import com.oracle.truffle.api.dsl.Specialization;
|
18 | 21 |
|
19 | 22 | /** Caches {@link ModuleOperations#canBindMethodTo} for a method. */
|
| 23 | +@GenerateInline |
| 24 | +@GenerateCached(false) |
20 | 25 | public abstract class CanBindMethodToModuleNode extends RubyBaseNode {
|
21 | 26 |
|
22 |
| - public abstract boolean executeCanBindMethodToModule(InternalMethod method, RubyModule module); |
| 27 | + public abstract boolean executeCanBindMethodToModule(Node node, InternalMethod method, RubyModule module); |
23 | 28 |
|
24 | 29 | @Specialization(
|
25 | 30 | guards = {
|
26 | 31 | "method.getDeclaringModule() == declaringModule",
|
27 | 32 | "module == cachedModule" },
|
28 | 33 | limit = "getCacheLimit()")
|
29 |
| - boolean canBindMethodToCached(InternalMethod method, RubyModule module, |
| 34 | + static boolean canBindMethodToCached(InternalMethod method, RubyModule module, |
30 | 35 | @Cached("method.getDeclaringModule()") RubyModule declaringModule,
|
31 | 36 | @Cached("module") RubyModule cachedModule,
|
32 | 37 | @Cached("canBindMethodTo(method, cachedModule)") boolean canBindMethodTo) {
|
33 | 38 | return canBindMethodTo;
|
34 | 39 | }
|
35 | 40 |
|
36 | 41 | @Specialization
|
37 |
| - boolean canBindMethodToUncached(InternalMethod method, RubyModule module) { |
| 42 | + static boolean canBindMethodToUncached(InternalMethod method, RubyModule module) { |
38 | 43 | return canBindMethodTo(method, module);
|
39 | 44 | }
|
40 | 45 |
|
41 |
| - protected boolean canBindMethodTo(InternalMethod method, RubyModule module) { |
| 46 | + protected static boolean canBindMethodTo(InternalMethod method, RubyModule module) { |
42 | 47 | return ModuleOperations.canBindMethodTo(method, module);
|
43 | 48 | }
|
44 | 49 |
|
|
0 commit comments