ReflectionFunctionAbstract should implement Reflector

Summary: In php5, `ReflectionFunctionAbstract` implements `Reflector` directly without forcing it's children classes to implement it.

Fixes #2649

Reviewed By: @fredemmott

Differential Revision: D1324938
Implement constant expressions in hhvm

Summary: PHP 5.6 allows constant expressions in the right side of `const` expressions instead of just scalars. This diff implements this feature in HHVM.

PHP RFC: https://wiki.php.net/rfc/const_scalar_exprs

Reviewed By: @jdelong

Differential Revision: D1290097
Disable LowPtr when asan is enabled

Summary: ASan will not put things in low memory.

Reviewed By: @scannell

Differential Revision: D1322000
Build system revamp (internal portion)

Summary: The external part of this revamp just affects the way we deal
with the build ID, see code comment for why. Bigger external revamp
planned once I get the internal stuff squared away.

Reviewed By: @ptarjan

Differential Revision: D1316920
Lookup both classes and type aliases before attempting to autoload either of them

Summary: And add tests for type alias resolution changes.

Reviewed By: @ptarjan

Differential Revision: D1321942

Pulled By: @jdelong
Add some traces so you can tell what the simplifier is doing

Summary: The simplifier refactoring seems to have lost the ability to
see what's going on with TRACE=hhr.  This doesn't really bring back
the whole thing, but at least makes sure you can see every instruction
that's genned and every instruction that's appended.

Reviewed By: @swtaarrs

Differential Revision: D1314238
Fix a bug in resolve_func_fallback when there is no function to resolve

Summary: It was assuming either the fallback or non-fallback name
would resolve, and didn't test for an empty range.  It handled the
edge-case where the name is found in both places, but not the case
where it's found in neither.  (We were hitting this on a use of
"array_map" inside of a namespace, because hhbbc doesn't analyze
systemlib's hhas unit right now, so array_map doesn't resolve.  The
path that resolves it outside of a namespace works correctly.)

Reviewed By: @scannell

Differential Revision: D1324431
hh_client --search. Improve result ranking

Summary: This is what we used to do in the IDE with Monocle results to make them more relevant, but I'm putting them here so anybody using search can benefit.

Ranking rules: (most important to least)
1. exact matches to the search should be at the top
2. case insensitive exact matches to the search should be next.
3. rank in this order:
  -- classes/funs
  -- typedefs
  -- everything else
4. alphabetical sort on key.

I implemented this in a compare function, so all we have to do is sort the results.

Reviewed By: @jwatzman

Differential Revision: D1325784
More extension smart_alloc conversions

Summary: More conversions to smart_malloc

Reviewed By: @edwinsmith

Differential Revision: D1323898
Remove TraceletCounters and TraceletCountersVec.

Summary: They're dead, can't find them being used with git grep.

Reviewed By: @jdelong

Differential Revision: D1320305
Merge pull request #2470 from tstarling/ezc-doc-persistent

EZC: document persistent array limitation
Merge branch 'fix-cmake-indent' of github.com:tstarling/hiphop-php into tstarling-fix-cmake-indent

Conflicts:
	CMake/HPHPFindLibs.cmake
Merge branch 'tstarling-fix-cmake-indent'
mark 'xhp' a valid extension

Summary: Fixes #2652

Reviewed By: @fredemmott

Differential Revision: D1325365
Disable test/slow/ext_socket/select_feof.php

Summary: It's flaky due to depending on timing.

Reviewed By: @alexmalyshev

Differential Revision: D1327920
fix behavior of headers_sent in CLI mode

Summary: Headers are considered to be sent if any body has been sent.

Fixes facebook/hhvm#2220

Reviewed By: @ptarjan

Differential Revision: D1325097
Enable collection buffer sharing for Map

Summary: This diff enables collection buffer sharing for Map. To enable buffer
sharing it was necessary to make some adjustments to how iterators work
for Maps.

Naively sprinkling calls to check for an immutable buffer at the beginning
every mutating method made things a bit inefficient, so I spent some time
to refactor some of the core operations such as add(), set(), grow(), and
reserve().

This diff is stacked on top of D1318651.

Reviewed By: @dariorussi

Differential Revision: D1324858
Make frame elision slightly more conservative

Summary: recurse.php was crashing because we were eliminating the DefInlineFP's
but not the SpillFrame's of the inlined recursive calls. These are
frames written to the stack but not linked into the AR chain. When the
unwinder tried to unwind from the eventual stack overflow fatal, it
would encounter these frames and try to unwind them as TVs.

What this diff does is to block the elision of any DefInlineFP if its
corresponding SpillFrame is used more than twice: once by the
DefInlineFP we're considering, and once by its corresponding
DefInlineSP.

I think this makes us slightly more conservative than we need to be -- I
believe it is valid sometimes to eliminate a DefInlineFP without
eliminating its corresponding SpillFrame, as long as we know there will
be no unwinding within the region where this gap exists.

Reviewed By: @jdelong

Differential Revision: D1326900
Implement ConcatN opcode

Summary: Introduces a ConcatN opcode for when we concatenate a small, fixed
number of strings, as well as IR ConcatStrN instructions for each
supported value of n.

As is, only HHBBC generates these, and currently only when all operands
are known to be strings.  The heuristic for the rewrites is very basic,
but should catch some common use cases.

As part of this implementation, we add a stack of "sources" to
HHBBC::State, which tracks the opcode that produced each value on the
evaluation stack.

Reviewed By: @jdelong

Differential Revision: D1281404
Fix configs for xhp tests

Summary: test/run doesn't look for hdfs anymore

Reviewed By: @fredemmott

Differential Revision: D1328240