comparison graal/com.oracle.truffle.object/src/com/oracle/truffle/object/ShapeImpl.java @ 21952:f929f601bdca

Truffle: remove Shape#copyOverPropertiesInternal
author Andreas Woess <andreas.woess@oracle.com>
date Fri, 12 Jun 2015 15:23:50 +0200
parents c0744b24b230
children 633eb3ec30ce
comparison
equal deleted inserted replaced
21951:4fe034122fd3 21952:f929f601bdca
750 rightPtr = rightPtr.parent; 750 rightPtr = rightPtr.parent;
751 } 751 }
752 return leftPtr; 752 return leftPtr;
753 } 753 }
754 754
755 /**
756 * For copying over properties after exchanging the prototype of an object.
757 */
758 @TruffleBoundary
759 @Override
760 public final ShapeImpl copyOverPropertiesInternal(Shape destination) {
761 assert ((ShapeImpl) destination).getDepth() == 0;
762 List<Property> properties = this.getPropertyListInternal(true);
763 ShapeImpl newShape = ((ShapeImpl) destination).addPropertiesInternal(properties);
764 return newShape;
765 }
766
767 private ShapeImpl addPropertiesInternal(List<Property> properties) {
768 ShapeImpl newShape = this;
769 for (Property p : properties) {
770 newShape = newShape.addPropertyInternal(p);
771 }
772 return newShape;
773 }
774
775 @Override 755 @Override
776 public final int getPropertyCount() { 756 public final int getPropertyCount() {
777 return propertyCount; 757 return propertyCount;
778 } 758 }
779 759