Skip to content

Commit 5c636c0

Browse files
committed
[GR-44289] Workaround DSL issue by using dispatched libraries
1 parent c017cc1 commit 5c636c0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/java/org/truffleruby/core/support/TypeNodes.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,30 @@ protected boolean objectEqual(Object a, Object b,
111111
}
112112
}
113113

114+
// GR-44289: Using only dispatched libraries in this node as a workaround for that issue
114115
public abstract static class ObjectFreezeNode extends RubyBaseNode {
115116

116117
public abstract Object execute(Object self);
117118

118-
@Specialization(guards = "!isRubyDynamicObject(self)", limit = "getRubyLibraryCacheLimit()")
119+
@Specialization(guards = "!isRubyDynamicObject(self)")
119120
protected Object freeze(Object self,
120-
@CachedLibrary("self") RubyLibrary rubyLibrary) {
121+
@CachedLibrary(limit = "getRubyLibraryCacheLimit()") RubyLibrary rubyLibrary) {
121122
rubyLibrary.freeze(self);
122123
return self;
123124
}
124125

125-
@Specialization(guards = "!metaClass.isSingleton", limit = "getRubyLibraryCacheLimit()")
126+
@Specialization(guards = "!metaClass.isSingleton", limit = "1")
126127
protected Object freezeNormalObject(RubyDynamicObject self,
127-
@CachedLibrary("self") RubyLibrary rubyLibrary,
128+
@CachedLibrary(limit = "getRubyLibraryCacheLimit()") RubyLibrary rubyLibrary,
128129
@Cached MetaClassNode metaClassNode,
129130
@Bind("metaClassNode.execute(self)") RubyClass metaClass) {
130131
rubyLibrary.freeze(self);
131132
return self;
132133
}
133134

134-
@Specialization(guards = "metaClass.isSingleton", limit = "getRubyLibraryCacheLimit()")
135+
@Specialization(guards = "metaClass.isSingleton", limit = "1")
135136
protected Object freezeSingletonObject(RubyDynamicObject self,
136-
@CachedLibrary("self") RubyLibrary rubyLibrary,
137+
@CachedLibrary(limit = "getRubyLibraryCacheLimit()") RubyLibrary rubyLibrary,
137138
@CachedLibrary(limit = "1") RubyLibrary rubyLibraryMetaClass,
138139
@Cached ConditionProfile singletonClassUnfrozenProfile,
139140
@Cached MetaClassNode metaClassNode,

0 commit comments

Comments
 (0)