Revert "Revert "g++-4.8.1""

This reverts commit f72f602552b261a7cb0d5932cf17a950cfeaef81.

Differential Revision: D947694
Fix crash in compactMergeInfo

There was a race in defClass that could result in
a defClass on a different thread succeeding, before the original
had added the new Class to the NamedEntity's clsList. That could
result in a crash in compactMergeInfo.

Differential Revision: D949580
Revision of unit tests for async functions

Tests for async functions were originally just modified tests for
generators. The implementation will be changing soon (eager execution,
AsyncFunctionWaitHandle) and the test will be no longer sufficient.
These modifications are mostly based on problems I encountered while
working on optimizations.

Differential Revision: D943736
TextUtils for future use in FileCache

String manipulation stuff to replace scary code in FileCache

Differential Revision: D949861
Fix ArrayIterator constructor zend compatibility

Flatten ArrayIterator/ArrayObject when initializing them with
other array wrappers to produce arrays from respective getArrayCopy()
methods

Closes #1000

Differential Revision: D949379
Use /usr/bin/objdump instead of $PATH-found objdump for disassembly

On some machines (such as mine or Drew's), `which objdump` finds /usr/local/bin/objdump, which in turn has version 2.21.1. That makes hphp/util/test/asm.cpp fail due to a different hexadecimal constant formatting convention than the one we expect. Fortunately, /usr/bin/objdump is still 2.17.50.0.6-6.el5 on said machines, which is what works. So this hardcodes that path at least as a stopgap until we figure a better solution. Long-term we should plop a sanctioned objdump version in ~engshare.

Differential Revision: D946553
Attempt to bring some sanity to destruction of extension classes

I opened this can of worms while trying to devirtualize ObjectData, and
trying to understand how objects get destructed. It turned out that
every ObjectData and ResourceData subclass was defining its own operator
delete via several layers of macros, and they all did the same thing.

I deleted the one for ObjectData and let everything be handled by the
definition of operator delete in ObjectData itself. ResourceData makes
this harder: given a ResourceData*, we don't have quite enough
information handy to know how big its dynamic type is, so we're still
using the macro-generated override in every ResourceData derived class.

This more closely reflects reality, since ResourceData and ObjectData
are separate class hierarchies now.

Differential Revision: D943826
Zend compatitblility layer

In order to support existing Zend extensions, I'm introducting a source compatitblility layer. Since the extensions are all built around macros, the plan is just to redefine them to work on HHVM internals intead of Zend internals.

I've implemented the most common ones I've seen so far. The plan is to import all the builtin extensions from zend that we currently don't support and use them as a coverage test. So far, this diff includes calendar.

Differential Revision: D938776
Moar debugger proxy loggin

Add a little more logging to the proxy, for error cases where the proxy declares a protocol violation on the part of the client and disconnects.

Differential Revision: D947864
Comments and minor cleanup around thread modes and blocking in the debugger.

Added comments and did a tiny bit of cleanup to help understand a bug we currently have with multiple threads hitting breakpoints. Mostly comments and log changes. Any other changes should cause no semantic difference, and are for clarity only.

Differential Revision: D943943
Somehow, these files were landed despite abandoning the previous diff

Remove files which have no business being in the tree

CI infrastructure was broken... 'arc unit' passes now...

Differential Revision: D950218
Add inlining support for profile-guided region selection

In PGO mode, we were punting when the profiling translation had an
inlined call.  Properly supporting inlining was not difficult, but it
required the profile data to keep a region instead of a block for each
profiling translation.

Differential Revision: D944792
Unbreak the build

A minor last-minute change made a variable only used in an assert.

Differential Revision: D950812
Devirtualize APC

We have a now-unnecessary abstract base class, so I removed
it.

Differential Revision: D937419
Add "native" functions for use in Systemlib

<?hh
  class Foo {
    <<__Native>>
    public function bar(int $baz) : string;

    <<__Native>>
    public static function bling(mixed $blong) : double;
  }

  <<__Native>>
  function blong(string $a, stdClass $b) : void;

  <<__Native("ActRec")>>
  function zorb(int $foo, string $bar): float;

Hooks internal functions:

  String HHVM_METHOD(Foo, bar, int64_t bar) { ... }
  double HHVM_STATIC_METHOD(Foo, bling, CVarRef blong) { ... }
  void HHVM_FUNCTION(blong, CStrRef a, CObjRef b) { ... }
  TypedValue* HHVM_FN(zorb)(ActRec* ar) { ... }

When registered during Extension::moduleLoad() with:

  HHVM_ME(Foo, bar)
  HHVM_STATIC_ME(Foo, bling)
  HHVM_FE(blong)
  HHVM_FE(zorb)

Differential Revision: D922477
Convert ext_hash function/methods to use new HNI bindings

Delete hash.idl.json.
Implement extension in systemlib (plus native funcs).
This makes ext_hash.ext_hhvm.cpp a noop.

Differential Revision: D940558
Convert SessionHandler class to Systemlib based class

Pretty basic re-wrapping

Differential Revision: D947279
Add XHPChild interface, an interface compatible with arrays, strings, ints and doubles.

We currently don't have a way to type XHP's {} operator (i.e. to type $foo in
function ($foo) {
  return <div>{$foo}</div>;
}

An XHPChild interface should solve this issue by having a type which is compatible with arrays, strings,
ints and doubles. We can then modify www to have :x:base implement XHPChild.

To me, this seems like the right step to get rid of the Xhp special casing.

Differential Revision: D886565
Restore licenses incorrectly mangled on last push

Update license.php so that doesn't happen again.
Add new ext_hhvm files to .gitignore
fix register_shutdown in session_set_save_handler

Do not register automatically session shutdown function when
session_set_save_handler called in PHP <5.4 style.
PHP Manual: Note we additionally register the shutdown function
session_write_close() using register_shutdown_function() under PHP less
than 5.4.0. This is generally advised when registering objects as
session save handlers under PHP less than 5.4.0.

Closes #1001

Differential Revision: D949388