Only generate profiling translations after JitProfileRequests for functions that are already being profiled

Otherwise, for functions that we never saw during the first
Eval.JitProfileRequest requests, we'll generate profiling translations
that never get retranslated.

Reviewed By: aravind

Differential Revision: D1104276
Only consider classes that are final for specialization

That's a requirement from how we generate specialized guards, so don't
even let non-final classes enter into the type system.

Reviewed By: aravind

Differential Revision: D1109309
Move next edge from Block to IRInstruction

It's more precise to put the next edge on IRInstrution than on Block.
The current setup made it easier to add edges into the IR in general,
but this finally puts them where they should go.  This diff also
cleans a few things up: Edge now has an instruction field, which
avoids the need to set Edge.m_from whenever an instruction's block
changes; Edges are allocated separately, and only for instructions
that need them, which reduces sizeof IRInstruction by 16 bytes.
Every block must now end with a control flow instruction, even if it's
just a jmp to a next block.  Unnecessary jumps should already be
removed at code-gen time.

This diff also adds a Branch flag.  Any instruction that could have
an edge must have either the Branch flag or MayRaiseError flag, in
which case m_edges is never null (but Edge::to could be null).
Other instructions must have m_edges == null.  Because of this, it
was necessary to factor the compare instructions into the ones that
throw, with MayRaiseError set plus a catch edge, and ones that don't,
with no edges.

Reviewed By: @jdelong

Differential Revision: D1109820
Fix redis' zRange and zRevRange

The commands zRange and zRevRange on redis weren't working. Since its
arguments are being passed to the command as an array, we must call
`processArrayCommand()` instead of `processCommand()`.

Reviewed By: @ptarjan

Differential Revision: D1111425
actually send the response code

Closes #1416

Reviewed By: @sgolemon

Differential Revision: D1111910
Fix bugs in serialization of HHVM parse trees as PHP Code Model.

Remove left parentheses that survived edits and evolution. Fix the serialization of a simple function call to use the original function name. Make printExpressionVector treat a null list as an empty list. Use the original (scanned) string value when serializing scalar values. Make StaticClassName::outputCodeModel produce properly serialized strings (i.e. with headers). Use printStatementVector instead of just serializing each element of the vector in sequence. Adjust property counts to take into account null values. Tweak serialization of if statements to better deal with empty true blocks.

Reviewed By: duv

Differential Revision: D1097296
Fix preg_match returning false instead of null

preg_match/preg_match_all should return NULL not FALSE when invalid flags are passed.

Closes #1442

Reviewed By: @alexmalyshev

Differential Revision: D1111983

Pulled By: @scannell
Fix INI file typo

Fix INI file typo

Closes #1450

Reviewed By: @alexmalyshev

Differential Revision: D1112190
Fix OOM while compiling mongo extension

gcc using all memory when compiling mongo/cursor.cpp

Closes #1414
Closes #1427

Reviewed By: @elgenie

Differential Revision: D1110301

Pulled By: @scannell
Move FrozenSet to the HH namespace.

As per the title.

Reviewed By: @elgenie

Differential Revision: D1105025
move trait alias modifier validation to parser ...

* remove a few places where we were attempting to do a modifier check
   at trait flattening time (badly?) and at class* time (waaay too late)
 * fix the glaring hole where 'visibility' modifier was interpreted as
   'not `static`' as opposed to ##public|private|protected|final## due to the way
   hphp.y happened to reuse modifiers

Reviewed By: @ottoni

Differential Revision: D1111920
Don't expose doc comments of builtins through Reflection

Zend doesn't have doc comments for its builtins, so
Reflection{Method,Function,Class,Property}::getDocComment() will just
return false, but we have doc comments in systemlib/php and we return
those. Turns out this breaks Symfony, as they parse their own code and
then try to match their doc comments with those of Reflection, but throw
an exception when they fly up the interfaces on one of their classes and
hit ArrayAccess, which they never parsed doc comments for.

Reviewed By: @ptarjan

Differential Revision: D1106653
Ignore traces in eliminateUnconditionalJump()

This lays the groundwork for general jump optimizations and removes
the IRTrace dependency from eliminateUnconditionalJump().  Now we
traverse all blocks in postorder; two blocks joined by a trivial Jmp
can coalesced together.

Reviewed By: @ottoni

Differential Revision: D1111166
Ignore traces in optimizeSideExitJccs()

Refactor optimizeSideExitJcc into the postorderWalk traversal.
We don't need to look at traces at all for this to work.

Reviewed By: @jdelong

Differential Revision: D1111176
Ignore traces in optimizeSideExitCheck()

Refactor optimizeSideExitCheck() into the postorder walk.  We were
visiting every instruction before, we really only need to visit
the last instruction of each block, and we can do it in the same
walk as the other jump optimizations.

Reviewed By: @ottoni

Differential Revision: D1111447
Filter systemlib-like units out of hhbbc for now

Reviewed By: @elgenie

Differential Revision: D1111801
Ignore traces in optimizeCondTraceExit

Same pattern as optimizeSideExitCheck.

Reviewed By: @ottoni

Differential Revision: D1111457
Visit all blocks when splitting critical edges.

Before we only were looking at blocks on the main trace.  This diff
removes the trace dependency, but still adds the middle-blocks to the
trace that owns the from-block.

Reviewed By: @ottoni

Differential Revision: D1111948
Actually implement imagefilter()

imagefilter was using a function table filled with functions that just
threw NotSupportedException. Fixed them.

Reviewed By: @elgenie

Differential Revision: D1111814
Fix callable typehint

The lexer and parser didn't know anything about the callable keyword,
and it was causing typehint errors when callable was being used inside a
namespace N, and the resulting typehint turned into "N\callable". Add
T_CALLABLE token to match zend, and fix TypeConstraint to respect it.

Reviewed By: @elgenie

Differential Revision: D1112493