Implements basic costing rule invocation mechanism.
Each MethodCall node of ErgoTree is costed using the same mechanism.
When MethodCall is matched during traverse of ErgoTree in RuntimeCosting.evalNode:
1) the type of the receiver object is used to lookup the corresponding CostingHandler
2) The apply method of CostingHandler is called to create the Coster
3) When Coster is created, the costing-rule-method is looked up using reflection and then invoked.
4) The result of costing-rule-method is returned as the result of MethodCall node costing.
Instances of this class are typically singleton objects (see below).
Implements basic costing rule invocation mechanism. Each MethodCall node of ErgoTree is costed using the same mechanism. When MethodCall is matched during traverse of ErgoTree in
RuntimeCosting.evalNode
: 1) the type of the receiver object is used to lookup the corresponding CostingHandler 2) The apply method of CostingHandler is called to create the Coster 3) When Coster is created, the costing-rule-method is looked up using reflection and then invoked. 4) The result of costing-rule-method is returned as the result of MethodCall node costing.Instances of this class are typically singleton objects (see below).
Coster