Call $this->__init__() even in native classes

Summary: We (WMF) have many classes that look like:

```
<<__NativeData("ZendCompat")>>
class LuaSandboxError extends Exception {}
```

Native::nativeDataInstanceCtor() is mostly a duplicate of
ObjectData::newInstance(), but the Native function inappropriately omits
the \_\_init__() call. So for the test case above, the exception trace is
not initialised.

Fix this, and also give a more informative error message when
Exception::\_\_init__() is not called prior to
Exception::getTraceAsString().
Closes #3088
Created from: https://github.com/facebook/hhvm/pull/3088

Reviewed By: @swtaarrs

Differential Revision: D1435376
Stop trying to recurse over / for fake frameworks

Reviewed By: @ptarjan

Differential Revision: D1435686
need the vixl headers for a bunch of runtime headers

Summary: Several of the headers in runtime include files from vixl. Added a few lines that add the vixl headers to the rest of the hhvm public headers.

Reviewed By: @LiraNuna

Differential Revision: D1434788
typechecker: support for PHP5.6 variadic args

Summary: The `...$args` syntax of https://wiki.php.net/rfc/variadics should
 supplant the `...` hh-only extension in most/all cases. However, we
 will likely support both for at least a few releases.

 The issue of whether to allow a typehint `T ...$args` to be
 interpreted as `array<T> ...$args` has been punted in the HHVM
 runtime by not allowing type-hints on variadics. As a result,
 ...$args declarations currently cannot be used in hack strict files.

 A possible extension of this work would be disallowing calls to
 func_get_arg(s) -- but that may also be appropriate for linting
 tools.

Reviewed By: @jwatzman

Differential Revision: D1410635
detect proper libdwarf types - try #2

Summary: My suspicion for failing on CentOS is because we set the dwarf const
variable to "0" instead of 0 which surprisingly is not in the list of
many things that evaluate to false:
http://www.cmake.org/Wiki/CMake:VariablesListsStrings

According to ptarjan this PR should trigger a CentOS build, so I hope
this works.

Previous message:
Current master is broken by libdwarf once again. Other than checking for
a particular init function we should also check if we're allowed to use
a const char* for name separately.

Combined them into a macro for future changes.
Closes #3184
Created from: https://github.com/facebook/hhvm/pull/3184

Reviewed By: @ptarjan

Differential Revision: D1432972
Fix reoptimize() for control-flow

Summary: If optimizeInst() returns an SSATmp that is different from the
destination of the instruction, we add a "Mov" instruction to move
it to the correct destination. However, this was not correctly
handling the case when the optimized instruction has a taken branch.

This diff fixes it to add the Mov on the fall-through branch.

Reviewed By: @swtaarrs

Differential Revision: D1412984
typechecker: use a type to represent function arity

Summary: ... the arity information for a function is easier to
 consider when code is being written as a pattern match instead of 2-3
 correlated fields (i.e ##1000## arguments meaning ##...##). This diff
 is a net savings in lines of code and sets up future refactoring to
 track the type-hints on varidic params. Also, ensure that the
 functional programming term "arity" doesn't appear in error messages
 meant for typechecker users

Reviewed By: @jwatzman

Differential Revision: D1435310
Combine unit repo table columns into one blob

Summary: It's a lot easier to add things if we combine this all into one
blob.

Reviewed By: @markw65

Differential Revision: D1434551
typechecker: adding hint support for PHP5.6-variadic args

Summary: The syntax ##f(A ...$a)## makes ##$a## an ##array<A>## for
 the purposes of the body of ##f##, but for callers of ##f##, it is a
 function that accepts any number of arguments, as long as each of
 those is an ##A##.

 To implement this syntax:
 - the param type information for the hint that accompanies the variadic
   is parsed and tracked; this includes all the places where func types are
   instantiated
 - the approach to getting types for the body vs signature of a function
   is now necessarily distinct (with a boolean param)
 - in order to check types in functions calls, the subtyping of params changes
   from stopping after one of the param lists is exhausted as previously now proceeds
   further using a default (containing the type calculated from the variadic hint)

 NOTE: HHVM runtime doesn't yet support the typehinted form of
 ##...$args## due to perf concerns with respect to when the typehint
 is to be checked.

Reviewed By: @jwatzman

Differential Revision: D1435333
more accurate signatures for fb_get_enum_* functions

Reviewed By: @jwatzman

Differential Revision: D1435555
Added xdebug_time_index

Summary: This diff adds the xdebug_time_index function, which returns the number of
seconds that have passed since the script started. This implementation has
a precision of microseconds like php5 xdebug.

Depends on D1392774

Reviewed By: @ptarjan

Differential Revision: D1398587
Reenable RecursiveDirectoryIterator tests.

Summary: Race condition happened, my fix went in after Bert disabled them.

Reviewed By: @bertmaher

Differential Revision: D1437222
Fix warnings for duplicate int/string keys in collections

Summary: We recently started calling HashCollection::warnOnStrIntDup for both Maps
and Sets, but the message was specific to Sets. Fixed the wording.

The test for duplicate keys in HashCollection::warnOnStrIntDup was actually testing
the values; which was fine for Sets, but meant that we rarely issued warnings for
Maps. We only called warnOnStrIntDup if there were fewer elements in the result
array than in the original Map (ie only if there *were* duplicate keys). So we only
got a warning if there were both duplicate keys *and* duplicate values. Fixed it to
test the keys.

Reviewed By: @paroski

Differential Revision: D1436332
Make better portability OSX binary packages with GCC

Summary: The simplest application of the patch, after the removal of gcc from the system hhvm will still be working on OSX, apple doesn't have gcc >= 4.8. When transferring to another Mac or build PKG #3132 before that I couldn't run.
Closes #3195
Created from: https://github.com/facebook/hhvm/pull/3195

Reviewed By: ptarjan, fredemmott

Differential Revision: D1437024
fix MaxRss out of bounds hhvm don't stop problem

Summary: When more than 6g not stop hhvm,beacause function Process::GetProcessRSS return type is int;
if Process::GetProcessRSS return value than 1024*6, Process::GetProcessRSS * 1024 * 1024 in checkMemery , it return value is 0;
So is never greater than 0 MaxRSS;

e.g:

	#include <stdio.h>
	int main () {
	   int a = 1024 * 1024 * 1024 * 12;
	   printf ("%d\n",a) ;
	   a = 1024 * 1024 *  12;
	   printf ("%d\n",a) ;
	   return 0;
	}

print result:
0
12582912

we see first var a have out of bounds.

so we can modify Process::GetProcessRSS return type to int64_t solve this problem.

I have tested this modify way.
Closes #3189
Created from: https://github.com/facebook/hhvm/pull/3189

Reviewed By: @ptarjan

Differential Revision: D1435402
SplFileObject->seek() throws a LogicException on negative values

Summary: Split from  #3056
Closes #3175
Created from: https://github.com/facebook/hhvm/pull/3175

Reviewed By: @ptarjan

Differential Revision: D1432749
Fix a segfault cleaning up persistent sockets

Summary: This is a fix for #3074 where cleaning up dead persistent sockets
sometimes caused a segfault, because the dead socket was removed
from the persistent resource store before being closed. Removing
an object from the persistent resource store can end up deleting
the object, which is what happened in the segfault case.
Closes #3101
Created from: https://github.com/facebook/hhvm/pull/3101

Reviewed By: mwilliams, ptarjan

Differential Revision: D1435379
Hide 0Closure variable from getDefinedVariables

Summary: Closures have an internal variable "0Closure" that points to the last
defined function. Previously, calls to get_defined_vars would return
this (and php5 didn't). This modifies VarEnv::getDefinedVariables so
that the "0Closure" variable is not included.

Reviewed By: @jano

Differential Revision: D1401578
Better error message when timing out

Reviewed By: @aryx

Differential Revision: D1438431
autocomplete json, add information about variadics

Summary: There are two types of variadics

  function t2(int $a, string ...$a);
  function t1(int $a, ...);

Respective outputs are

            "params": [
                {
                    "name": "$a",
                    "type": "int",
                    "variadic": false
                },
                {
                    "name": "$args",
                    "type": "string",
                    "variadic": true
                }
            ],

and

            "params": [
                {
                    "name": "$a",
                    "type": "int",
                    "variadic": false
                },
                {
                    "name": "",
                    "type": "_",
                    "variadic": true
                }
            ],

Reviewed By: @joelbeales

Differential Revision: D1437768