Only enable ahot in RepoAuthoritative mode

In sandbox mode, files change, and we could translate
potentially unlimited numbers of functions into ahot.

Reviewed By: @swtaarrs

Differential Revision: D1079214
Reimplement str_getcsv in C++

I originally wrote a hacky str_getcsv with that used fgetcsv() + temp
files in PHP to stop fatals in open source land. This fixes the perf
issues with the old implementation by not using files at all.

Closes #1079

Reviewed By: @scannell

Differential Revision: D999569
ReflectionParameter works with parameters index instead of name

So it turns out ReflectionParameter::__construct(string, string) can
also be written as ReflectionParameter::__construct(array, string) and
the now supported ReflectionParameter::__construct(array, int).

Reviewed By: @ptarjan

Differential Revision: D1068773
Add PageletServerTaskEvent.

Move PageletTransport definition in pagelet-server.h and create PageletServerTaskEvent to be used for integration with Asio.

Reviewed By: @jano

Differential Revision: D1069174
Implement password extension

This uses @ircmaxell's password_compat library to implement the
password extension on top of the underlying crypt functions.

Closes #992
Closes #1303

Reviewed By: @ptarjan

Differential Revision: D1078315

Pulled By: @scannell
Use macros in place of explicit iop*() arguments

This allows us to easily (and conditionally) add additional arguments.

Reviewed By: @jano

Differential Revision: D1075399
Convert IsTypeOp to an enum class

Also name the types more like other type names (in both
JIT::Type and HHBBC) for macro-friendliness, and remove default cases
from switches so we'll find places that need to be updated when we add
new cases to the enum.

Reviewed By: aravind

Differential Revision: D1079271
Update hhbbc for the IsType subobcode change

Just adds a function mapping from IsTypeOp to the type
opcodes.

Reviewed By: aravind

Differential Revision: D1079276
Reorder IsTypeL arguments to match other LA,OA pairs

It's arguable that maybe OA,LA would be a nicer order, but
all the other opcodes that have both subops and a LA take them in the
LA,OA order.  (In general, it appears OA always comes last unless
there is an MA, right now.)  Also remove unused isTypePred thing.

Reviewed By: @swtaarrs

Differential Revision: D1079371
Get ARM mode passing again

quick, slow, and zend/good almost all pass with this diff, after a bunch of
lockdown breakage. I say "almost" because strtotime_leak.php still
fails. I believe that's a consequence of interp'ing everything, although
there may be a real memory leak there. I'll deal with that in an
upcoming diff.

- Since InterpOne has catch traces now, we can't punt on BeginCatch and
  EndCatch anymore. It seems that for the time being, we can skate by
  without actually implementing catch traces, though. The stack is
  always spilled before InterpOne, and because everything is InterpOne'd
  we're not actually holding anything in registers (so we don't need to
  restore them).

- NewStructArray wasn't accounted for in all places in translator.cpp.

- I reduced the amount of work that mixedbag.php does, so that it
  completes in a reasonable amount of time in ARM mode. It's still
  executing all the same code, just fewer times.

Reviewed By: @jdelong

Differential Revision: D1080648
Put HHVM_ARCH in $_ENV, use it to skip strtotime_leak.php

In the interest of maintaining by sanity by getting automated testing
for ARM mode set up ASAP, I'm putting off (and tasking) figuring out
what's going on with strtotime_leak.php in ARM mode. I added something
to $_ENV that allows PHP code to check what arch it's running as, and
we'll skip strtotime_leak.php if we're in ARM mode.

As part of this, I pulled arch() into its own header file to avoid
including translator-inline.h from the files where the env vars are set
up (it didn't seem right).

Reviewed By: @jdelong

Differential Revision: D1080752
Fix for code smell reported by Robert Henry

Robert, an old friend, found a bug in our code.

Reviewed By: @markw65

Differential Revision: D1080348
Stop invalid Pipe objects from always asserting in dtor

Pipe::closeImpl did not have a good check for whether the pipe needed
closing. Fix that, and add the warning that zend prints on invalid args
to popen()

Closes #1313

Reviewed By: @scannell

Differential Revision: D1079485
Remove extra realloc/NULL termination from LibEventTransport

All callers of getPostData use the size arg correctly.  I tried searching the git history for why this was ever done, and it goes back to before when hphp was moved from svn to git in 2008.

Reviewed By: @markw65

Differential Revision: D1073159
Give a better error message when hhas systemlib is broken

Reviewed By: @alexmalyshev

Differential Revision: D1079598
Fix bugs in Set::map

There were two problems with Set::map():

  * the return type of the callback was not being checked, so we could
    end up with a Set of a type other than int or string.

  * we also weren't checking for duplicates -- so, for instance, calling
    map with a constant function (constant in the mathematical sense)
    would give us back a set with repeated elements.

Fix the two points above by making Set::map() use the regular add()
operation (which automagically takes care of everything).

Reviewed By: @paroski

Differential Revision: D1069261
Forgot IOP_ARGS in doFPushCuf declaration

Reviewed By: @jano

Differential Revision: D1081437
$_SESSION should start uninitialized

$_SESSION should start uninitialized on each request

Reviewed By: @swtaarrs

Differential Revision: D1080275
Add build flag for ARM mode default

Reviewed By: @swtaarrs

Differential Revision: D1081124
Change the way in which objects are tagged as collections.

With the introduction of FrozenSet in D1060075, we ran out of bits
in o_attributes to represent new collection types.

This diff changes things so that we only store a 1-bit attribute
IsCollection in o_attributes, indicating (suprise suprise) whether
a particular ObjectData  is a collection or not.

If IsCollection is set, then the precise collection type
(which remains an element of Collection::Type) can be found in
o_subclassData.u16.

Reviewed By: @paroski

Differential Revision: D1070558