Fix libzip to check zip archive members pointer before freeing.

This is a patch for #1754. The actual fix is already in the master
branch of the source library:
http://hg.nih.at/libzip/comparison/8cc36648e0a2/lib/zip_fclose.c
Target 2.5.0

2.4.0 is released
Merge pull request #1773 from jeffchan/libzip-hotfix

Fix libzip to check zip archive members pointer before freeing
Remove assert in FrameState merging

Assert won't hold with user-level control flow.

Reviewed By: @ottoni

Differential Revision: D1163705
Exclude x17 from register allocator since MacroAssembler could use it.

Spotted by inspection.

Reviewed By: @oyamauchi

Differential Revision: D1166234
Add final remaining minstr base cases; make the Base non-Optional

Added BaseLoc tags for "the base lives in $GLOBALS" and
"we've fataled".  Finished some cases in miBase so it never returns
folly::none anymore.

Reviewed By: aravind

Differential Revision: D1146291
Track local base types more precisely; use Obj=stdClass for must-promote cases

Reviewed By: @elgenie

Differential Revision: D1152159
Add a type for "primitive" things (things where the TypedValue isn't a pointer)

Reviewed By: @dariorussi

Differential Revision: D1154321
Use a NameA opcode for implementing ::class

There are no class constants named "class", so either ClsCns
needed a documentation update or it was not behaving as specified.
This should also "fix" the self::class in a pseudo-main to fail the
way parent::class does, matching zend.  static::class still works in
this case, although it doesn't in zend.

Reviewed By: @ptarjan

Differential Revision: D1154554
Add a dot-format printer to hhbbc output

Reviewed By: @edwinsmith

Differential Revision: D1154712
Remove some dead stuff in Index::resolve_class

There was an idea that we'd use the context to be able to
resolve hoistable classes from the same unit, and things like that.
We might do this at some point but the prototypey code about this is
just noise right now so remove it.

Reviewed By: @dariorussi

Differential Revision: D1154734
Add some not-yet-implemented reduce cases in FPI parameter preparation

There are at least some examples where we can determine
parameter reffiness and hphpc can't coming in a later diff, so make
these a little more complete so we'll actually optimize based on it.

Reviewed By: @dariorussi

Differential Revision: D1154999
Don't count assert opcodes against inlining costs

Mark suggested maybe they should even subtract the cost, but
we can try that later if this looks helpful.

Reviewed By: @swtaarrs

Differential Revision: D1156317
Add some place to dump index information in hhbbc_dump

Reviewed By: @elgenie

Differential Revision: D1156925
Support to infer return types and parameter reffiness for overridden methods

Adds a res::Func mode that represents a "FuncFamily", which
is just a set of possible functions it could call.  Return types and
parameter reffiness in this mode turns into loops over the possible
functions.

This code is disabled because it causes a perf regression.

To compute the possible functions in a family, when the index is
initially built, this adds a pass to instantiate all possible
combinations of the classes so we can see all possible subclasses.
This could have other uses later, too.  (This costs about 6 seconds
for create_index on www in dbg so I think it's ok not to parallelize
or whatnot for now.)

Reviewed By: @dariorussi

Differential Revision: D1157919
Only rename builtins that aren't C++ builtins to __builtin_name

It looks like the only case in systemlib that does this
fallback stuff is array_map.  (I believe array_filter used to.)  Since
this function was detecting that situation by trying to look up loaded
functions, it would rename every function if you call it a second time
to create the UnitEmitter again (which I need for HHBBC).  This way
fixes that, but leaves the dependency on the hhas system being loaded
before the native func one.

Reviewed By: @markw65

Differential Revision: D1155030
Fix lookup_param_prep for builtins with AttrVariadicByRef

PHP has some builtins that take non-declared arguments by
reference (which normally you can't do).  HHBBC wasn't handling them
properly, but it doesn't matter until D1155030 fixes its ability to
resolve non-HNI builtin functions.

Reviewed By: @elgenie

Differential Revision: D1155033
Remove throw_oom_only, fix an exception bug in SetN

We don't need to track when things can throw because of OOM,
because it is delayed until the next surprise flag check.  (I was
confused about this earlier and started doing throw_oom_only, but it
would require auditing everything to get it right.)  There was also an
overly optimistic nothrow() in SetN.

Reviewed By: @bertmaher

Differential Revision: D1155041
An initial place for gathering / printing stats in hhbbc

For now it only computes opcode counts.  (Which I want to use
to see how effective AssertT-filtering is.)

Reviewed By: @dariorussi

Differential Revision: D1158625
Fix RemoveDeadBlocks

When HHBBC detects a block is unreachable, it has two
options: either replace it with a Fatal, or make the jumps
unconditional.  The latter mode was off because I had issues with it
in perflab in the past, which looks like it was because it unbalances
the stack.

Reviewed By: @edwinsmith

Differential Revision: D1160731