Table-drive type checking for IR opcodes
commit795400d899d414ce52e552d7bcd2e6476b4f0ba4
authorjdelong <jdelong@fb.com>
Sun, 3 Feb 2013 23:18:10 +0000 (3 15:18 -0800)
committerSara Golemon <sgolemon@fb.com>
Mon, 11 Feb 2013 11:44:07 +0000 (11 03:44 -0800)
treef4a3fa032d9993de7ee354164a7ff1ab4b1f3eff
parent5483751a255271598c5bb31eb46191fe84977bd9
Table-drive type checking for IR opcodes

The way type.cpp was handling return types wasn't quite
sufficient for multiple destinations and unfortunately added a step
that's easy to forget when you add new opcodes with the HasDest flag.
Also, assertions about operand types are too distributed through the
code.  Pull everything into a central table, similar to hhbc.h.  This
still leaves several opcodes without type signatures, since figuring
it out got a bit tedious for now.  It did uncover a few documentation
bugs in ir.specification, though.
hphp/doc/ir.specification
hphp/runtime/vm/translator/hopt/codegen.cpp
hphp/runtime/vm/translator/hopt/codegen.h
hphp/runtime/vm/translator/hopt/ir.cpp
hphp/runtime/vm/translator/hopt/ir.h
hphp/runtime/vm/translator/hopt/type.cpp