Skip to content

Commit bc1eee1

Browse files
committed
Clean up sharing nodes now finalizer check is no longer needed.
1 parent 279c8ed commit bc1eee1

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/main/java/org/truffleruby/language/objects/shared/ShareInternalFieldsNode.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
package org.truffleruby.language.objects.shared;
1111

1212
import com.oracle.truffle.api.dsl.Cached.Exclusive;
13-
import org.truffleruby.Layouts;
1413
import org.truffleruby.collections.BoundaryIterable;
1514
import org.truffleruby.core.array.ArrayGuards;
1615
import org.truffleruby.core.array.ArrayOperations;
@@ -29,7 +28,6 @@
2928
import com.oracle.truffle.api.dsl.ImportStatic;
3029
import com.oracle.truffle.api.dsl.Specialization;
3130
import com.oracle.truffle.api.library.CachedLibrary;
32-
import com.oracle.truffle.api.object.Shape;
3331
import com.oracle.truffle.api.profiles.ConditionProfile;
3432

3533
/** Share the internal fields of an object, accessible by its Layout */
@@ -85,13 +83,8 @@ protected void shareCachedQueue(RubyQueue object,
8583
}
8684
}
8785

88-
@Specialization(
89-
guards = { "object.getShape() == cachedShape", "!hasFinalizerRef" },
90-
assumptions = "cachedShape.getValidAssumption()",
91-
limit = "CACHE_LIMIT")
92-
protected void shareCachedBasicObject(RubyBasicObject object,
93-
@Cached("object.getShape()") Shape cachedShape,
94-
@Cached("hasFinalizerRefProperty(cachedShape)") boolean hasFinalizerRef) {
86+
@Specialization
87+
protected void shareCachedBasicObject(RubyBasicObject object) {
9588
/* No internal fields for RubyBasicObject */
9689
}
9790

@@ -111,10 +104,6 @@ protected static boolean isDelegatedObjectArray(RubyArray array) {
111104
return store instanceof DelegatedArrayStorage && ((DelegatedArrayStorage) store).hasObjectArrayStorage();
112105
}
113106

114-
protected static boolean hasFinalizerRefProperty(Shape shape) {
115-
return shape.hasProperty(Layouts.FINALIZER_REF_IDENTIFIER);
116-
}
117-
118107
protected WriteBarrierNode createWriteBarrierNode() {
119108
return WriteBarrierNodeGen.create(depth);
120109
}

src/main/java/org/truffleruby/language/objects/shared/ShareObjectNode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ protected void shareUncached(RubyDynamicObject object) {
9898

9999
protected static List<Property> getObjectProperties(Shape shape) {
100100
final List<Property> objectProperties = new ArrayList<>();
101-
// User properties only, ShareInternalFieldsNode do the rest
102101
for (Property property : shape.getPropertyListInternal(false)) {
103102
if (property.getLocation() instanceof ObjectLocation) {
104103
objectProperties.add(property);

0 commit comments

Comments
 (0)