|
9 | 9 | */
|
10 | 10 | package org.truffleruby.core.cast;
|
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.string.RubyString;
|
13 | 16 | import org.truffleruby.core.string.ImmutableRubyString;
|
14 | 17 | import org.truffleruby.language.RubyBaseNode;
|
|
17 | 20 | import com.oracle.truffle.api.dsl.Cached;
|
18 | 21 | import com.oracle.truffle.api.dsl.Specialization;
|
19 | 22 |
|
| 23 | +@GenerateCached(false) |
| 24 | +@GenerateInline |
20 | 25 | public abstract class ToPathNode extends RubyBaseNode {
|
21 | 26 |
|
22 |
| - public abstract Object execute(Object value); |
| 27 | + public abstract Object execute(Node node, Object value); |
23 | 28 |
|
24 | 29 | @Specialization
|
25 |
| - RubyString coerceRubyString(RubyString path) { |
| 30 | + static RubyString coerceRubyString(RubyString path) { |
26 | 31 | return path;
|
27 | 32 | }
|
28 | 33 |
|
29 | 34 | @Specialization
|
30 |
| - ImmutableRubyString coerceImmutableRubyString(ImmutableRubyString path) { |
| 35 | + static ImmutableRubyString coerceImmutableRubyString(ImmutableRubyString path) { |
31 | 36 | return path;
|
32 | 37 | }
|
33 | 38 |
|
34 | 39 | @Specialization(guards = "isNotRubyString(object)")
|
35 |
| - RubyString coerceObject(Object object, |
36 |
| - @Cached DispatchNode toPathNode) { |
37 |
| - return (RubyString) toPathNode.call(coreLibrary().truffleTypeModule, "coerce_to_path", object); |
| 40 | + static RubyString coerceObject(Node node, Object object, |
| 41 | + @Cached(inline = false) DispatchNode toPathNode) { |
| 42 | + return (RubyString) toPathNode.call(coreLibrary(node).truffleTypeModule, "coerce_to_path", object); |
38 | 43 | }
|
39 | 44 | }
|
0 commit comments