Switch-related cleanup
commitbec1573ef2b36c4c24aba13b3c8823b477b5a03c
authorBrett Simmers <bsimmers@fb.com>
Fri, 29 May 2015 04:57:35 +0000 (28 21:57 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Fri, 29 May 2015 05:30:44 +0000 (28 22:30 -0700)
tree657804f0d93812fb7c0a0d58bf890cc4c92bfca7
parentec01d05f374087d5f2222314f085cf3c8dba1fd3
Switch-related cleanup

Summary: - Use an enum instead of an IVA for the Bounded bytecode immediate.
- Move constant src optimizations for JmpSwitchDest from codegen to
  simplifier.
- Do base subtraction with SubInt hhir instruction rather than in JmpSwitchDest
  codegen, and remove base member from JmpSwitchData.
- Remove StkPtr phi stuff from getBlock(). We haven't merged StkPtrs in a long
  time and aren't going to start again.
- Use getBlock() instead of makeExit() in emitSwitch() to prepare for the
  destinations possibly being in the current region.

Codegen should be unaffected by all of this, since we still break regions at
Switch.

Reviewed By: @jdelong

Differential Revision: D2104092
16 files changed:
hphp/compiler/analysis/emitter.cpp
hphp/doc/bytecode.specification
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/hhbc.cpp
hphp/runtime/vm/hhbc.h
hphp/runtime/vm/jit/code-gen-x64.cpp
hphp/runtime/vm/jit/extra-data.h
hphp/runtime/vm/jit/irgen-control.cpp
hphp/runtime/vm/jit/simplify.cpp
hphp/runtime/vm/jit/vasm-llvm.cpp
hphp/runtime/vm/jit/vasm-x64.cpp
hphp/runtime/vm/verifier/check_func.cpp
hphp/test/quick/asm_fault.hhas
hphp/test/quick/asm_switch.hhas
hphp/test/slow/switch_statement/constant-input.php [new file with mode: 0644]
hphp/test/slow/switch_statement/constant-input.php.expect [new file with mode: 0644]