Implement cgCheckType's punt

Our translation infrastructure can't handle punts from some
CheckTypes. We should fix that but is a much simpler change that will help for
now.

Reviewed By: @ottoni

Differential Revision: D1168794
Explicitly close() (and check return value) in file_put_contents

Force close() and verify the result before returning success in file_put_contents for user streams that may do all their real work in close().

Closes #1735

Reviewed By: @markw65

Differential Revision: D1166297

Pulled By: @scannell
More MySQLi fixes

- Ran the tests and fixed some easy things
- 5 more tests that passes
- Cleaned up a bunch of tests that used table test.

Reviewed By: @ptarjan

Differential Revision: D1170091
Index SplObjectStorage by index instead of by hash.

I had to move the zend test as we will never be `var_dump` compatable with zend (and we don't have a user-land way to configure var_dump).
Closes #1759
Closes #1757

Reviewed By: @fredemmott

Differential Revision: D1169304

Pulled By: @ptarjan
Fix SplQueue iteration modes in HHVM

IT_MODE_FIFO is 0 - the LIFO bit needs to be checked instead.

Used by Guzzle: https://github.com/guzzle/guzzle/issues/538

Reviewed By: @JoelMarcey

Differential Revision: D1168832
Remove legacy _imm64_reg64 assembler functions.

Use the new style instead.

Reviewed By: @swtaarrs

Differential Revision: D1170777
Remove explicit use of rAsm in emitEagerSyncPoint().

We never called emitEagerSyncPoint() with a nonzero spDiff,
so just eliminate the adjustment code.  It will still use
rAsm indirectly in the assembler when vmpc is a large immediate.

Reviewed By: @swtaarrs

Differential Revision: D1170790
Dedicated opcodes for Int-Int comparison.

This is the first part of splitting up the comparison opcodes;
it creates dedicated opcodes for int comparison, with narrow
accepted types, and removes the Int-Int case handling from the
generic comparison opcodes.

Reviewed By: @bertmaher

Differential Revision: D1168558
Make curl handles invalid resources after close

Used by Guzzle: https://github.com/guzzle/guzzle/issues/538

Reviewed By: @ptarjan

Differential Revision: D1169039
Don't leak UserStreamWrappers

We were returning an over-refCounted resource.

Closes #1735

Reviewed By: @scannell

Differential Revision: D1168992
Final method should report itself as final

This seems to be isolated to the case where an interface declares a method
(without final), an implementer implements it as final, and an abstract
subclass of the implementer declares it is implementing the same interface.

Closes #1758
Closes #1524

Reviewed By: @fredemmott

Differential Revision: D1169289

Pulled By: @ptarjan
kill userland hdf functions

I'm trying to kill HDF in place of INI. I really hope people aren't actually using this format from userland.

Reviewed By: @sgolemon

Differential Revision: D1168352
Add a WaitH<T> type to the type system

It's a subtype of Obj<=WaitHandle where the type we'll get
from joining / await is known.  This is for doing better type
inference on async functions.

Reviewed By: @edwinsmith

Differential Revision: D1166843
Warn when first arg to call_user_func is an object with no __invoke

Slight non-optimality: the message should say call_user_func_array if
you're making this mistake with that function, but that would take a
little extra effort (looking at the active VM frame) and we're already
getting it wrong in other situations.

The error message doesn't match PHP, which says "no array or string
given". I'm going for more information rather than perfect matching.

Reviewed By: @ptarjan

Differential Revision: D1170508
Prevent 'quit' from entering ~/.hphpd.history

This is the silliest way to do this, but it's the cleanest.  I
find it annoying to have 'quit' in my hphpd history, so filter them out.

Reviewed By: @jdelong

Differential Revision: D1171598
Move Stats::emitInc() to translator-x64.cpp, don't use rAsm

Stats::emitInc() was x64 specific. Move it to translator-x64,
and rewrite it without using a scratch register; You can directly
access thread local things at known displacements from FS.

Reviewed By: @swtaarrs

Differential Revision: D1170888
Use rCgGP instead of rAsm in cgMod().

One less explicit use of rAsm.

Reviewed By: @ottoni

Differential Revision: D1171140
Fix a bug double closing a UserFile

Destroying a closed file should be a no-op.

I think we need a bigger fix here (all the methods should check for closed),
but I want to fix the tests first, and then look into the exact behavior
later.

Reviewed By: @ptarjan

Differential Revision: D1172002
Fix VariadicByRef in repo mode

- VariadicByRef didn't work in repo mode

Reviewed By: @markw65

Differential Revision: D1168099
Rename curOpd to curPhysLoc

So that the method name matches what it returns.  I think this is
left-over from when PhysLoc was called Operand.

Reviewed By: @edwinsmith

Differential Revision: D1171247