Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.object.ObjectType;
import com.oracle.truffle.api.object.Shape;
import org.jruby.truffle.core.Layouts;

@@ -30,8 +31,11 @@ public static boolean isQueueShape(Shape shape) {
return Layouts.QUEUE.isQueue(shape.getObjectType());
}

private static final ObjectType BASIC_OBJECT_OBJECT_TYPE =
Layouts.BASIC_OBJECT.createBasicObjectShape(null, null).getShape().getObjectType();

public static boolean isBasicObjectShape(Shape shape) {
return shape.getObjectType().getClass().getName().endsWith(".BasicObjectType"); // FIXME
return shape.getObjectType().getClass() == BASIC_OBJECT_OBJECT_TYPE.getClass();
}

}

0 comments on commit 7ef82c9

Please sign in to comment.