Update folly
more macosx warnings

- more warnings from macosx OSS
Remove Variant::swap (unused) because TypedValue::operator= is scary

TypedValue::operator= is potentially dangerous when you don't
know where the TypedValue is actually living.  The reason is it copies
the m_aux from the rhs over the m_aux on the lhs, so if your
TypedValue happens to live inside an HphpArray you can apparently
break HphpArray invariants.

Since we still often cast TypedValues to Variants when they live in
HphpArrays, using TypedValue::operator= inside of Variant needs to be
forbidden.  It also is dubious (probably wrong) in any tv_helpers
functions that mutate externally-owned TypedValues.  This particular
function turns out to be dead code anyway.
Introduce rdtsc, cycle delay primitives.

I keep reintroducing these by hand. My workflow is usually:

1. Have an idea to optimize X.
2. Realize I don't even know if X is important or not.
3. Instrument X to slow it down, to see if it makes a difference in
   perflab.

After this diff, 3 is a simple matter of inserting a call to
cycleDelay(1000) (or what have you) in the path of interest.
Fix names of closures in pseudoMains

The classes were all called Closure$, with the result that attempting
to instantiate one closure could instantiate a different one.
Replicate debugger eval tests in test/quick/debugger. Take 2.

Ongoing migration of tests to the new infrastructure. The old tests stay in place until we have another way to test the client API.
Remove useless change to test/run

Experimental attempt to make sure test output does not contain non ASCII characters is actually completely useless because it sanitizes an integer. Remove it.
Remove bogus assert in bytecode emitter

I hit an array on the debug build when I tried to run the following
program:

  <?php
  function f() {
    for (;;) {}
  }
  f();

This diff removes the offending assert since it is technically possible to
have m_maxStackDepth be equal to 0.
Move type dispatch of ConvCellToDbl to simplifier

As D867556, but with doubles.
Small improvements on conversion helpers

Added some asserts, took out some unnecessary checks.
Make HHVM's command line parsing closer to Zend

This diff makes some tweaks to how HHVM handles command line arguments
to match what Zend PHP does. This change will allow developers to type
"hhvm foo.php -x" at the command line and "-x" will get passed as an
argument to the PHP application as it would for Zend PHP.

The basic idea is that we detect the first occurrence of either "--" or a
non-option argument. If we encounter "--" first, all subsequent arguments
are passed along to the PHP application (though the "--" token itself gets
swallowed). If we encounter a non-option argument first, that argument
and everything after it are passed along to the PHP application.
Fix spilling bug

If we spilled a FuncCtx (pretty unlikely), we treated the class/this
portion as a type, and only spilled/restored the low 32 bits:

   0xb23ad54:    mov    %r13,0x10(%rsp)
   0xb23ad59:    mov    %edx,0x1c(%rsp) # rdx contained a $this pointer
   0xb23ad5d:    mov    %r14,-0x10(%rbx)
   0xb23ad61:    mov    %r15d,-0x4(%rbx)
   0xb23ad65:    add    $0xfffffffffffffff0,%rbx
   0xb23ad69:    lea    (%rbx),%rdi
   0xb23ad6c:    callq  0x33f68f1 <HPHP::assertTv(HPHP::TypedValue const*)>
   0xb23ad71:    mov    0x10(%rsp),%rdx
   0xb23ad76:    mov    0x1c(%rsp),%ecx # restored here
   0xb23ad7a:    movq   $0x0,-0x8(%rbx)
   0xb23ad82:    mov    %rdx,-0x20(%rbx)
   0xb23ad86:    mov    %rcx,-0x10(%rbx) # and written to the new actrec here
   0xb23ad8a:    mov    %rbp,-0x30(%rbx)
   0xb23ad8e:    movl   $0x0,-0x14(%rbx)
   0xb23ad95:    add    $0xffffffffffffffd0,%rbx
Make continuations cloneable

Continuations would throw before if you tried to
clone them. This restriction has been lifted.
Clean up how the DebuggerDummyEnv is set up and torn down

A recent diff called my attention to the logic in enterDebuggerDummyEnv()
and exitDebuggerDummyEnv() and I noticed it didn't look quite right.

The first time enterDebuggerDummyEnv() is called it creates a frame on an
empty call stack, but then exitDebuggerDummyEnv() does not correctly tear
down this frame and null out m_fp and m_pc, and this leads to subtle issues.
For example, invokeFunc() checks if m_fp is null to decide whether to call
enterVM() or reenterVM(). I found a case with the "flow_gen_excep.php" test
where invokeFunc was incorrectly calling reenterVM (because m_fp hadn't
been nulled out) and it was pushing bogus VM state info into m_nestedVMs.
This in turn was causing the logic in CmdNext::onBeginInterrupt() to get
confused when comparing the original stack depth with the current stack
depth.

This diff updates exitDebuggerDummyEnv() to correctly tear down the frame
and null out m_fp and m_pc, and it updates enterDebuggerDummyEnv() to
assume the callstack is always empty (which should be the case). I've also
beefed up the asserts in both of these methods.
Push modular division down to codegen

InterpOne sucks. Let's see if we can do this right.
Support for yield k => v;

Updates continuations to allow yielding of a key-value
pair from a generator. Adds bytecode instructions (PackContK,
ContKey) for using the new feature, and adds IR instructions
(ContUpdateIdx, ContIncKey) to help get it down to the metal
(in particular, ContIncKey attempts to keep the current use-cases
as fast as possible).
Convert a few tvFoo functions to take parameters by reference

Since TypedValue::operator= is dangerous, something like
tvTeleport is usually what you want to use, but it doesn't work with
temporary TypedValues (e.g. return values of things like make_tv or
cellAdd), because it took the arguments by pointer.  This also means
we can change it to take parameters by value later without updating
callsites.  This diff does the tvDup family and changes tvTeleport to
tvCopy.  I'll gradually get the other ones done, but I just need these
for now to work with temporaries for changing SetOp to not use Variant
arithmetic.
Functions for basic php arithmetic operators in tv_arith.h @override-unit-failures

Deletes operator overloads on variant for the same and points
bytecode.cpp at them.  Also fixes one known accidental deviation from
zend.  These functions take Cells by value because it seemed to make
sense---I'll likely convert the various functions in the new
tv_conversions.h (and tv_comparisons.h) to do the same but in another
diff.
Fix a crash when dividing INT64_MIN by -1
Remove base parameter from tvCastToInt64InPlace

Nothing uses it, and it means we can't as easily drop
folly::to for int-string conversions into these guys, which I'd like
to try later.  (Non-base-10 conversions are probably much rarer so
it's fine to have different code, I think?)

Also removes tvCastToInt64 and ports its single callsite to cellToInt.
I plan to move the tvCastTo*InPlace to tv_conversions.h (probably
cell-based functions) in upcoming diffs.