Better management of g_context

Summary: Avoid destroying g_context twice per request.
Leave it null between requests.
Verify that there are no smart slabs allocated when a thread is flushed

Reviewed By: @jdelong

Differential Revision: D1559352
Replace calls to is_a with instanceof at IR gen time

Summary: These are equivalent in behavior; the PHP docs for is_a actually say you
should use instanceof instead.

Reviewed By: @edwinsmith

Differential Revision: D1556806
convert mbstring to hni

Summary: fixes #3675

Reviewed By: @ptarjan

Differential Revision: D1543361
Support zlib.output_compression_level option in set_ini

Summary: See previous discussion in post https://fburl.com/48881545 and D1547385, we want to experiment with different gzip compression level to see the impact on client.

Cowardly defered implementation for other zlib options as I'm noob to hhvm.

Reviewed By: @markw65

Differential Revision: D1558813
document func_get_args() difference

Summary: This is a known wontfix, and generally indicates code that should be
rewritten for clarity anyway.

Also, fix the fact that we can't count to 10.

Reviewed By: @sgolemon

Differential Revision: D1569484
Improve vasm pretty-printing

Summary: This gives each Vinstr an IRInstruction* instead of a SrcKey for the sake
of keeping track of where each vasm instruction came from. AsmInfo has
also been split out into its own header along with some additional
helper functions. We've also added mappings from IRInstruction to
TcaRange and from Block to TcaRange for cold and frozen code regions.

Also fixed a bug where were uninentionally duplicating a Vout struct,
causing us to miss setting the origin IRInstruction for many of the
Vinstrs while emitting vasm.

Reviewed By: @edwinsmith

Differential Revision: D1525064
Include PDOException in stdlib hhi files.

Summary: Closes https://github.com/facebook/hhvm/pull/3719

Reviewed By: @ptarjan

Differential Revision: D1547324
Make APC's StoreValue smaller

Summary: Go from 40 bytes to 24.  I haven't looked at how big the struct it's
embedded in inside tbb is though.

Reviewed By: @bertmaher

Differential Revision: D1566443
Remove #define TBB_PREVIEW_CONCURRENT_PRIORITY_QUEUE

Summary: It only affects tbb.h which we don't include.

Reviewed By: @bertmaher

Differential Revision: D1566748
Document the ConcurrentTableSharedStore entry points; delete unused ones

Reviewed By: @bertmaher

Differential Revision: D1567448
Make APC's StoreValue even smaller

Summary: Primed APC keys always have a zero expiration time, and non-primed
keys never need to use the lock.  Document that the lock is guaranteed to be
zero when unlocked so we can union it with expiry, and reduce the number of
bits we allow for expiry.  Also, rename 'expiry'.

Reviewed By: @edwinsmith

Differential Revision: D1567742
Remove cache_id argument from various apc functions; remove EnableDnsCache

Summary: We have two apcs, and our apc API doesn't match standard php.  It
looks like it might have been only there for an internal DnsCache feature that
isn't on.  Nothing appears to use this stuff, so remove it.

There's still some left over to clean up here (I think the whole "SharedStores"
thing can just go away now) but I figured I'd put this up before pulling more
of it out in case someone (asukhachev?) knows of any possible use I missed...

Reviewed By: @edwinsmith

Differential Revision: D1568138
Move jit/translator_tests to hphp/runtime/tests

Summary: We already have non-jit tests in here, and it's nicer to have fewer
link jobs with how slow we link, so I'd rather add non-JIT (APC) tests to this
binary than add a new one.

Reviewed By: @edwinsmith

Differential Revision: D1568468
Fix a bug in apc_cas for primed values

Summary: If it had to deserialize something, it was going to dereference a null
pointer when trying to free the old APCHandle.  The code for inc() had the same
layout, but no real bug, because we never have file-backed values for which
isNumeric would've returned true.

Reviewed By: @edwinsmith

Differential Revision: D1568469
Add Closure::bind() to news

Summary: .

Reviewed By: @ptarjan

Differential Revision: D1567365
Implemented constant HHVM_VERSION_ID

Summary: Closes #3758
Closes https://github.com/facebook/hhvm/pull/3806

Reviewed By: @ptarjan

Differential Revision: D1568916
cotire 1.6.6

Summary: Closes https://github.com/facebook/hhvm/pull/3817

Reviewed By: @ptarjan

Differential Revision: D1569826
Fix SplFileInfo::setFile/InfoClass

Summary: Use infoClass and not fileClass everywhere
Also throw proper exceptions

This fixes an issue in zf2 (most likely)
Closes https://github.com/facebook/hhvm/pull/3814

Reviewed By: @ptarjan

Differential Revision: D1569299
SSA for GetCtxFwdCall and GetCtxFwdCallDyn

Reviewed By: @alexmalyshev

Differential Revision: D1568547
Provide an option to not have the default runtime options specified by the wrapper

Summary: Right now we always set these options:

```
    $flags .=
      '-v Eval.EnableHipHopSyntax=true '.
      '-v Eval.EnableHipHopExperimentalSyntax=true '.
      '-v Eval.JitEnableRenameFunction=0 '.
      '-v Eval.GdbSyncChunks=1 '.
      '-v Eval.AllowHhas=true '.
      '';
```

Let's provide an escape hatch just in case we want something just a bit more vanilla

Reviewed By: @jdelong

Differential Revision: D1570066