Streamline NewTuple and NewArray helpers

Rearrange the code so when we allocate an array from JIT code,
we call one helper where most of the code is inline.

Differential Revision: D917956
Fix arguments with __call and call_user_func_array

- Fix call_user_func_array to be Zend compliant, see new test
case

Closes #939

Differential Revision: D917994
Calculate dynamic invariant constants per process

- Cache and store invariant dynamic constants and set per
session instead of making more expensive calls

Differential Revision: D915702
Rename files in hhvm

Differential Revision: D914023
Fix a bug for typedefs to mixed when parameters are an object

Oversight in the case where it was an object.
(checkTypedefNonObj handled it properly.)

Differential Revision: D917712
Fix a capacity under-estimate in StringData::escalate

This looks like it should be using cap.  (The allocation size
is cap + 1.)

Differential Revision: D917389
Smaller string mode tests, don't overlap mode with capacity

Looking at the generated code for various StringData mode
dispatch cases, there were 64-bit immediates being put in registers
often to test the format value.  We also did masks on the capacity
just to see that the string was small.  This switches to just load the
byte that actually contains the mode, and use a 32-bit integer for
capacity (the largest string size fits in this).  Small checks only
need to compare that byte with zero.

Differential Revision: D914034
Move MySQL config settings into ext_mysql

Organization and de-monolithification.

Differential Revision: D918185
Avoid division by zero when aprof isn't allocated

That's it.

Differential Revision: D919880
unbroke type profiler

Fixed profiling implementation, moved soem of profiling ir opcode params into extra data

Differential Revision: D913367
Add function to get dependency stack on WaitableWaitHandle

Add a function to get the wait handle dependency stack to the native implementation of WaitableWaitHandle. This will be used by debuggers and profilers to get the stack of dependencies for generators driven from ASIO.

Differential Revision: D919486
Enable ctrl-c during eval

Enable the support for signal polling during eval in the debugger.

Differential Revision: D910661
Fix static closures *not* to do LSB in the JIT

:

Apparently this is intentional bug compatibility with zend.

Differential Revision: D919411
StringData allocator must be initialized

- For slow TLS ThreadLocalSingletons must be initialized

Differential Revision: D919977

Blame Revision: D907959
Fix a bug in StringData::escalate

Needed to delist and decref the shared variant.

Differential Revision: D920482
don't hide errors from pthread_setspecific

pthread_setspecific can fail per the man page, we should be
checking the return value

Differential Revision: D919949
folly::errnoStr is safer than Util::safe_strerror

- Eliminate Util::safe_strerror and use folly::errnoStr instead since the former is less safe as it doesn't preserve errno

Differential Revision: D920282
Don't always call values() for array fcalls

We should only call values() when we absolutely have to (magic calls where the array is not a vector)

Differential Revision: D920504

Blame Revision: D917994
Fix incorrect UseUndeclaredVariable warnings

There were two bugs:

 - Methods from Systemlib traits that were imported into user
   code were still marked as system methods, so we didnt run
   type inference on them, so the parameter wasn't annotated correctly;
 - If we couldn't determine whether a function argument was by reference
   or not, we could end up marking *that* as being the thing that set
   the parameter. If later we figured out which function was being called,
   we marked it as *not* by reference, and then it looked like it was being
   used without being set.

With this diff, we set the system/user flag correctly when cloning methods,
and always mark the "declaration" of a parameter as the parameter itself.

Differential Revision: D920269
Let $_SESSION be undefined until session start

In Zend, $_SESSION is undefined (i.e. reading it either directly or
through $GLOBALS results in an 'undefined' notice) until you call
session_start.

Right now we're not completely matching Zend on warnings, although we
get closer if you build with HHVM_MORE_WARNINGS (see
member-operations.h).

Differential Revision: D920224