Skip to content

Commit

Permalink
[Truffle] Better parameter names in ShareInternalFieldsNode.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Nov 28, 2016
1 parent d34b151 commit b0beb30
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -39,23 +39,23 @@ public ShareInternalFieldsNode(int depth) {
public abstract void executeShare(DynamicObject object);

@Specialization(
guards = { "object.getShape() == cachedShape", "isArrayShape(cachedShape)", "isObjectArray(object)" },
guards = {"array.getShape() == cachedShape", "isArrayShape(cachedShape)", "isObjectArray(array)"},
assumptions = "cachedShape.getValidAssumption()", limit = "CACHE_LIMIT")
protected void shareCachedObjectArray(DynamicObject object,
@Cached("object.getShape()") Shape cachedShape,
protected void shareCachedObjectArray(DynamicObject array,
@Cached("array.getShape()") Shape cachedShape,
@Cached("createWriteBarrierNode()") WriteBarrierNode writeBarrierNode) {
final int size = Layouts.ARRAY.getSize(object);
final Object[] store = (Object[]) Layouts.ARRAY.getStore(object);
final int size = Layouts.ARRAY.getSize(array);
final Object[] store = (Object[]) Layouts.ARRAY.getStore(array);
for (int i = 0; i < size; i++) {
writeBarrierNode.executeWriteBarrier(store[i]);
}
}

@Specialization(
guards = { "object.getShape() == cachedShape", "isArrayShape(cachedShape)", "!isObjectArray(object)" },
guards = {"array.getShape() == cachedShape", "isArrayShape(cachedShape)", "!isObjectArray(array)"},
assumptions = "cachedShape.getValidAssumption()", limit = "CACHE_LIMIT")
protected void shareCachedOtherArray(DynamicObject object,
@Cached("object.getShape()") Shape cachedShape) {
protected void shareCachedOtherArray(DynamicObject array,
@Cached("array.getShape()") Shape cachedShape) {
/* null, int[], long[] or double[] storage */
}

Expand Down

0 comments on commit b0beb30

Please sign in to comment.