Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -15,14 +15,17 @@
import com.oracle.truffle.api.object.ObjectType;
import com.oracle.truffle.api.object.Shape;
import org.jruby.truffle.Layouts;
import org.jruby.truffle.language.objects.shared.SharedObjects;

public abstract class ShapeCachingGuards {

public static boolean updateShape(DynamicObject object) {
CompilerDirectives.transferToInterpreter();
synchronized (object) {
return object.updateShape();
boolean updated = object.updateShape();
if (updated) {
assert !SharedObjects.isShared(object);
}
return updated;
}

public static boolean isArrayShape(Shape shape) {

0 comments on commit 9cc1e7f

Please sign in to comment.