cleanup lookupFunc

This func took 2 params and ignored the second one. While I was there I made the functions call eachother. Hopefully inlining is smart enough to let me clean this code.

I got a bit carried away, but I think this is better.
PolicyArray initial review

PolicyArray splits the ArrayData implementation in two parts. ArrayShell implements the baroque ArrayData implementation in terms of a much smaller statically-bound core that concerns itself exclusively with the storage strategy for the array. This way the two aspects can be worked on separately, and different stores can be easily plugged into the given ArrayShell.

To give a better perspective, the featured SimpleArrayStore has about 340 lines all told (including solid documentation), whereas ArrayShell has some 1100 lines. The shell can be reused with other stores of unbounded sophistication. The store needs to implement only 22 primitives, some of which are trivial. Basically a new store implementation saves 1100 of difficult-to-get-right lines of code right off the bat, and only needs to focus on implementing 22 well-defined primitives.

Things to watch for when reviewing:

- Is the store API small/expressive enough? What should be added/removed?

- Are various forms of duplication present? If so, how could code be factored better?

- Any subtle change in semantics from HphpArray and friends that should be minded?

Known issues:

* Currently ArrayShell is defined as:

  class ArrayShell : public ArrayData, private SimpleArrayStore { ... };

when in fact it should be:

  template <class StorePolicy>
  class ArrayShell : public ArrayData, private StorePolicy { ... };

Extenuating circumstances related to allocator design prevent use of templates at this point. I'll work on these in parallel with the review.

* growNoResize is almost always prefaced by a test-and-grow. This sequence should be encoded in a function.

* The growth policy is spread all over the place in a subtle form of duplication.

* The current store design makes almost no effort to be particularly efficient.
interpOne instructions that fail at code-gen

This avoids running to whole tracelet with a backup, slower engine
(interpreter or Tx64).

This will also help with the ARM port: we can initially CG_PUNT on all
IR instructions, and add support for them incrementally (without
sending the whole tracelet to the interpreter).
function and constant fallback for namespaces

It turned out a lot of the namespace stuff still worked. The biggest thing for the first pass is that we don't fallback to the global function or constant if there isn't a namespaced one.

Also, when a constant has a ##\## anywhere in it it throw an error when it isn't defined, instead of assuming the string.
Add missing check for InterpOne following a CG_PUNT

I forgot this check in my original diff: we need to make sure that
bytecode instruction that cause the CG_PUNT has support for InterpOne.
Just a couple of instructions don't have InterpOne support, so this
was not causing any problems.  But the check should be there anyway,
for when we start porting to other ISAs.
clear aliases between namespaces
allow \ in function types

I looked at all the other uses of ##ident## and I think they are correct to not allow namespaces but we'll see.
Rename IRInstruction's iid property to id.

I called it iid because id was taken by the linear-scan specific
'id' field, which really was a linear number and could change.
Now that we have LifetimeInfo.linear[inst], we can use the name
id consistently between SSATmp, IRInstruction, and Block.

This in turn allows StateVector to be one iota simpler.  Renamed
count to numIds while I was at it.
loosen catchable error message

zend emits a special error for typehint violations. We aren't going to be string compatabile with this as they emit 2 line numbers and files. Lets just make sure we fatal at the same point in the test.
Add a register-allocator-validator.

This adds a checkRegisters() function so we can assert if the register
allocator botched something.  Our IR already must pass SSA rules after
register allocation, so its enough to scan the code in dominator
preorder, keeping track of what SSATmp is in each register and spill-slot.
Then at the point of each use, we can assert that the register/slot assigned
to the input tmp actually contains that input tmp.

While I was at it, I moved checkCfg() and checkRegisters() to the new
check.cpp file, and factored out findDomChildren().

Also, this checker failed on a tracelet that used exactly 16 slots due
to the +1 fudge factor added by LinearScan::preAllocSpillLoc.  I fixed
this by changing the meaning of spill slots; now they are logical
slot numbers, and we have a dedicated spillSlotOffset() function
to compute the offset from RSP.  This can be updated in the future
to handle more than just the preallocated spill slots.
Move ir inlining tests to slow/ir_inlining, add case for bug @mwilliams found

Mark hit a bug that aravind already fixed where we didn't set
stackDeficit to zero after ending an inlined call.  Adds the repro
case and moves all the tests to slow.
Don't hoist LdLocs to the top of tracelets.

We have separate GuardLoc instructions now.  This was
originally intended to be an optimization (and LdLoc was
simultaneously acting as the guard back then), but now that
Rematerialization is off (and since we don't do a DCE after register
allocation anyway) I am doubtful.
kill dead code

When trying to figure out what this was I figured out it wasn't anything.
Be less explicit about namespace

I'm getting ready to kill the VM namespace. I'll be doing small cleanups first.
Add hack to register checker for rbp

Rbp is allocated just as weirdly as rbx.  I was able to hit
this assert on a inlined function that didn't eliminate the ActRec
(there are ReDefSP's that consume rbp).
Delay registration of SIGCHLD handler until after lwp fork

I think the cause of our issues with random failed-to-exec
errors is this SIGCHLD handler.  When the parent process asks a light
process to do a waitpid operation, we now can get EINTR for two
reasons.  It used to use signals only for implementing timeouts with
SIGALRM, but now it appears possible due to the SIGCHLD.  This could
lead us to report the waitpid as failing---which it looks can have
ExecFuture thinking running==false and reading the exit code as -1.

Also, now that we have a SIGCHLD handler (are we sure we want to keep
this?), using waitpid() without an EINTR loop is probably similarly
broken in the parent process.  (Also, isn't it basically incorrect to
use wait functions without an EINTR loop in general, though?)  I
didn't add an EINTR loop in do_waitpid in this diff because it's using
signals for timeout (it really should be checking a volatile
sigatomic_t that gets set by the handler, though)

Also, this means using Process::Exec is suspect in general.  All uses
looked like debugger or tests only (and when hphpc runs hhvm in a
subprocess), so I didn't nuke them (yet).  I deleted some random
network.h dead code that uses it, though.
Reduce number of threads during initial hhvm startup

Before we've jitted the first bit of the TC, having so many
threads leads to a pathological situation: we accept a bunch of
requests (135) and have all of them running in the interpeter,
starving the JIT thread that is trying to make them all go faster.
(Perf record of a machine in this situation shows the vast majority of
the time in dispatchImpl, SrcDB::find, and enterTC).  This diff tries
to solve this by limiting the number of threads to the number of cores
for the first N requests.
handle closing tag in ?>

I wanted to get closer to zend's implementation but they seem to do scanning and parsing at the same time. We don't have the state of the parser when the scanner sees the ##?>## token. I think this is the next best thing if we don't want the refactor of D808985
absorb comments on namespaces

This test didn't really intentionally test this, but it caught us not eating comments on namespaces.

I don't understand the difference between ##ParserBase## and ##Parser##. Maybe this belongs here? It needed to be here to have access to ##pushComment##.
Disable test/zend/good/ext-standard-strings/setlocale_basic2.php

It's failing/flaky.