Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public class EvaluationStrategies {
/** A parameter or return of a function passed by value which means a flat copy is used */
public static final String BY_VALUE = "BY_VALUE";

/** A parameter of a function passed by value whose copy shares nothing with the argument: it holds no pointer or reference, so the callee cannot change the argument */
public static final String BY_COPY = "BY_COPY";

public static Set<String> ALL = new HashSet<String>() {{
add(BY_REFERENCE);
add(BY_SHARING);
add(BY_VALUE);
add(BY_COPY);
}};

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ object Properties {
* strategy, which is one of the following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2)
* `BY_VALUE` indicates that it is passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a
* pointer/reference and it is shared with the caller/callee. While a copy of the pointer is made, a copy of the
* object that it points to is not made.
* object that it points to is not made, 4) `BY_COPY` indicates that it is passed by value and the copy shares
* nothing with the argument, so the callee cannot change the argument.
*/
val EvaluationStrategy =
flatgraph.SinglePropertyKey[String](kind = 17, name = "EVALUATION_STRATEGY", default = "<empty>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ object PropertyNames {
* strategy, which is one of the following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2)
* `BY_VALUE` indicates that it is passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a
* pointer/reference and it is shared with the caller/callee. While a copy of the pointer is made, a copy of the
* object that it points to is not made.
* object that it points to is not made, 4) `BY_COPY` indicates that it is passed by value and the copy shares
* nothing with the argument, so the callee cannot change the argument.
*/
val EvaluationStrategy: String = "EVALUATION_STRATEGY"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ object ClosureBinding {
* parameters, output parameters, and return parameters, this field holds the evaluation strategy, which is one of the
* following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2) `BY_VALUE` indicates that it is
* passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made.
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made, 4)
* `BY_COPY` indicates that it is passed by value and the copy shares nothing with the argument, so the callee cannot
* change the argument.
*/
class ClosureBinding(graph_4762: flatgraph.Graph, seq_4762: Int)
extends StoredNode(graph_4762, 8, seq_4762)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ object MethodParameterIn {
* parameters, output parameters, and return parameters, this field holds the evaluation strategy, which is one of the
* following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2) `BY_VALUE` indicates that it is
* passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made.
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made, 4)
* `BY_COPY` indicates that it is passed by value and the copy shares nothing with the argument, so the callee cannot
* change the argument.
*
* ▸ Index (Int); Cardinality `one` (mandatory with default value `-2`); Specifies an index, e.g., for a parameter or
* argument. Explicit parameters are numbered from 1 to N, while index 0 is reserved for implicit self / this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ object MethodParameterOut {
* parameters, output parameters, and return parameters, this field holds the evaluation strategy, which is one of the
* following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2) `BY_VALUE` indicates that it is
* passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made.
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made, 4)
* `BY_COPY` indicates that it is passed by value and the copy shares nothing with the argument, so the callee cannot
* change the argument.
*
* ▸ Index (Int); Cardinality `one` (mandatory with default value `-2`); Specifies an index, e.g., for a parameter or
* argument. Explicit parameters are numbered from 1 to N, while index 0 is reserved for implicit self / this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ object MethodReturn {
* parameters, output parameters, and return parameters, this field holds the evaluation strategy, which is one of the
* following: 1) `BY_REFERENCE` indicates that the parameter is passed by reference, 2) `BY_VALUE` indicates that it is
* passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made.
* the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made, 4)
* `BY_COPY` indicates that it is passed by value and the copy shares nothing with the argument, so the callee cannot
* change the argument.
*
* ▸ LineNumber (Int); Cardinality `ZeroOrOne` (optional); This optional field provides the line number of the program
* construct represented by the node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ object CallGraph extends SchemaBase {
|`BY_VALUE` indicates that it is passed by value, that is, a copy is made,
|3) `BY_SHARING` the parameter is a pointer/reference and it is shared with
|the caller/callee. While a copy of the pointer is made, a copy of the object
|that it points to is not made.
|that it points to is not made, 4) `BY_COPY` indicates that it is passed by
|value and the copy shares nothing with the argument, so the callee cannot
|change the argument.
|""".stripMargin
)
.mandatory(PropertyDefaults.String)
Expand All @@ -118,7 +120,14 @@ object CallGraph extends SchemaBase {
value = "BY_VALUE",
valueType = ValueType.String,
comment = "A parameter or return of a function passed by value which means a flat copy is used"
).protoId(ProtoIds.ByValue)
).protoId(ProtoIds.ByValue),
Constant(
name = "BY_COPY",
value = "BY_COPY",
valueType = ValueType.String,
comment =
"A parameter of a function passed by value whose copy shares nothing with the argument: it holds no pointer or reference, so the callee cannot change the argument"
).protoId(ProtoIds.ByCopy)
)

methodParameterIn.addProperties(evaluationStrategy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ object ProtoIds {
val Order = 4
val Do = 4
val CSharp = 4
val ByCopy = 4
val Abstract = 5
val Annotation = 5
val For = 5
Expand Down