Don't let low_malloc hugify the entire tc

We carefully "enhugen()" portions of the tc. The problem is that low_malloc
maintains a high water mark, and every time it crosses into a new huge page
it marks everything up to the new high water mark huge. Since we allocate the
tc using sbrk, which allocates above the high water mark, the next time
low_malloc extends its arena, we mark the whole tc huge.

This adds some code to update the high watermark around the tc, and adds a runtime option to limit the number of huge pages used by low memory.

Differential Revision: D912684
Fix the build

I rebased past a rename of a private member
Clean up punting to interpreter

There seems to be some strangeness left over from tx64 days. When the IR
took a slow exit trace, it would go through a "retranslate/interpret"
service request, which generated a stub translation that did nothing but
make an "interpret" service request.

I got rid of the BIND_JMP_INTERPRET and RETRANSLATE_INTERPRET service
requests, and replaced them with uses of the INTERPRET service request,
interping a single instruction.

Differential Revision: D927642
Get rid of optional arguments in HphpArray helpers.

This just obscures what's going on and is making refactoring
more difficult.

Differential Revision: D927215
static closures should inherit the late bound class

Mwilliams noticed an "obvious bug" in c_Closure::init, where
it always sets the late bound class to the context class in static
closures.  But it turns out thats what zend actually does.  This
behavior seems like a bug, so we're going to preserve the late bound
class.

Differential Revision: D814837
Add a stress-test mode that forces jitted execution

Sandcastle flib testing may be missing some coverage for the
JIT because tests that fail to get the write lease can execute in
interpreted mode.  Add a runtime option Eval.RequireWriteLease that
forces a thread to block on acquiring the write lease, so all test
code will be jitted.

Differential Revision: D921235
Add CodeGenHelpers[arch] for stateless helpers

Per discussion, create a stateless class for emitter utils that
can be implemented per-platform (to move code out of code-gen and
translator-x64)

Differential Revision: D927917
Hphp part for floats to thrift

Going together with D909976 and D913213.

Differential Revision: D921359
Specialize SetNewElem when base is known to be array

Get rid of the switch-based dispatch on base type for
SetNewElem when we know that the base is an array.

Perflabs look like noise, except for one run that looks too awesome to
be believed:
https://our.intern.facebook.com/intern/perflab/experiment.php?diff_preview_id=2644370

Differential Revision: D927657
Include the null terminator in string's capacity

I want to store the smart allocator size class here, so we
don't need to store it at the front of the smart malloced memory.  (We
can just tell smart_free how big it was, and possibly inline dropping
it on the appropriate free list.)  This isn't necessarily required for
that, but I decided to do it independently to make the changes easier
to think about.  (It's also maybe a marginal step toward not requiring
null terminators on the strings in general.)

Differential Revision: D917550
Move increment_string() into StringData::inc()

After some changes I'm making locally, this will need to be
Mode::Malloc or Mode::Smart depending on the size of the new string,
which is easier to do from inside this same function. While at it,
let's make it reuse the buffer if it fits within the current
capacity().  (This allows small strings to stay small also; although
microbenchmarks on string increments are not particularly impressed by
it.)

Differential Revision: D920271
New StringData::append that uses reserve/escalate

Instead of having all the cases split out, this just goes
through the reserve/escalate paths.  I added geometric growth only to
the Smart mode in reserve (after the capacity check).  This makes it a
little easier to change how strings allocate (fewer allocation code
paths).

Differential Revision: D924293
Draw incision lines in translator-x64.h, delete some dead code

I deleted some dead code, but more importantly, organized the remaining
platform-specific declarations into thematic areas that I think can be
tackled (i.e. moved into explicitly platform-specific modules) as
self-contained units.

My determination of what's platform-specific was fairly loose. If it has
"emit" in the name it is for sure. Note that functionality that only
depends on the TCA type is *not* platform-specific: that was the point
of my diff to separate DataBlock and X64Assembler.

To be honest, I wasn't 100% rigorous on preserving access modifiers.
They're mostly the same, but some may have been changed in the shuffle.
I contend it doesn't matter that much since these members should be
moving to different modules soon, and also this class has so many
friends that most of its "private" members aren't really private as
such.

Because all the rearrangement makes the diff hard to read, here's the
list of declarations/definitions I found to be dead:

- emitDebugPrint, dumpStack, translatorAssert. Not used in the normal
  course of things, but it's possible people have been using them to
  debug; if so, I'll put them back.

- emitReRetransOpt (not dead, but since the definition was just a call
  to emitServiceReq and there's one callsite, I collapsed the chain)

- m_createdTime. It's declared in Translator (and only used there).

- emitIncRef*. These were moved to CodeGenerator earlier.

- toStringHelper. Unused.

- emitChainTo and emitIncCounter. No definition.

- {acquire,drop}WriteLease. We have a different abstraction for this.

- packServiceReqArg with one argument. It's not needed; that template is
  not recursive.

Differential Revision: D929657
Add source location to async functions on the debugger async stack

Add source file and line to async functions on the debugger async stack. This information is only added for async functions which are not actually being executed. Those exist on the normal stack, and their location information is visible there. The location added for async functions which are not running is that of the yield which has caused the continuation to pause.

Differential Revision: D930103
Fix limit on low mem huge pages

The limit was still a bool, so we could only specify a limit
of 0 or 1. Since 1 was working fine, I've dropped the default from 200
to 32, and will test various values to see what works best.

Differential Revision: D929190
Don't use low_malloc for preClass Funcs

They are rarely used at all, and never referenced from the
translation cache, so no need to put them in low memory.

Differential Revision: D930189
Print duration of warmup requests

Differential Revision: D927403
Always use lowercase names when tracking class aliases

I think the current situation is actually correct (we'll just
potentially have extra entries in the multimap), but this makes more
sense.

Differential Revision: D918976
Update Iterable interface, add toArray() method

This diff adds a toArray() method to the Iterable interface, as well as
adding some other methods that were missing from the interface (map(),
filter(), etc). It also deprecates IterableTrait and KeyedIterableTrait,
introduces LazyIterable and LazyKeyedIterable as replacements, and adds
strict versions of the traits called StrictIterable and StrictKeyedIterable.
Finally, it deprecates the view() method (since I want to introduce a new
method named "view" that is semantically different) and introduces lazy().

Differential Revision: D923036
add SplObserver and SplSubject interfaces

- add SplObserver and SplSubject interfaces

Closes #953
Closes #960

Differential Revision: D931324