|
11 | 11 |
|
12 | 12 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
13 | 13 | import com.oracle.truffle.api.dsl.Bind;
|
| 14 | +import com.oracle.truffle.api.dsl.GenerateCached; |
| 15 | +import com.oracle.truffle.api.dsl.GenerateInline; |
14 | 16 | import com.oracle.truffle.api.dsl.Specialization;
|
15 | 17 | import com.oracle.truffle.api.library.CachedLibrary;
|
| 18 | +import com.oracle.truffle.api.nodes.Node; |
16 | 19 | import com.oracle.truffle.api.object.DynamicObjectLibrary;
|
17 | 20 | import org.truffleruby.core.module.ModuleOperations;
|
18 | 21 | import org.truffleruby.core.module.RubyModule;
|
19 | 22 | import org.truffleruby.language.RubyBaseNode;
|
20 | 23 |
|
| 24 | +@GenerateCached(false) |
| 25 | +@GenerateInline |
21 | 26 | public abstract class LookupClassVariableStorageNode extends RubyBaseNode {
|
22 | 27 |
|
23 |
| - public abstract ClassVariableStorage execute(RubyModule module, String name); |
| 28 | + public abstract ClassVariableStorage execute(Node node, RubyModule module, String name); |
24 | 29 |
|
25 | 30 | @Specialization(guards = "objectLibrary.containsKey(classVariableStorage, name)")
|
26 |
| - ClassVariableStorage lookupClassVariable(RubyModule module, String name, |
| 31 | + static ClassVariableStorage lookupClassVariable(RubyModule module, String name, |
27 | 32 | @Bind("module.fields.getClassVariables()") ClassVariableStorage classVariableStorage,
|
28 | 33 | @CachedLibrary(limit = "getDynamicObjectCacheLimit()") DynamicObjectLibrary objectLibrary) {
|
29 | 34 | return classVariableStorage;
|
30 | 35 | }
|
31 | 36 |
|
32 | 37 | @Specialization(replaces = "lookupClassVariable")
|
33 | 38 | @TruffleBoundary
|
34 |
| - ClassVariableStorage uncachedLookupClassVariable(RubyModule module, String name) { |
| 39 | + static ClassVariableStorage uncachedLookupClassVariable(RubyModule module, String name) { |
35 | 40 | return ModuleOperations.classVariableLookup(module, true, m -> {
|
36 | 41 | final ClassVariableStorage classVariables = m.fields.getClassVariables();
|
37 | 42 | if (classVariables.getShape().hasProperty(name)) {
|
|
0 commit comments