Optimize switches operating on constant inputs.

Motivated by finding something close to this in a optimized build:
function r() {
  switch (0) { // This means that only case 0 is live
    case 0: return 'value1 message';
    case 1: return 'value2 message';
  }
  return null
}

After the change, this becomes:
function r() {
  return 'value1 message';
}

Change-Id: I164f14546da9bb5c6a0277f200fa85045090a000
Review-Link: https://gwt-review.googlesource.com/#/c/7640/
3 files changed