Bump CMake required version to 2.8.7

Mini-systemlib embedding uses string(MD5 ...)
which is only available in CMake 2.8.7 or later.

Closes #1306
Don't translate idx when JitEnableRenameFunctions is set

Users are supposed to be able to override idx with
their own version - but that doesn't work if we translate it
during bytecode emission.

We don't really have a good way of knowing whether its been
overridden, however, so use JitEnableRenameFunctions as we
have for other, similar cases.

Reviewed By: @dariorussi

Differential Revision: D1078332
Avoid calling smart_malloc() to allocate 0 bytes in Vector

Some of the logic in the Vector implementation was unnecessarily calling
into smart_malloc() to allocate 0 bytes, which is wasteful. This diff fixes
the issue appropriately.

Reviewed By: anietoro

Differential Revision: D1079298
Move unique stubs to 'a'

Some of these may actually be hot, and they're small enough that
putting them in 'a' shouldn't hurt.

Reviewed By: @jdelong

Differential Revision: D1069482
Move Collection interface to the HH namespace

Closes #1003
https://github.com/facebook/hhvm/issues/1003

Reviewed By: anietoro

Differential Revision: D1079642
Parse fatal for Interface method bodies

Generate a parse-time fatal for interface methods with method bodies.

Reviewed By: @hermanventer

Differential Revision: D1062389
Fix OSX warning

Fix OSX warning due to mismatched printf type

Reviewed By: @alexmalyshev

Differential Revision: D1078484
Fix OS X segfault on startup

Fix crash due to maybePop() call reading garbage out of the freelist the first time it is accessed.

Closes #1300

Reviewed By: @jdelong

Differential Revision: D1078982
Fix crash trying to inline after a bad method call

In some cases, we can statically prove that an FCall will
go to a particular method. But that might depend on the fact that
the FPush* would fatal. eg we know that an object is of class Foo,
or is null. The FPushObjMethodD will fatal if its null, so the
FCall is known to call Foo::method (or an override).

But if we try to inline the FCall bad things will happen if the
FPush* was interped. So don't do that.

Reviewed By: @swtaarrs

Differential Revision: D1078789
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