We assume all flatMap body patterns have similar executon cost.
BaseCost: 1) base cost of Coll.flatMap PerChunkCost: 1) cost of Coll.flatMap (per item) 2) new collection is allocated for each item 3) each collection is then appended to the resulting collection
Cost of creating a collection of indices
Recognizer of flatMap
method calls with valid lambdas.
Operation descriptor for matching flatMap
method calls with valid lambdas.
This descriptors are instantiated once here and then reused.
The following SMethod instances are descriptors of methods defined in Coll
type.
This descriptors are instantiated once here and then reused.
Cost descriptor of Coll.zip operation.
Helper constructors.
Checks that the given MethodCall operation is valid flatMap.
This patterns recognize all expressions, which are allowed as lambda body of flatMap.
This patterns recognize all expressions, which are allowed as lambda body of flatMap. Other bodies are rejected with throwing exception.
Implements evaluation of Coll.flatMap method call ErgoTree node.
Implements evaluation of Coll.flatMap method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Lookup method by its id in this type.
Lookup method by its id in this type.
Looks up the method descriptor by the method name.
Looks up the method descriptor by the method name.
Implements evaluation of Coll.getOrElse method call ErgoTree node.
Implements evaluation of Coll.getOrElse method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Implements evaluation of Coll.indexOf method call ErgoTree node.
Implements evaluation of Coll.indexOf method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Implements evaluation of Coll.indices method call ErgoTree node.
Implements evaluation of Coll.indices method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Check the given expression is valid body of flatMap argument lambda.
Check the given expression is valid body of flatMap argument lambda.
id of lambda variable (see FuncValue.args)
expression with is expected to use varId in ValUse node.
true if the body is allowed
Implements evaluation of Coll.map method call ErgoTree node.
Implements evaluation of Coll.map method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Lookup method in this type by method's id or throw ValidationException.
Lookup method in this type by method's id or throw ValidationException. This method can be used in trySoftForkable section to either obtain valid method or catch ValidatioinException which can be checked for soft-fork condition. It delegate to getMethodById to lookup method.
getMethodById
List of methods defined for instances of this type.
List of methods defined for instances of this type.
Implements evaluation of Coll.patch method call ErgoTree node.
Implements evaluation of Coll.patch method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Class which represents values of this type.
Class which represents values of this type. When method call is executed, the corresponding method of this class is invoked via reflection java.lang.reflect.Method.invoke().
Helper descriptors reused across different method descriptors.
Type identifier to use in method serialization
Type identifier to use in method serialization
If this is SType instance then returns the name of the corresponding RType.
If this is SType instance then returns the name of the corresponding RType. Otherwise returns the name of type companion object (e.g. SCollection).
Implements evaluation of Coll.updateMany method call ErgoTree node.
Implements evaluation of Coll.updateMany method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Implements evaluation of Coll.updated method call ErgoTree node.
Implements evaluation of Coll.updated method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod
Implements evaluation of Coll.zip method call ErgoTree node.
Implements evaluation of Coll.zip method call ErgoTree node. Called via reflection based on naming convention.
SMethod.evalMethod