Skip to content
Snippets Groups Projects
Commit 1826c2ab authored by Lukas Stadler's avatar Lukas Stadler
Browse files

Merge pull request #162 in G/fastr from...

Merge pull request #162 in G/fastr from ~STEPAN.SINDELAR_ORACLE.COM/fastr:bugfix/refcounting-lists to master

* commit '55fc122f':
  Avoid copying of temporary data when assigning to a list
parents 75899d97 55fc122f
No related branches found
No related tags found
No related merge requests found
......@@ -498,12 +498,14 @@ final class CachedReplaceVectorNode extends CachedVectorNode {
return returnVector;
}
private final ConditionProfile rightIsNotTemporary = ConditionProfile.createBinaryProfile();
private RTypedValue copyValueOnAssignment(RTypedValue value) {
if (value instanceof RShareable && value instanceof RAbstractVector) {
RShareable val = (RShareable) value;
if (rightIsShared.profile(val.isShared())) {
val = val.copy();
} else {
} else if (rightIsNotTemporary.profile(!val.isTemporary())) {
val.incRefCount();
}
return val;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment