Fix some bugs when CreateCont's FunctionSuspendHook throws

Summary: When the JIT is on, it leaks the continuation object.  With or without
the JIT on, it was tearing down a frame had already been teleported to the heap
(e.g. the ExtraArgs struct).  (With EnableObjDestructCall on this should
presumably be able to segv by double-freeing---but barring that I'm not sure
how the generator would be reachable yet.)

Unfortunately fixing the leak confuses refcount opts into thinking there /is/ a
leak.  I'm not sure whether we still inline "outer generator" functions---if
not it's not worth running refcount opts in any translations that contain
CreateCont.  Even if we do, we have way fewer generators than we used to, so
let's just give up on the pass when we see this opcode.

Reviewed By: @swtaarrs

Differential Revision: D1709115
Fix suspend hook during Yield and YieldK

Summary: Check the surprise flags before we do anything else, so we don't need
the unusual catch block usage.

Reviewed By: @bertmaher

Differential Revision: D1709193
Use makeExitSlow in binaryArith, SetOpL, IncDecL

Summary: It was doing the same thing manually.

Reviewed By: @alexmalyshev

Differential Revision: D1709117

Signature: t1:1709117:1417241570:6e3a63ba1bce8030fdd51b05f6d1fbf0ef8129a6
Restructure FPushCtor{,D} to not use unusual catch blocks

Summary: Also makes it raise errors in the same order as the interpreter.

Reviewed By: @alexmalyshev

Differential Revision: D1709254
Remove catch blocks that pass 'extra spills' to makeCatch

Summary: The makeCatch with extra spills is suspect, because if you spill to a
different depth than your marker, the unwinder won't see the values.  After a
bit of digging around, the current use cases started to make some sense to me,
though: it looks like we're mostly using this trick to tell things to the
refcount validator about what values are consumed on the catch (and in the case
of FPushClsMethod it's actually kinda to lie to it, because the stores it sees
are not actually visible to the unwinder, because they're below the top of the
stack, and we actually do end up with a mismatched stack depth after its
SpillStack).

I don't think that this diff is a fundamentally better way to do this vs doing
this work in catch traces somehow.  And I could also imagine us switching back
again later if we change things so we always re-enter at the maxStackCells
depth (so we don't need the special updateMarkers when we're using prelive
actrecs before advancing bcOff, among other things).  Also, after this change
the unwinding code here is still much more subtle than I'd like (although maybe
in slightly fewer ways---since only the updateMarker/arPreliveOverwriteCells
mechanism is going on now).

But I think that there are a couple things to recommend the change for now,
though: the fact that sometimes the makeCatch 'extra spills' made things
visible to the unwinder and sometimes it didn't seems too surprising---either
it should always work or we shouldn't have it---so this diff removes the whole
mechanism; putting these stores in C++ should save a marginal amount of
generated code size in unwind blocks (meh); and most relevant for what I'm
doing: making these catch blocks 'simple' fits them more easily into the
automatic-generation of catch blocks thing, which we need to make catch block
in-states (except stacks for now) always come from right before the
instructions that actually can throw.

Reviewed By: @markw65

Differential Revision: D1709295
Remove NewPackedArray (and fpushCufArray optimization), neither happen anymore

Summary: This code is dead, since NewPackedArray is now only used for arrays
larger than kPackedCapCodeThreshold (which is huge).  We probably should
consider reimplementing the fpushCufArray optimization to work with the new
InitPackedArray scheme (we may need to add some kind of BlessPackedArray opcode
to bag up the values if we want to do the optimization at parse time still).
That seems kinda like a lockdown thing---I will make a task and reference this
diff as a starting point/reference if folks are ok with removing it for now.

Reviewed By: @markw65

Differential Revision: D1709296

Signature: t1:1709296:1417725906:8315ff5dbeb5ff536575d253e1e626294633e5f1
Only compile ClsCnsD into literals for persistent classes

Summary: If the class is not persistent or a context parent, we're most likely
in non-repo mode (sandboxes), where this could lead to code that always
side-exits if you're editing the file that defines the class.  Mainly removing
this is just to simplify the code though (this code path is difficult to test
and shouldn't buy anything for repo mode, so let's remove it).

Reviewed By: @bertmaher

Differential Revision: D1709411

Signature: t1:1709411:1417642010:81e0c256e305d96559e94bf4c5388397caaa8312
Make ClsCnsD use irb->ifThen instead of its "special side-exit" block

Summary: I think we didn't have ifThen yet when I first added this makeSideExit
junk to ClsCnsD.  This does the same thing, but is simpler.  That DelayedMarker
crazy-stuff can go away too.

Reviewed By: @bertmaher

Differential Revision: D1709418

Signature: t1:1709418:1417500394:13ea94d551c02146a4bb3f8aaabb5189bd4f37d9
Use ifThen instead of makeExitWarn in Div and Mod

Summary: No more need for makeExitWarn.

Reviewed By: @bertmaher

Differential Revision: D1709440
Use ifThen to implement strTestResult exits in ht-minstr

Summary: Simplifies the code in emitSideExits.

Reviewed By: @alexmalyshev

Differential Revision: D1709457
Fix bug relating to m_curWhere in ir-builder (by removing m_curWhere)

Summary: When you pushed a block without providing an iterator, it would set
m_curWhere to the back of a block instead of using folly::none, which was
presumably just a bug.  (It breaks things when appendInstruction needed to make
new blocks.)  But apparently nothing needs this curWhere stuff after D1709457,
so instead of fixing it we can just delete it.

Reviewed By: @swtaarrs

Differential Revision: D1709556

Signature: t1:1709556:1417468647:69af083ae52e3645856286a7526d37ad70471d57
Refactor builtinCall code

Summary: A few changes to try to make the code easier to understand; mostly
splitting things into subroutines and a helper class, and removing some
redundancies.  Also changes param coerce exit creation to use ifThen, and not
emit an eager reg sync before the ReqBindJmp (it's unclear why it was doing
that)---instead use makeExit to make the exit.

There is one functional change here that maybe I should undo---this moves part
of the coerce exit from frozen to unused.

Reviewed By: @paulbiss

Differential Revision: D1710649

Signature: t1:1710649:1417817722:6b6966d0c93070b7b7a5c37d13c2a628cb8c62da
Fix some interpreter vs. jit discreptancies for builtin call decref orders

Reviewed By: @markw65

Differential Revision: D1713937

Signature: t1:1713937:1417568877:a05259e8ab8e3d4f44d23d7b2b27a1473cf498e5