In TransProfile mode, only do HHIR guard relaxation with tracelet region selector

In TransProfile mode, we can only relax the guards in tracelet region
mode.  If the region came from analyze() and we relax the guards here,
then the RegionDesc's TypePreds in ProfData won't accurately reflect
the generated guards.  This can result in a TransOptimze region to be
formed with types that are incompatible, e.g.:

    B1: TypePred: Loc0: Bool      // but this gets relaxed to Uncounted
        PostCond: Loc0: Uncounted // post-conds are accurate
    B2: TypePred: Loc0: Int       // this will always fail

Reviewed By: @swtaarrs

Differential Revision: D1197001
Rename getValFoo to fooVal()

we've been de-get-ifying the JIT code in general, and this way
the SSATmp helper methods match the corresponding Type methods.

Reviewed By: @swtaarrs

Differential Revision: D1203821
Fix CodeModel output for elseif conditionals

If a conditional statement had `elseif` instead of `else if` in the chain, the
CodeModel output didn't handle this case at all.

This fixes 3 separate errors:

* Vector property header was being printed to stdout due to usage of `printf`
  instead of `cg.printf`
* Blocks were being closed before the final falseBlock property was output.
* Each iteration after the first one opened 2 objects and a vector, but the
  closing loop only closed 1 object and the vector, leading to knock-on errors

Reviewed By: @hermanventer

Differential Revision: D1204069

Pulled By: @fredemmott
Fix JIT bug with ContSuspendK

ContSuspendK cares about the type of newKey, but the type of newKey wasn't
being constrained properly when hhir guard relaxation was enabled. This
diff fixes the issue.

Reviewed By: @swtaarrs

Differential Revision: D1203698
Zend incompatibility fix: ReflectionParameter's function name should accept closure

Closes [[ https://our.intern.facebook.com/l.php?h=nAQFFZh_1&u=https%3A%2F%2Fgithub.com%2Ffacebook%2Fhhvm%2Fissues%2F1358 | #1358]]
Fixed ReflectionParameter's construct function to accept closure

Reviewed By: @ptarjan

Differential Revision: D1179989
Anchor an extension entry for redis

This is a short-term solution for extensions which
we implement entirely in PHP.

Long term, I'd like to have a UA or declare meta to register
the extensions from slib.

Closes #1481

Reviewed By: @ptarjan

Differential Revision: D1204161
Remove constant-folding from CodeGenerator

Now since register allocation can put values into registers
as needed, there is no need for CodeGenerator to do constant
folding even if we disable simplifier.

Reviewed By: @ottoni

Differential Revision: D1198490
Use a higher precision when serializing doubles

We using a static precision of 14 for doubles for all modes in
VariableSerializer. This matches Zend's default var_dump() output, it
isn't enough to actually store a double, breaking
serialize()/unserialize().

Reviewed By: @swtaarrs

Differential Revision: D1202707
Implement ICU Message Formatter

Matching Zend

Reviewed By: @ptarjan

Differential Revision: D1203497
Tune HHIR guard relaxation

I compared the cases in which guards were relaxed in both HHBC and
HHIR guard relaxations, and then changed a number cases where HHIR
guard relaxation was being more aggressive to match HHBC's
implementation.

Reviewed By: @swtaarrs

Differential Revision: D1203964
Remove almost all of the old-style assembler API

There's not very much uses left now, so it wasn't too bad to
remove everything except conditional load and move.  You can't make
movq overload RegXMM and Reg64 right now because PhysReg has an
implicit conversion to RegXMM also, so those still have some name
mangling.  (Are they really movq instructions---maybe we should name
them something else.)

Reviewed By: @edwinsmith

Differential Revision: D1198328
Implement BitNot with BitXor

This makes HHIR slightly more canonical and eliminates one more
opcode we have to maintain/port.

Reviewed By: @alexmalyshev

Differential Revision: D1204092
Rename arithemtic ops for consistency.

<op><type> is the target style, which most arithmetic ops in HHIR
already use.  This diff renames the stragglers:
LogicalXor => XorBool
BitAnd     => AndInt
BitOr      => OrInt
BitXor     => XorInt

Reviewed By: @alexmalyshev

Differential Revision: D1204341
CGetL; FPushObjMethod marks local as object

Reviewed By: @jdelong

Differential Revision: D1182730
Raise an error from trigger_error if invalid error type specified

PHPUnit's test suite checks for this.

refs #1904

Reviewed By: @ptarjan

Differential Revision: D1201517
Make DateTime implement DateTimeInterface (PHP 5.5.0)

Precursor to implementing DateTimeImmutable, which is used by Twig.

Reviewed By: @ptarjan

Differential Revision: D1201828
Add __SystemLib_ChunkedInflator class

Will allow a pure-PHP implementation of the zlib.inflate filter

Reviewed By: @ptarjan

Differential Revision: D1199799
Fix an overflow issue with Vector::slice()

In some cases where the 'len' parameter was really big (ex. PHP_INT_MAX),
the math performed by Vector::slice() could overflow and cause HHVM to
crash. This diff fixes the math so that it doesn't overflow. It also cleans
up the implementation and gets rid of ImmVector::slice() (since the static
slice() methods are deprecated).

Reviewed By: @elgenie

Differential Revision: D1203723
Break sync() dependency between Translator and TranslatorX64.

Replace Translator's pure virtual sync() with non-virtual implementation
that calls a helper function, in order to remove a dependency between
Translator and TranslatorX64.

Reviewed By: @jdelong

Differential Revision: D1203224
Break traceCodeGen() dependency between Translator and TranslatorX64.

Remove Translator's pure virtual traceCodeGen(), make TranslatorX64's
traceCodeGen() public, and add a helper function to call
tx64->traceCodeGen() from Translator, in order to remove a dependency
between Translator and TranslatorX64.

Reviewed By: @jdelong

Differential Revision: D1203225