One optimization that SAFECode currently lacks is a redundant check elimination pass. If there are two checks of the same type (e.g., a fastlscheck) and one of the checks is redundant, then SAFECode should remove one of the checks.
This optimization can be a little trickier than it initially looks. Load/store checks on heap objects must ensure that the heap object cannot be freed in-between the two checks. GEP checks and load/store checks have different semantics, so a special GEP check may be needed when the GEP check makes a load/store check redundant.
Extended Description
One optimization that SAFECode currently lacks is a redundant check elimination pass. If there are two checks of the same type (e.g., a fastlscheck) and one of the checks is redundant, then SAFECode should remove one of the checks.
This optimization can be a little trickier than it initially looks. Load/store checks on heap objects must ensure that the heap object cannot be freed in-between the two checks. GEP checks and load/store checks have different semantics, so a special GEP check may be needed when the GEP check makes a load/store check redundant.