Fix namespace typedefs

Typedefs weren't being normalized, so checks that should have
worked, didn't.

Closes #1526

Reviewed By: @gabelevi

Differential Revision: D1123427

Pulled By: @scannell
Fix rendering DateTime objects with offset TZs

- m_tz and m_time/tz_info are only relevant if m_time->zone_type == 3
 - if zone_type == 1, m_time->z is the only relevant thing
 - however, there can still be something completely irrelevant in tz_info - and format() was using this to find the offset
 - call offset() instead of asking the tz_info for it

Closes #1406

Reviewed By: @ptarjan

Differential Revision: D1120967
Convert ext/bcmath to HNI

Converts ext/bcmath to HNI and adds support for scaling

Closes #1534

Reviewed By: @sgolemon

Differential Revision: D1123805

Pulled By: @scannell
Mongodb hacks and test

For testing zend compatibility bugs.

Closes #1479

Reviewed By: @scannell

Differential Revision: D1117041

Pulled By: @ptarjan
Handle unserializing a finfo object.

Zend currently throws:
Warning: finfo::file(): The invalid fileinfo object.
when trying to do something on an unserialised object. I consider this a
bug in Zend and there doesn't appear to be any tests covering that
behaviour.

This currently segfaults when deconstructing the unserialised object in
HHVM.

Closes #1527

Reviewed By: @ptarjan

Differential Revision: D1123430

Pulled By: @scannell
Fix ReflectionFunction for closures with uninitialized static locals

ReflectionFunction::getStaticVariables returns both use vars
and closure static locals.  In zend, if there are name conflicts
between the two sets, things get weird (see task #3499967).  Also, in
zend, the value of the static is computed at closure allocation time,
which means calling this on an unevaluated closure gives the static's
value.  For us, the closure has to be invoked to execute a
StaticLocInit (prior to that, the 86static_foo property is
KindOfUninit, so we'd raise the notice @elynde hit).

This changes things to not raise when reading properties (only the
statics could be uninit), and strip the 86static_ prefix, which is
closer to what zend shows.  But we're still a bit different...

Reviewed By: @ptarjan

Differential Revision: D1120161
Initialize all fields in NormalizedInstruction's constructor

I noticed various fields weren't being initialized there while
investigating a failure with the region JIT that seems related to
uninitialized memory.  This doesn't fix the failure, but seems worth
fixing anyway.

Reviewed By: @scannell

Differential Revision: D1123322
stop emitting regex debugging message

This message is breaking composer installing things with enormous regexes. I tried to change the default error level but @markw65 didn't like that and we need to do something, so I guess lets not emit this if EHHS is off.

Closes #1347

Reviewed By: @markw65

Differential Revision: D1118365
Don't restrict auto-alias names to the global namespace

In practice, this is a bit surprising behavior for code in
<?hh mode that also uses namespaces.

Reviewed By: @dariorussi

Differential Revision: D1120068
Implement Intl's DateFormatter class

This is actually a partial implementation because DateFormatter
is tightly bound to IntlCalendar (and its children).
Rather than make a massive hard-to-review diff,
I've implemented most of the DateFormater bits here
and will finish them off with a followup IntlCalendar diff.

Reviewed By: @ptarjan

Differential Revision: D1119360
Remove APC stats

We are moving away from unused stats and start moving the stats to a more sensible infrastructure

Reviewed By: @jdelong

Differential Revision: D1110559
Call iterNext indirectly via table with heavily specialized helpers

Make iterNext and iterNextK super specialized helpers and invoke via indirect call instead of call to single helper

Reviewed By: @paroski

Differential Revision: D1084030
Support mod_fastcgi

when using mod_fastcgi SCRIPT_NAME is the Action instead of the actual document you want
this commit uses PATH_TRANSLATED - DOCUMENT_ROOT

tested with:
apache+mod_fastcgi
apache+mod_proxy_fcgi
nginx with no PATH_TRANSLATED header
nginx with this as PATH_TRANSLATED: fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;

Reviewed By: @scannell

Differential Revision: D1114124
remove StaticContentCache scan at startup

This was added many moons ago for static content perf. Basically we scanned whatever was on disk and made a map of all the file extensions we wanted to serve. We also allow files to be loaded from disk if `EnableStaticContentFromDisk` is set (which is default on).

Having this was bad for fastcgi since `SourceRoot` doesn't even make sense there.

Reviewed By: @jdelong

Differential Revision: D1124447
return false for bad preg_match

Closes #1347

Reviewed By: @JoelMarcey

Differential Revision: D1125164
disabled tests

Including the disabled tests for mongo so I can slowly enable them

Reviewed By: @paroski

Differential Revision: D979400
Implement the equivalent of CALL_OPCODE for ARM

This gets the native-call machinery working on ARM. I tried hard to
avoid copypasta, but unfortunately I think some amount of it is
inevitable.

I've only converted one of the simplest possible opcodes (ConvIntToStr)
for now, because I've knowingly punted on some stuff for now, most
notably arguments passed on the stack. This diff gets the basics in
place; in future diffs I'll convert more opcodes and iron out the issues
that arise.

- shuffleArgs(), like SpillStack, is another one of those annoying cases
  where most of the logic is platform-independent but there are several
  instruction-emitting calls buried deep down.

- I moved ArgDesc and ArgGroup into their own file, which was fairly
  smooth, especially now that PhysReg isn't x64-specific.

- I split out Immed from asm-x64.h because it's not x64-specific and
  ArgDesc depends on it.

Reviewed By: @edwinsmith

Differential Revision: D1121726
Fix valgrind issue in Github build

This fixes a JIT crash with VALGRIND=1.

Closes #1483

Reviewed By: @ptarjan

Differential Revision: D1117038

Pulled By: @scannell
Implement codegen for LdLoc, IncRef, AssertType

LdLoc was the goal here (it was by far the most frequent punt). It's
really simple to implement, but it turned out that doing codegen for it
had a few cascading effects.

- We're now carrying registers across InterpOne calls, so switch to
  using cgCallHelper there.

- Using cgCallHelper for interp-one now requires cgCallHelper to support
  immediate arguments to helpers.

- IncRef and AssertType are now generated in such a way that we can't
  punt on them (even if you punt on them, they show up in
  hhbc-translator output).

Reviewed By: @edwinsmith

Differential Revision: D1120272
Don't preemptively optimize away conditional jumps

There may be a stack adjustment needed.

Reviewed By: @ottoni

Differential Revision: D1124766