-
- Downloads
Reference counting for list elements
Lists can hold elements that are not in a consistent state with respect to the sharing model. However, such elements are put into consistent state once they are read from the list, their state can be inferred from the state of the owning list. This means that temporary elements can be freely put into lists without incrementing their ref-count. Moreover, when a list is copied into another variable or passed as an argument to a function, we only have to increment the ref-count of the list (no recursion needed). When accessing an element of a list, one should use ExtractListElement node, which handles the transition to consistent state. This must be used wherever the state matters: when returning the value as a result of a builtin, putting it into another list, putting it as an attribute, etc. On the other hand, when one only wants to peek at the value, but then forget the reference, it is OK to get it directly using getDataAt and similar methods.
Showing
- com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RASTBuilder.java 1 addition, 1 deletion...e.r.nodes/src/com/oracle/truffle/r/nodes/RASTBuilder.java
- com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedReplaceVectorNode.java 13 additions, 9 deletions...ruffle/r/nodes/access/vector/CachedReplaceVectorNode.java
- com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/ExtractListElement.java 119 additions, 0 deletions...cle/truffle/r/nodes/access/vector/ExtractListElement.java
- com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/WriteIndexedVectorNode.java 18 additions, 9 deletions...truffle/r/nodes/access/vector/WriteIndexedVectorNode.java
- com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/opt/ReuseNonSharedNode.java 7 additions, 12 deletions...acle/truffle/r/nodes/function/opt/ReuseNonSharedNode.java
- com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/opt/ShareObjectNode.java 59 additions, 0 deletions.../oracle/truffle/r/nodes/function/opt/ShareObjectNode.java
- com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RExpression.java 2 additions, 1 deletion...me/src/com/oracle/truffle/r/runtime/data/RExpression.java
- com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RListBase.java 28 additions, 5 deletions...time/src/com/oracle/truffle/r/runtime/data/RListBase.java
- com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RShareable.java 6 additions, 0 deletions...ime/src/com/oracle/truffle/r/runtime/data/RShareable.java
- com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RSharingAttributeStorage.java 1 addition, 0 deletions...acle/truffle/r/runtime/data/RSharingAttributeStorage.java
- com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/model/RAbstractContainer.java 5 additions, 0 deletions...acle/truffle/r/runtime/data/model/RAbstractContainer.java
- com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test 6 additions, 0 deletions...est/src/com/oracle/truffle/r/test/ExpectedTestOutput.test
- com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/base/TestSimpleLists.java 1 addition, 0 deletions...m/oracle/truffle/r/test/library/base/TestSimpleLists.java
Loading
Please register or sign in to comment