Fix pcre cache to not fatal when full

Summary: So pcre cache can only hold 96x1024 items, when we hit full we raise an
error. From what I can see there isn't a good reason we can't just
continue.

If one is doing 98,304 unique regular expressions you probably don't
care about regular expression caching.

Since we're using AtomicHashArray we can't purge anything without adding
a lock and we'd probably want to do LRU rather than what PHP does which
is FIFO eviction.

Also changed the code to check Folly's full parameter rather than
relying on calling .size().

Reviewed By: @ptarjan

Differential Revision: D1168192
Optimize checks in iter_next_packed also

Summary: I realized I could play the same trick as D1340787 for
iter_next_packed.

Reviewed By: aravind

Differential Revision: D1343589
Create a CodeGenFixups class

Summary: Create a CodeGenFixups class, to hold temporary information that will eventually be put in global tables. Put m_pendingFixups, m_pendingCatchTraces and a newly created m_pendingJmpTransIDs there.

The goal is to have a single place to hold information that may need to be fixed up if we modify the generated code before committing it (eg by relocating it, or by peephole optimizations). Also, these are things that must not go into the global tables if we end up rolling back.

Reviewed By: @ottoni

Differential Revision: D1347532
Fix clang build

Summary: thats it

Reviewed By: @dariorussi

Differential Revision: D1348180
Get rid of SmashTarget

Summary: The SmashTarget is a short lived, malloced data block that gets passed
to handlePrimeCacheInit, telling it how to smash the call. The information it
contains is the address of the movq instruction that needs smashing, and the
return address of the handlePrimeCacheInit method.

We can find the return address by inspecting the stack, and then we can
pass in the offset from that to the movq instead of passing in the address
of a SmashTarget.

In addition to avoiding the malloced data, this has the nice effect of making
all the code position independent too.

Reviewed By: @mxw

Differential Revision: D1348201
Fix crash on missing trait in RepoAuthoritative mode

Summary: At some point we stopped checking up front that
traits exist in RepoAuthoritative mode. But we still assume
that Unit::lookupClass will find them, and crash if not.

This checks every trait, and fatals if it doesn't exist.

Reviewed By: @dariorussi

Differential Revision: D1348353
Fix for Xenon crash, change order of decRef between locals and $this

Summary: Making lifetime of $this longer so that a stack walk from Xenon can still find the class and a somewhat usable $this

Reviewed By: jan, mwilliams

Differential Revision: D1343247
added 'Z' format string for pack/unpack

Summary: Since PHP 5.5 there is a 'Z' format string for (un)pack with equivalent functionality to 'a'.

HHVM has not implemented this yet.

See: http://docs.hhvm.com/manual/en/function.pack.php
Closes #2713

Reviewed By: @ptarjan

Differential Revision: D1345185

Pulled By: @JoelMarcey