Use fewer opcodes for Is* instructions

We are running out of opcode space (>256 opcodes).

Reviewed By: @edwinsmith

Differential Revision: D1075626
Fix one bug, and some formatting, in new APC code

I noticed this while auditing uses of Variant(bool)

Reviewed By: mwilliams

Differential Revision: D1077812
Fix memory leak in HPHP::Socket

Socket and SSLSocket are allocated via ::operator new,
so they need to take care of freeing their own memory when they
are swept.

This was showing up as a gradual leak if Socket's were held until
the end of the request.

Reviewed By: @andralex

Differential Revision: D1077472
Revert "optimize fast path to idx()"

This reverts commit 7b38c2fbc414274cd22be32548b6cc86cc9d260a.

It crashes a lot in production.

Reviewed By: @dariorussi

Differential Revision: D1077893
Turn off HHIRRefcountOpts by default

Getting a lot of crashes in production with it
turned on.

Reviewed By: @dariorussi

Differential Revision: D1077935
Make VarNR become a KindOfStaticString

Reviewed By: mwilliams

Differential Revision: D1077814
Fix crash in WaitHandle::join

It seems that continuations can complete during the "retry"
step, so we should check for that case.

Reviewed By: jan

Differential Revision: D1078010
Revert "Turn off HHIRRefcountOpts by default"

This reverts commit f5f2fc6faa38098ce95dd509f3b33891ed7b4746.

My base rev was broken when I was testing this - there wasn't really
a problem with the RefcoutOpts.

Reviewed By: @edwinsmith

Differential Revision: D1078057
optimize fast path to idx() (take 2)

This reverts commit 9ee6e1013b786b280090a052861e708e7c3fe4c0.

I was not having a good day. The crashes were caused by generating
the bytecode with one version of hhvm, and running it with another
(using HHVM_REPO_SCHEMA to shoot myself in the foot), while trying
to debug the asio issue.

Reviewed By: @dariorussi

Differential Revision: D1078072
Fix race in pmethodCacheMissPath

pmethodCacheMissPath smashes code under the write lease,
but there's nothing to prevent two threads going through it in
sequence - resulting in a double free of the pdata.

Check to see if the code has already been smashed, and bail out if
it has.

Reviewed By: @edwinsmith

Differential Revision: D1078180
Fix type logic of VGetL (and VGetN while I'm at it)

VGetL has an effect on the local: it gets boxed. This was causing us
trouble in interp-everything mode when a local got boxed by being passed
by ref to a builtin and then consumed. (The builtin means the tracelet
won't be broken in between.) This was failing an ext_openssl test.

It hurts to be messing with this old code, especially since we've gotten
this far with this bug always present and it hasn't given us any
trouble. When can we kill it?

Reviewed By: @edwinsmith

Differential Revision: D1071404
Add default arguments to some zip functions

This was causing a hilarious failure mode in debug builds where
unzipping this data would return the compressed data, because the flags
argument was 0x7a7a7a..., meaning the zip library thought the
FL_COMPRESSED flag (meaning return the compressed data) was set.

The problem was only showing up in interp mode, because I guess interp
mode passes arguments to native functions differently such that it was
picking up dead stack cells. Also, the test wasn't catching it because
both calls returned the same incorrect thing. I edited the test to be
more robust (and fix a variable-name type while I'm at it).

Reviewed By: ptarjan

Differential Revision: D1070357
Switch to the MySQL 5.6 client

Due to the interdependencies between libraries, converting
portions of the codebase to the 5.6 client independently is not an
option.  This diff moves all of fbcode to 5.6 as well as updates the
async_mysql client to the newer, slightly modified async api.

This diff brings with it the new features in the 5.6 client, most
notably ipv6 support.  It also adds ipv6 support to the php mysql
connect api in the form of '[addr]:port' in addition to the previous
'host:port' syntax for ipv4 addresses.

Reviewed By: agallagher

Differential Revision: D1058111