23
23
import org .truffleruby .language .objects .MetaClassNode ;
24
24
25
25
import com .oracle .truffle .api .CompilerAsserts ;
26
- import com .oracle .truffle .api .TruffleLanguage ;
27
26
import com .oracle .truffle .api .dsl .Cached ;
28
27
import com .oracle .truffle .api .dsl .CachedContext ;
29
28
import com .oracle .truffle .api .dsl .GenerateUncached ;
@@ -45,24 +44,20 @@ public abstract InternalMethod execute(Frame frame, RubyClass metaClass, String
45
44
DispatchConfiguration config );
46
45
47
46
@ Specialization (
48
- guards = {
49
- "metaClass == cachedMetaClass" ,
50
- "name == cachedName" ,
51
- "config == cachedConfig" ,
52
- "contextReference.get() == cachedContext" },
47
+ // no need to guard on the context, the metaClass is context-specific
48
+ guards = { "metaClass == cachedMetaClass" , "name == cachedName" , "config == cachedConfig" },
53
49
assumptions = "methodLookupResult.getAssumptions()" ,
54
50
limit = "getCacheLimit()" )
55
51
protected InternalMethod lookupMethodCached (
56
52
Frame frame ,
57
53
RubyClass metaClass ,
58
54
String name ,
59
55
DispatchConfiguration config ,
60
- @ CachedContext (RubyLanguage .class ) TruffleLanguage .ContextReference <RubyContext > contextReference ,
61
- @ Cached ("contextReference.get()" ) RubyContext cachedContext ,
56
+ @ CachedContext (RubyLanguage .class ) RubyContext context ,
62
57
@ Cached ("metaClass" ) RubyClass cachedMetaClass ,
63
58
@ Cached ("name" ) String cachedName ,
64
59
@ Cached ("config" ) DispatchConfiguration cachedConfig ,
65
- @ Cached ("lookupCached(cachedContext , frame, cachedMetaClass, cachedName, config)" ) MethodLookupResult methodLookupResult ) {
60
+ @ Cached ("lookupCached(context , frame, cachedMetaClass, cachedName, config)" ) MethodLookupResult methodLookupResult ) {
66
61
67
62
return methodLookupResult .getMethod ();
68
63
}
0 commit comments