Revert "Remove deprecated ShouldSelfOptimize machinery."

This reverts commit 9da92c1a336e because of performance regressions.

R=danno@chromium.org

Review URL: https://codereview.chromium.org/752613002

Cr-Commit-Position: refs/heads/master@{#25467}