Use a separate field to keep track of allocations for the purpose of out of memory checking.

When jemalloc is used, the code for tracking out of memory situations conflicts with the code that figures out how much memory is actually in use. To solve this, I've introduced a new usage counter field in the memory manager. Presumably, this counter is less accurate than the one that is maintained by the jemalloc specific code in MemoryManager::refreshStatsImpl, but this should not matter because it's only role is to trigger an out of memory check, which is done using the usage field maintained by refreshStatsImpl. If this check is triggered, the new counter is updated to the presumably more accurate value.

Reviewed By: @edwinsmith

Differential Revision: D994503
Implement date_parse_from_format

Ended up doing a little of refactoring around DateTime too.

This is for a fatal in Laravel.

Reviewed By: @JoelMarcey

Differential Revision: D995643
Make FrozenVector a collection

Add FrozenVector as a collection.

Enable the following:
  * frozen vector literals
  * casting fvs to array and bool
  * array_key_exists and isset with fv

Reviewed By: @paroski

Differential Revision: D988612
Implement PharData::extractTo

This is needed for composer to install the dependancies for phpunit.

I also upgraded composer while I was in there.

Reviewed By: @JoelMarcey

Differential Revision: D1005174
Fix macro typo in native.h

Fix macro typo in native.h

Reviewed By: @JoelMarcey

Differential Revision: D1005290

Pulled By: @scannell
Change the block labels in prettyprint output to B instead of L.

Reviewed By: @ottoni

Differential Revision: D1005392
Split EndCatch into TryEndCatch and EndCatch

EndCatch was supposed to be terminal in some catch traces but not in
other. We know which is which at compile time, so now we use TryEndCatch for
the non-terminal case and EndCatch for the terminal case.

Reviewed By: @edwinsmith

Differential Revision: D1005802
Reenable FCall type prediction in opt builds, fix KindOfRef predictions

This was (we think) accidentally disabled in non-debug builds a long
time ago, and some type shuffling I did a while ago broke KindOfRef
predictions. RuntimeType expects an inner type of KindOfAny instead of
KindOfNone.

Reviewed By: @kmafb

Differential Revision: D1004691
Assert instruction input flavors before translating

We don't have a translation for Box, so we always interpOne it and all
of its inputs are marked dontGuard. If the input to the Box was produced in a
previous tracelet, this means we won't know its type in the jit, and it was
upsetting the code figuring out the output type of the interpOne. We know from
the bytecode that the input is always a Cell, so assert that before translating
the instruction.

Reviewed By: @ptarjan

Differential Revision: D1006328
Get ARM disassembly printing in printir:2

I'm getting to the point where it's helpful to see the ARM code being
emitted, and this is the most natural way to hook it up.

There's a little wrinkle here in that sometimes (e.g. smashable jumps),
there's stuff in the TC that isn't executable code. In this case the
disassembly is either "Unallocated" or some nonsense instruction. We
could avoid this with sufficient metadata, but I'm not convinced it's
necessary yet. (FYI, this pattern -- data embedded in code -- is common
in ARM code, to judge by the vixl assembler's inclusion of an
abstraction to do this very thing.)

In the process I had to convert vixl's printing facilities to use
std::ostream instead of FILE*. I converted it to use folly::format
instead of fprintf as part of this.

Also added an --arm flag to hhvm_wrapper.php to make my life easier.

Reviewed By: @edwinsmith

Differential Revision: D1006435
Add PHPUnit to list of framework tests and make a few other changes.

Wanted to add PHPUnit to our list of frameworks to test. While doing so, I made a few extra changes such as making the hhvm build be in JIT mode. And re-ran the tests again to get a new baseline and summary file.

(Ignorning conflict markers because symfony uses 7+ = signs in some of their tests, which causes conflict marker errors here: diffusion/E/browse/admin/scripts/git/hosting/hooks/update.d/430.conflict_markers.sh)

@EntNotFoundException

Reviewed By: @ptarjan

Differential Revision: D1006290
Fix the tracelet region selector to correctly end a trace

There were a few situations where the bcOff used in the ReqBindJmp at
the end of the trace was either for the wrong function or the wrong instruction
in the correct function. We can now explicitly pass it into HhbcTranslator::end
to make sure it's correct all the time.

Reviewed By: @bertmaher

Differential Revision: D1005831
Moving a few more helpers to translator-runtime

Found these while poking around tx64...

Reviewed By: @swtaarrs

Differential Revision: D1006852
make debugger work with old editline

These functions are stubs in editline anyways, so in order to support Ubuntu 10.04 using editline 2.11-20080614-1build1 just ifdef them out

Reviewed By: @sgolemon

Differential Revision: D1006813
Don't interpOne nopped out BoxRs

BoxR is always interpOned. If its nopped out, we should skip it.

Reviewed By: @ottoni

Differential Revision: D1006405
Test case for reflowTypes with hottrace PGO

Thought it would be good to check this in since it was useful
in diagnosing a sandbox bug.

Reviewed By: @ottoni

Differential Revision: D1007313
Suppress gcc4.8 warning from double-conversion

double-conversion uses this typedef as a sort
of a static assert for the template.

Mark it as explicitly unused so we don't get
a warning.
Increase maximum template depth
Revert "Get ARM disassembly printing in printir:2"

This reverts commit 23745b0488b81e0bc92ed45661b67cd4ec1f784d.

It's templates all the way down
added "Attempted to interpret unknown debugger command as PHP" into the error message

The error message for a bad command is misleading. Added "Attempted to interpret unknown debugger command as PHP" into the error message

Reviewed By: @mikemag

Differential Revision: D989538