- ECMAScript standard library
- JQuery
- React
- …
- Remove unused/unlikely branches.
- Use content code as guard.
- Improve (Alias / Escape) Analysis results.
function ArrayIteratorNext() {
if (!IsObject(this) || !IsArrayIterator(this)) {
return callFunction(CallArrayIteratorMethodIfWrapped,
this, "ArrayIteratorNext");
}
var result = { value: undefined, done: false };
…
return result;
}
Acceptable, If and only if:
We would need some heuristics.
- Unreachable
- Should Bailout
- Not entry/OSR block
- Predecessor is hot.
- Has some alias set.
- Number of dominated instructions / blocks.
- A return is cheaper than a bailout.
- Improve other optimizations:
- for-of (Scalar Replacement)
- underscore uniq function (LICM)
- Reduce generated code (~23%)