Fix multiple declarations of the same static variable in closures

If there are multiple StaticStatements with initialization in a closure,
multiple entries for the same static variable are created in the
Func's m_staticVars table, breaking this closure assertion:

hhvm: hphp/runtime/ext/ext_closure.cpp:59: void HPHP::c_Closure::init(int, HPHP::ActRec*, HPHP::TypedValue*): Assertion `numDeclProperties - numArgs == m_func->numStaticLocals()' failed.

Reviewed By: @jdelong

Differential Revision: D1202452
Fix bug with c_Vector::getImmutableCopy()

In some cases c_Vector::getImmutableCopy() calls objMallocLogged() to
allocate 0 bytes, which is wrong. This diff fixes the bug.

Reviewed By: @elgenie

Differential Revision: D1203592
Fix bug in Vector::slice()

In some cases Vector::slice() was calling objMallocLogged() to allocate 0
bytes, and this was causing HHVM to crash.

This diff patches the implementation of Vector::slice() appropriately to
fix the bug.

Reviewed By: @elgenie

Differential Revision: D1203527
Register-allocate constants, eliminate LdConst.

Adds a helper (coupled with code-gen) so the register allocator
knows whether CodeGenerator requires, or allows, a particular
operand to be an immediate (DefConst).  If not, allocate a register
like any other operand.

Reviewed By: @jdelong

Differential Revision: D1151019
Fix array function to take the same args as Zend

- I guess this functions took a bool before but Zend changed.
- Found this in my work of making stdlib use user calling convension

Reviewed By: @ptarjan

Differential Revision: D1195379
Disable flaky zend test

Reviewed By: @bertmaher
Temporarily disable flaky test

This is probably a real bug so we need to get it figured out, but this
will cut down on contbuild noise while we debug.

Reviewed By: @bertmaher

Differential Revision: D1203918
Fix tests

- This fixes type errors that would happen if I turn on user calling convension for systemlib

Reviewed By: @ptarjan

Differential Revision: D1195543
Fix some tracelet region selector stuff

When an inlined FCall has its output marked as predicted, analyze
handles it as though the call weren't inlined, so it ends up predicting the
output type of the inlined call. Since NormalizedInstructions aren't persistent
in selectTracelet, keep track of the return type prediction, if any, when
entering an inlined call.

Get rid of the unused startSk argument from outputIsPredicted.

Reviewed By: @ottoni

Differential Revision: D1199827
Clean the list of shutdown handlers even if they fail

If a shutdown handler fails (fatal, time/memory limit exceeded, etc.),
the list of shutdown handlers is not cleared.

This is normally not a big deal, since shutdown handlers are invoked as
the last thing before destroying ExecutionContext. However, in the RPC
case, the same ExecutionContext is reused across multiple RPC requests
and the same failed shutdown handler is then executed again after the
next (unrelated) RPC request. This previously failed shutdown handler is
likely to fail again and keep failing until ExecutionContext is
reinitialized.

Reviewed By: @markw65

Differential Revision: D1202917
Enable memory safety for QuickLZ

qlzuncompress can segfault the VM if you pass it bad data.
Enabling memory safety lets us return false on failure instead of
crashing, and I couldn't tell much of a perf difference in
microbenchmarks.

Reviewed By: @ptarjan

Differential Revision: D1201487
Array comparisons need a catch block

They can throw if you try to compare recursively defined
arrays.

Reviewed By: @edwinsmith

Differential Revision: D1202144
Move UTEXT_CURRENT32 macro higher up

Need to define it before you use it. :)

Reviewed By: @scannell

Differential Revision: D1203526
Fix Redis->hMGet() response handler

Response lines are BULK encoded.

  $len
  data

and not plain lines.

Closes #1277

Reviewed By: @ptarjan

Differential Revision: D1203579
Enable QuickLZ