Use a global cache for timezone info

Summary: Instead of caching the same info in every thread, share it using a
global AtomicHashArray.  I also considered pre-computing all the tzinfo, but a
good number of them seem unlikely to be used, so they'd just be taking up
space.

Reviewed By: @mclarkelauer

Differential Revision: D1607602
Admin Port for getting random apc entries and size

Summary: Added admin port for getting random apc entries and size. It takes a
count variable, defaults to one, and returns that number of random apc entries.

Reviewed By: @bertmaher

Differential Revision: D1599813
Only execute nextIntersect's linear search when necessary.

Summary: Two intervals that conform to SSA can only intersect if the definition point
of one is inside one of the other's live ranges. (or vice versa). Take advantage
of this by short-circuiting the intersection test when two intervals cannot
intersect.

Also add a few more intersection-avoidance checks:
  - never try to compute the next intersection of a fixed interval whos register
    is already live or with a regular interval whos register is already blocked by
    a fixed interval
  - if the current interval ends before another starts, don't bother with the linear
    search since they cannot intersect.

Reviewed By: @markw65

Differential Revision: D1591098
Explicitly destroy the singletons

Summary: Make sure they're destroyed before we exit

Reviewed By: @bertmaher

Differential Revision: D1610009
Replace Vunit::roots with a single entry block

Summary: We don't need multiple roots. All code should be reachable from a
single entry block. The only complication was bindaddr. It's now roughly
analogous to the other service request instructions in that it lives in the
code block that references it and directly emits the service request itself to
frozen.

Reviewed By: @edwinsmith

Differential Revision: D1603594
Remove outputDependsOnInput

Summary: No longer used

Reviewed By: @bertmaher

Differential Revision: D1610553
Remove NormalizedInstruction::changesPC

Summary: Nothing uses it.

Reviewed By: @swtaarrs

Differential Revision: D1610566
Remove default cases in uses of translator-instrs.h

Summary: Removing the defaults gives you a compile error when you add a new
opcode.  (Don't be alarmed about the nops in the interp one list: we skip those
first using isAlwaysNop, although we probably ought to just call an empty
emitFoo function ...)

Reviewed By: @swtaarrs

Differential Revision: D1610564
Add option to run perf to hhvm_wrapper

Summary: HHVM wrapper is handy for compiling a bytecode repo and running
hhvm with that repo in one easy step. Often times we'd like to run perf
record on just the hhvm step. Adding a CLI option will make that easier.

Reviewed By: @jdelong

Differential Revision: D1611783
Minor fix to variable name in Huffman benchmark

Summary: Some benchmarking tools depend on the regular naming of the benchmark suite
variable in each benchmark. Huffman breaks the rule, so we need to fix it now.

Reviewed By: @edwinsmith

Differential Revision: D1611826
Unroll AKExists into a series of comparisons on small static arrays

Summary: This is meant to go hand-in-hand with my other change to transform calls
to `in_array` into AKExists, though of course this will benefit organic
uses of AKExists too.

The CFG this generates is suboptimal. It generates a series of diamonds
(one per element of the haystack array) whereas it would ideally result
in something like this:

```
B1 --F--> B2 --F--> B3 --F--+
|         |         |       |
T         T         T       |
|         |         |       |
v         v         v       v
             Bdone
```

I'd have to expose additional API in IRBuilder to do this (since the
HhbcTranslator code would have to create and append its own Blocks) and
I wasn't sure it would be worthwhile. The worst that will happen is a
few redundant unconditional jumps, which we should actually be able to
optimize away downstream.

Reviewed By: @edwinsmith

Differential Revision: D1599893
Added support for ReflectionFunction::getClosureThis() [closes #3476]

Summary: PHP supports ReflectionFunction::getClosureThis() since version 5.4.0.
Added one test to slow section in norepo mode, since closure binding does not work in repo yet (3e290683d8504c74570343aee66da45863db8adf).
Closes #3476.
Closes https://github.com/facebook/hhvm/pull/3943

Reviewed By: @paulbiss

Differential Revision: D1608061
Allow non-variant args when inlining NativeImpl

Summary: Change CoerceStk to call a (new) version of tvCoerceParamInPlace
which throws an exception on failure instead of returning false.

Update the unwinder to handle tvCoerceException in CoerceStk's
catch block. Add CheckSideExit to allow for this while also
branching to the unusual cleanup behavior required for inlined
builtins in the case of regular exceptions.

This should noticeably reduce the HNI call overhead
and open up the rest of the conversions to continue
without hurting perf.
@sgolemon@swtaarrs got this most of the way there already,
just cleaning things up a bit.

Reviewed By: @swtaarrs

Differential Revision: D1414528
Use a FixedVector for EHEnt m_catches

Summary: It was using a std::vector, so switching to FixedVector cuts the size
down from 48 to 32 bytes.

Reviewed By: @jdelong

Differential Revision: D1605194
Add missing ini for XSL tests.

Summary: Signed-off-by: Arthur Loiret <arthur.loiret@ens-lyon.fr>
Closes https://github.com/facebook/hhvm/pull/3962

Reviewed By: @paulbiss

Differential Revision: D1612394
Fix is_callable for interface and abstract methods

Summary: Functions without a body can't be called
Fixes #3956

Closes https://github.com/facebook/hhvm/pull/3957

Reviewed By: @paulbiss

Differential Revision: D1610550
Fix issues with shutdown/postsend functions

Summary: The comment was wrong, you could remove elements
from the array as well as add them.

It also seems plausible that the entire m_shutdown array could be
reallocated (eg by registering the first postsend function while
iterating the shutdown functions), invalidating the array reference
that we were iterating over.

Reviewed By: @jdelong

Differential Revision: D1610874
Don't allow deserialization to violate static analysis

Summary: If HardPrivatePropInference is on, we shouldn't allow people to
unserialize objects where the fields have types that aren't visible to ahead of
time analysis, or it can crash the VM.

Reviewed By: @markw65

Differential Revision: D1611626
Move (most of) ext_asio to HH namespace

Summary: Move ext_asio to HH namespace. Everything except the base WaitHandle class.

Reviewed By: @jano, @elgenie

Differential Revision: D1240837
WaitHandle -> HH\WaitHandle

Reviewed By: @jano

Differential Revision: D1574162