Skip to content

Commit 3ea2408

Browse files
committed
Replace Property#get(DynamicObject, boolean) with Property#get(DynamicObject, Shape)
1 parent cedfbee commit 3ea2408

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
package org.truffleruby.language.objects.shared;
1111

12+
import com.oracle.truffle.api.object.Shape;
1213
import org.truffleruby.language.RubyBaseNode;
1314

1415
import com.oracle.truffle.api.dsl.Specialization;
@@ -28,11 +29,12 @@ public ReadAndShareFieldNode(Property property, int depth) {
2829
this.writeBarrierNode = WriteBarrierNodeGen.create(depth);
2930
}
3031

31-
public abstract void executeReadFieldAndShare(RubyDynamicObject object);
32+
public abstract void executeReadFieldAndShare(RubyDynamicObject object, Shape shape);
3233

3334
@Specialization
34-
protected void readFieldAndShare(RubyDynamicObject object) {
35-
final Object value = property.get(object, true);
35+
protected void readFieldAndShare(RubyDynamicObject object, Shape shape) {
36+
assert object.getShape() == shape;
37+
final Object value = property.get(object, shape);
3638
writeBarrierNode.executeWriteBarrier(value);
3739
}
3840

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected void shareCached(RubyDynamicObject object,
7777
shareInternalFieldsNode.executeShare(object);
7878

7979
for (ReadAndShareFieldNode readAndShareFieldNode : readAndShareFieldNodes) {
80-
readAndShareFieldNode.executeReadFieldAndShare(object);
80+
readAndShareFieldNode.executeReadFieldAndShare(object, sharedShape);
8181
}
8282

8383
assert allFieldsAreShared(object);

0 commit comments

Comments
 (0)