use of com.oracle.truffle.api.object.Shape in project graal by oracle.
the class DynamicObjectImpl method changeFlags.
/**
* @since 0.17 or earlier
*/
@TruffleBoundary
public boolean changeFlags(Object key, int newFlags) {
Shape oldShape = getShape();
Property existing = oldShape.getProperty(key);
if (existing != null) {
if (existing.getFlags() != newFlags) {
Property newProperty = existing.copyWithFlags(newFlags);
Shape newShape = oldShape.replaceProperty(existing, newProperty);
this.setShape(newShape);
}
return true;
} else {
return false;
}
}
use of com.oracle.truffle.api.object.Shape in project graal by oracle.
the class ObjectTypeTest method objectTypeRespondsToIsNull.
@Test
public void objectTypeRespondsToIsNull() {
final Layout layout = Layout.newLayout().build();
final Shape rootShape = layout.createShape(OBJECT_TYPE);
final DynamicObject obj = rootShape.newInstance();
final boolean is = JavaInteropTest.isNull(obj);
assertFalse("It is not null", is);
}
use of com.oracle.truffle.api.object.Shape in project graal by oracle.
the class ObjectTypeTest method objectTypeRespondsToIsBoxed.
@Test
public void objectTypeRespondsToIsBoxed() {
final Layout layout = Layout.newLayout().build();
final Shape rootShape = layout.createShape(OBJECT_TYPE);
final DynamicObject obj = rootShape.newInstance();
final boolean is = JavaInteropTest.isBoxed(obj);
assertFalse("It is not boxed", is);
}
Aggregations