Support list unpacking in foreach keys and values

Zend 5.5 allows you to unpack arrays into the key and
value expressions in a foreach loop. This implements the same
functionality in HHVM.

Differential Revision: D900264
remove typehints for FilesystemIterator

This class will happily take another `FilesystemIterator` as a param. Let the parent deal with throwing on bad params.

Differential Revision: D898524
Remove remnants of parse-tester

Differential Revision: D904174
Kill getKeyType[IS] and fix a emitVGetProp crash

getKeyTypeI/S/IS were artifacts of how keys were passed in
TranslatorX64 and no longer serve a useful purpose. emitVGetProp had
the same issue that was fixed in D902733 (no helper for Int keys).

Differential Revision: D904487
fix OSX build issues

Differential Revision: D904206
Letting doOptimize go into closure bodies.

As bodies of closures are not part of standard syntax tree, doOptimize
doesn't optimize them; this diff will fix this. It should have no
impact on performace as doOptimize is not used in WholeProgram mode.

Differential Revision: D904216
Some optimizations for closure creation

Inline some of the things into the TC so it can be
specialized on the closure type.  Also avoids spilling everything to
the stack to call init (which just pulls it back off and puts it into
the heap), and uses AllocObjFast instead of newInstance.  (We can't
quite get the super-fast-path version of AllocObjFast because closures
are extension objects and for now trying to convince it not to use the
m_InstanceCtor is a bit lame---we should probably just generate the
classes as php-level classes at some point so that'll just work.)

Differential Revision: D894569
Closures with AttrStatic never have an object context

This check in the prologue didn't make sense to me---I'm
pretty sure it's impossible for the branch to be taken, since we've
already set up c_Closure::m_thisOrClass such that it will contain a
Cctx.  Am I missing something?

Differential Revision: D894574
Fix a refcounting bug in Closure destructor

It didn't check if the reference count went to zero.

Differential Revision: D903740
Memoize xed addressToSymbol callback

Apparently printir is so slow because of the symbol lookups
here.  Let's just leak a memoized table (we probably don't actually
have that many distinct symbols to look up).  Also, it looks like this
code writes one byte further than it's supposed to in the output
buffer (the docs for the xed callback say the buffer_length includes
the null terminator).

Differential Revision: D902605
don't call user-code in constructor

`rewind()` is an overridable method in children. composer does just that, and expects the objects to be fully formed by the time it is called. Lets use a private helper instead, so user-code isn't called in the constructor.

Differential Revision: D904037
Compute square roots in the JIT

Pushes the sqrt builtin down to codegen for ints and
doubles, which might help on some microbenchmarks, and adds
sqrtsd to the assembler.

Differential Revision: D898146
Partially fix debugger pseudomain issue

I haven't completely figured out what's going on here, except
that we're running the same Func with and without the global varenv
attached. This was confusing the guard code and so we weren't emitting
guards for a local. This diff fixes up things so we do emit the
guards, but the global varenv issue still needs to be sorted out
before the new assert in translateTracelet can be left on.

Differential Revision: D899963
Turn JIT::Opcode into an enum class

Pretty straightforward. I renamed all the Op<name> opcodes to
just <name> to avoid collisions with the bytecode Op<name> constants.

Differential Revision: D867723
Add inlining support to the legacy region selector

When converting a Tracelet that contains an inlined FCall,
flag its block and then insert block(s) from the callee between the
FCall and the next instruction in the caller. The region translator
also required a few changes to support the inlined blocks.

Differential Revision: D863939
Implement pprof-style heap profile formatting

Heap profiles can now be dumped in pprof format using
ProfileDump::toString. The memory profile instrumentation now
dumps this data at the end of every request when TRACE=heap:2
is set.

Differential Revision: D894112
Resolve SrcKeys to symbols so pprof can generate graphs

pprof will request symbols from a running HHVM via
POST request when you try to run it in remote mode. This adds
the ability to format SrcKeys in a reasonably human-readable
format so pprof can deal with them, and it can be manually used
by turning on TRACE=heap:3.

Differential Revision: D895234
Add ProfileController, clean up ProfileDump and friends

This new static API will allow the coming pprof server
to request and fetch profiles, and VM threads to offer profiles
if they fulfill the currently active request. Some cleanup was
also performed to refrain from repeating stuff.

Differential Revision: D896872
Try to fix mysterious __sleep crash

We're seeing that some opt builds crash if you throw from
__sleep. After a lot of debugging, it looks like the eh_frame section
contains a bogus entry for php_sleep (in addition to the correct one),
and eh_frame_hdr's entry points to the wrong one (if I intervene in
gdb and point it to the right one, everything works).

I'm pretty sure this is a bug in gold (the eh_frame data appears
to be correct in object_data.o), and changes to unrelated code
make the bug appear and disappear.

I'm not sure exactly what the issue is, but php_sleep is basically a
hangover from hphpc days, so I'm killing it (and modifying the meaning
of HasSleep slightly - it now means what you expect). Not very satisfying
but hopefully it will work...

Differential Revision: D906292
Fix handling of "not buildling from git" case

The fallback for repo-schema and compiler-id
generation when not building from git was to use the system
microtime.  Unfortunately, using a '.' in the repo-schema
leads to bad SQL table names.  Use an underscore instead.

Differential Revision: D906623