String setSize/shrink fixes

Summary: Use shrink() instead of setSize() when there is a significant
chance of a large difference in the initial result.

Reviewed By: @markw65

Differential Revision: D1341786
Return Array()/String() instead of null_(foo)

Summary: To avoid global lookups, return Array() or String() instead of
the null_[array|string| respectively when dealing with Array or String
returns.

Reviewed By: @markw65

Differential Revision: D1343604
Make recordBCInstr less broken

Summary: It was trying to figure out where the code was by
looking at mcg->code.stubs(), which is wrong. The callsites
should always know the correct value though, so let them decide.

It turns out this is mostly dead anyway - only a handful of things
get recorded, and they're all in "a".

Closes #2712

Reviewed By: aravind

Differential Revision: D1342628
Don't try to inline if we are in pseudoMain

Reviewed By: @alexmalyshev

Differential Revision: D1343205
Adding -n CLI option to hhvm php mode

Summary: Adding -n option when --php is used in hhvm
Expected Behavior:
 When -n is used, the default config.hdf and php.ini files
 are not automagically loaded

 -c will load these files if -n is not specified, if it is,
 the -c option will only cause the specified files to load.

Reviewed By: @ptarjan

Differential Revision: D1290756
Targetting 3.2.0

Summary: 3.1.0 has been cut, trunk is now working towards 3.2

https://github.com/facebook/hhvm/commits/HHVM-3.1

Reviewed By: @JoelMarcey

Differential Revision: D1342745
Optimize away VerifyParamType of type aliases of primitive types

Summary: We know most of these from tracelet guards, so we can
optimize them away if they're persistent.

Reviewed By: @jdelong

Differential Revision: D1335987
Move getMemSize() out of the ArrayData private member-data section

Summary: We want to keep the data by itself at the end, so you can
easily tell how memory layout on these objects work.

Reviewed By: @mxw

Differential Revision: D1344706
Make ifaceofDirect more compact

Summary: All it cares about is whether or not the name exists in the map so it
can call IndexedStringMap::contains() instead of lookupDefault().

Reviewed By: @bertmaher

Differential Revision: D1340773
hphp/runtime/server/upload.cpp: fix "=" vs "==" assert typo

Summary: I caught a similar typo in a review an hour ago, so went searching
through all of fbcode for other occurrences of this type of error.

Coincidentally, I see that D1311333 has just gone in,
and it made some of the same changes I had made, but this
one still remains.

Reviewed By: @markw65

Differential Revision: D1342164
catch C-c on the client, do not crash hh_server

Summary: Thx to julien for helping finding this bug.
I should learn to use gdb on ocaml programs ... Shame on me.

Reviewed By: jcreed

Differential Revision: D1343318
reflection: interfaces implement themselves

Summary: ... this time accounting for non-canonical spellings of the
 interface name. Actually fixes #2716.

Reviewed By: @ptarjan

Differential Revision: D1343793
Convert ext/memcached to HNI

Summary: Part of #1480
Closes #2421

Reviewed By: @ptarjan

Differential Revision: D1339030

Pulled By: @JoelMarcey
Remove unused SetResultToRefWaitHandle

Summary: SetResultToRefWaitHandle is no longer used and it's trivial to implement
it using async function. Kill it.

Reviewed By: @jdelong

Differential Revision: D1344903
Add AUnused section

Summary: Add new AUnused section for code that is almost never called, or code
that will become dead. Use AUnused for stubs of profiling translations
and catch blocks. This should improve locality of live code in astubs.

Reviewed By: @ottoni

Differential Revision: D1327507
Rewrite spl_autoload() in PHP, support namespaces

Summary: - support namespaces
 - no need for it to be in C++
 - the C++ version didn't actually work when invoked via the autoloader or spl_autoload_call()

fixes facebook/hhvm#2729
fixes facebook/hhvm#2308

Reviewed By: @ptarjan

Differential Revision: D1344838
Enable HHIR guard relaxation for Optimize translations

Summary: This was almost working apparently.  This diff fixes a couple of bugs
and got this working again.

Profile translations are not relaxed, and thus types are never
specialized.  We can try that separately, but I'm thinking that it
might be best to specialize types based on profiling instead (as done
for ArrayGet).

Reviewed By: @swtaarrs

Differential Revision: D1342724
ReflectionClass::getTraitAliases returns "(null)" for trait name

Summary: ReflectionClass::getTraitAliases returns "(null)" for class name if trait name omitted in alias rule.
If you want details, please check #2577.

Closes #2606
Closes #2577

Reviewed By: @ptarjan

Differential Revision: D1314228

Pulled By: @JoelMarcey
make cmake work outsde of the main directory

Summary: Closes #1689

Reviewed By: @fredemmott

Differential Revision: D1343693
Remove O(N) element shifting from XLS::update()

Summary: the active and inactive lists are vectors, but the
order doesn't matter.  When removing, just copy down
the last element instead of shifting all elements.

Reviewed By: @ottoni

Differential Revision: D1344452