Disentangle the typeParam of CheckType, CheckStk instructions
commitc85ddf2ce29f07aacb881f26dda5653894d5542a
authorGuilherme Ottoni <ottoni@fb.com>
Fri, 28 Feb 2014 03:26:19 +0000 (27 19:26 -0800)
committerSara Golemon <sgolemon@fb.com>
Fri, 28 Feb 2014 20:02:16 +0000 (28 12:02 -0800)
tree5a53cf35ececac707ad44672ea7062f661099994
parentd6fcd5cd19b2d27e3faa2253603c085cab6d0421
Disentangle the typeParam of CheckType, CheckStk instructions

The typeParam of these instructions was serving two different
purposes: (1) specifying what needs to be checked at runtime; (2) the
type of its dest operand.  This had some undesirable consequences: it
could either result in more expensive checks to be generated (for
which D1186725 added a partial workaround), or cause type information
to be lost (which is the problem that D1186725 was trying to solve).

This diff disentagles the two purposes of the typeParam of CheckStk
and CheckType instructions by adding a new dest type macro that
"filters" the source operand's type using the typeParam (ie,
intersects the two).  This way, the typeParam of these instructions
again specifies the exact type check that they perform, but still
allows information about the source operand to be preserved.

Reviewed By: @swtaarrs

Differential Revision: D1193637
hphp/runtime/vm/jit/code-gen-x64.cpp
hphp/runtime/vm/jit/code-gen-x64.h
hphp/runtime/vm/jit/guard-relaxation.cpp
hphp/runtime/vm/jit/ir.cpp
hphp/runtime/vm/jit/ir.h
hphp/runtime/vm/jit/simplifier.cpp
hphp/runtime/vm/jit/type.cpp