Skip to content

Commit a4bfa4f

Browse files
committed
Use limit 1 explicitly for MetaClassNode singleton class case
* This avoids a next field in the specialization class and the loop in execute() * 945 -> 908 for org.truffleruby.language.objects.MetaClassNodeGen.execute
1 parent bfbc036 commit a4bfa4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/truffleruby/language/objects/MetaClassNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public static MetaClassNode getUncached() {
3535
public abstract RubyClass execute(Object value);
3636

3737
@Specialization(
38-
guards = { "object == cachedObject", "metaClass.isSingleton" },
39-
limit = "getIdentityCacheContextLimit()")
38+
guards = { "isSingleContext()", "object == cachedObject", "metaClass.isSingleton" },
39+
limit = "1")
4040
protected RubyClass singleton(RubyDynamicObject object,
4141
@Cached("object") RubyDynamicObject cachedObject,
4242
@Cached("object.getMetaClass()") RubyClass metaClass) {

0 commit comments

Comments
 (0)