Check the basic block to be type correct and return the produced type stack.
A wrapper to route log messages to debug output also.
Apply the meet operator of the stack lattice on bl's predecessors.
Apply the meet operator of the stack lattice on bl's predecessors. :-). Compute the input to bl by checking that all stacks have the same length, and taking the lub of types at the same positions.
A couple closure creators to reduce noise in the output: when multiple items are pushed or popped, this lets us print something short and sensible for those beyond the first.
The presence of emptyStack means that path has not yet been checked (and may not be empty).
(iCodeChecker: StringAdd).self
(iCodeChecker: StringFormat).self
(iCodeChecker: ArrowAssoc[ICodeChecker]).x
(Since version 2.10.0) Use leftOfArrow
instead
(iCodeChecker: Ensuring[ICodeChecker]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
This class performs a set of checks similar to what the bytecode verifier does. For each basic block, it checks that:
- for primitive operations: the type and numer of operands match the type of the operation
- for method calls: the method exists in the type of the receiver and the number and type of arguments match the declared type of the method.
- for object creation: the constructor can be called.
- for load/stores: the field/local/param exists and the type of the value matches that of the target.
For a control flow graph it checks that type stacks at entry to each basic block 'agree':
1.0, 06/09/2005
Iulian says: I think there's some outdated logic in the checker. The issue with exception handlers being special for least upper bounds pointed out some refactoring in the lattice class. Maybe a worthwhile refactoring would be to make the checker use the DataFlowAnalysis class, and use the lattice trait. In the implementation of LUB, there's a flag telling if one of the successors is 'exceptional'. The inliner is using this mechanism.
,Better checks for
MONITOR_ENTER/EXIT
Better checks for local var initializations