Get rid of HPHP::JIT::tx

Summary: Its just a global variable pointing at &mcg->m_tx, so rewrite to
use that instead.

Reviewed By: @bertmaher

Differential Revision: D1418725
Fix hhvmquickinterp tests in framework runner

Summary: '../' includes don't work the way they previously did :/ old code also doesn't work in php5.

Reviewed By: @ptarjan

Differential Revision: D1420816
Added \e escape code

Summary: Added \e escape code for ESC (27), see [PHP #60350](https://bugs.php.net/bug.php?id=60350) for details.

There may be some other tests that are fixed by this (for example (k|r|kr)sort_variation5), but there were some strange behaviors so I'm not quite sure about the results in my environment.
Closes #3077

Reviewed By: @ptarjan

Differential Revision: D1413752

Pulled By: @LiraNuna
Can't alias built-in classes

Summary: PHP does not allow to alias built in classes. Found via bad zend test

Reviewed By: @ptarjan

Differential Revision: D1399035
Allow MixedArray::MakeReserveLike to work on arrays with virtual size

Summary: Previously this would try to create an array with 2^32 elements, causing
an assertion or crash. array_map.hhas calls NewLikeArrayL on arbitrary
input, which in turn calls MixedArray::MakeReserveLike. So any array
originating from EZC would crash when fed into array_map().

Added two test cases which previously crashed.
Closes #3065

Reviewed By: @ptarjan

Differential Revision: D1411457

Pulled By: @LiraNuna
Fix declaration of apc_cache_info. Apparently everything worked just fine even with the wrong decalaration...

Reviewed By: @ptarjan

Differential Revision: D1421183
Only print clear-line escape sequence if necessary

Summary: I thought it would be okay to unconditionally print it in the non-json
output, but apparently people *are* using non-json output to drive
editor integration.

Reviewed By: @aryx

Differential Revision: D1421410
Change g_array_funcs to dispatch to proper IntMap functions

Summary: Change g_array_funcs to dispatch to kIntMapKind templated versions of functions
so that warnings are raised appropriately for:

 * Looking up, inserting, or removing a string key
 * Appending to, dequeuing from, or popping from the array
 * Inserting a value that is a reference
 * Renumbering array keys

Reviewed By: @paroski

Differential Revision: D1413912
Introduce Dbl-specific relational IR opcodes

Summary: Relational comparisons between doubles are common in microbenchmarks, so
I'm implementing proper codegen for them here.

We had an attempt at codegen for this stuff already in the code, but it
didn't work quite right, and would have been very hard to bring up to
date with my recent fix to how NAN comparisons work. This new
implementation also eliminates the need to check the parity flag to
detect the unordered case.

This doesn't add fused jump opcodes corresponding to these; I could do
that, but I'd like to get this in first, and I'd actually much rather
come up with a general solution for IR jump fusion (i.e. instead of
having all these semi-duplicated opcodes, add a notion of condition
flags into the IR).

Reviewed By: @swtaarrs

Differential Revision: D1386084
fixed a security vulnerability in php where session encodings could have data injected into them

Summary: When sessions were encoded there was no check to ensure keys did not contain undef markers.

fixes CVE-2010-3065

Relevant links:

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-3065

http://php-security.org/2010/05/31/mops-2010-060-php-session-serializer-session-data-injection-vulnerability/index.html

Reviewed By: @JoelMarcey

Differential Revision: D1376056
Move inProgressTailJumps out of SrcRec

Summary: Its a temporary vector and belongs in CodeGenFixups

Reviewed By: @edwinsmith

Differential Revision: D1419821
Update HHVM_API_VERSION

Summary: Since 3.0 `Extension` class has been updated, so we need
to update HHVM_API_VERSION, or HHVM could load extensions
compiled against HHVM2.2 and crash.

Closes #3032
Closes #3090

Reviewed By: @ptarjan

Differential Revision: D1422384

Pulled By: @fredemmott
Fix for bad_shell_exec failing depending on the user's shell

Summary: Different shells have different error messages, which trips up
this test case. Switches the test case to a regex covering the
two cases I've seen.

Eg:
```
~/hhvm(branch:master) » echo $SHELL
/usr/bin/zsh

~/hhvm(branch:master) » hphp/hhvm/hhvm hphp/test/run hphp/test/slow/ext_process/bad_shell_exec.php
Running 1 tests in 1 threads

FAILED
1 tests failed
(╯°□°）╯︵ ┻━┻
: hphp/test/slow/ext_process/bad_shell_exec.php
002+ sh: 1: /invalid_path/: not found
002- sh: /invalid_path/: No such file or directory
```
Closes #3103

Reviewed By: @ptarjan

Differential Revision: D1422459

Pulled By: @fredemmott
CMake: distribute hphp/system/ public headers too

Summary: Add auto_sources/HHVM_PUBLIC_HEADERS under hphp/system/ as well, which
was forgotten from the initial build system improvements. This
distributes systemlib.h, among others, which is necessary for building
extensions.
Closes #3085

Reviewed By: @ptarjan

Differential Revision: D1422661

Pulled By: @fredemmott
Revert "Fix for bad_shell_exec failing depending on the user's shell"

Summary: This reverts commit 62eb6be5d23126089f8c2619da976d7f23550a71.

Reviewed By: @ptarjan

Differential Revision: D1423366
Fix casting a DateTime to an array

Summary: Fixes facebook/hhvm#3083

Reviewed By: @ptarjan

Differential Revision: D1414803
Make SplHeap comparisons work on non-number objects

Summary: `compare()` only gets called with comparison to greater than zero. I could change it to return true if is greater than. Keeping the same behaviour matches the name

Fixes #3086
Closes #3091

Reviewed By: @ptarjan

Differential Revision: D1422402

Pulled By: @fredemmott
Fix EZC usage of ThreadLocal and clarify ThreadLocal comments

Summary: I inappropriately had EZC's TSRM layer create ThreadLocal objects as
true globals, instead of using DECLARE_THREAD_LOCAL and
IMPLEMENT_THREAD_LOCAL. This caused a crash since the variables were
meant to be thread-local but weren't. Fixed this, and clarified and
expanded the comments in thread-local.h to address the origin of the
error.

Also:

* Fixed some whitespace and namespacing issues in this code, along
  the lines of my previous EZC commits.
* Fixed a bounds check in ts_free_id().
Closes #3120

Reviewed By: @ptarjan

Differential Revision: D1422510

Pulled By: @fredemmott
Various fixes to the build

First: libdwarf. libdwarf seems to have no problem making breaking
changes and provides no easy way to even test the version you're
building against. I have added two tests in `FindLibDwarf.cmake` to
detect a change to function type signature and to detect the removal
of `dwarf_producer_init_c`. Hopefully this will work on all systems.

The recent change to use more system libraries broke the build of the
`gen-*` bootstrap utilities, as the targets were not updated to use
the system `double-conversion` library and instead attempted to use
the (unbuilt) local one.

Commit 83cbca11c1 made linking to libpam happen only on OSX. This
breaks the build on ArchLinux and openSUSE at least. I reverted this
change given that detecting whether or not you need to link to it is
quite difficult.