Make PhysReg(int) private to RegSet

The two register allocators had some remaining offenders. XLS was really
easy to fix (and in fact it made the code nicer), whereas LinearScan
didn't want to go quietly.

There is one substantive difference: in the stress mode where LS has a
reduced number of free registers, the ones at the beginning of the
sequence will be reserved instead of at the end. I could have avoided
that by giving PhysReg::Map a reverse iterator, but I don't think it
matters that much.

Up next: remove PhysReg::operator int().

Reviewed By: @edwinsmith

Differential Revision: D1096303
Move collections into their own namespace (Vector)

We want external developers to be able to use their own collection classes (e.g. Vector, Map, etc.) without colliding with HHVM's native versions.

This diffs moves the Vector class to the HH namespace.

It uses the "autoimport" mechanism in the parser so that the change is mostly transparent to PHP-land, and also modifies the IDL compiler so that class names (in the IDL) can contain namespaces.

i.e. for Vector, we change the class name in the IDL from "Vector" to "HH_Vector", which later gets exported as "HH\Vector" in PHP-land.

Reviewed By: @paroski

Differential Revision: D979471
Delete PhysReg::operator int()

With this, I think the dependency is broken, and we can start using
PhysReg to represent different register sets smoothly, without wrecking
anything.

Reviewed By: @edwinsmith

Differential Revision: D1096506
Add support for IsScalar

Add support for IsScalar in IsType instruction.

Reviewed By: @ptarjan

Differential Revision: D1087810
Check for post test warnings too.

It looks like we fixed the post test fatal problem that joomla was having, but now yii may have post test warnings. For example,

/data/users/ptarjan/fbcode/hphp/test/frameworks/frameworks/yii/tests/./
framework/web/auth/CWebUserTest.php
HipHop Warning: Constant PHPUNIT_COMPOSER_INSTALL already defined in ve
ndor/phpunit/phpunit/composer/bin/phpunit on line 49

Let's see if this can fix that.

Reviewed By: @alexmalyshev

Differential Revision: D1098415
Refactor func.h

Reviewed By: @paroski

Differential Revision: D1075910
Sigh. More post test warning fun for yii.

I love yii. I love yii. I love yii.

Need to check for another type of post test warning, that includes a PHPUnit Exception.

Reviewed By: @ptarjan

Differential Revision: D1098761
Make the user run command output better

The way I was generating the "RUN TEST FILE" commands at the end of the script run or within .errors/.fatals files was not the best. This improves that.

Reviewed By: @ptarjan

Differential Revision: D1098631
Make PhysReg able to represent 64 registers

Finally. PhysReg can now represent 32 GP regs and 32 SIMD regs.

Having the arch() dependency inside PhysReg feels a little strange, but
(a) Map really does need to behave differently depending on the
architecture, and (b) it's really convenient to have Map defined inside
PhysReg. I think it's an okay tradeoff.

In a followup diff, I'll get rid of x2a and have PhysRegs with ARM
register numbers flowing through XLS. It's still going to be a bit messy
because both codegen backends use the operator[] trick to create memory
references from register + offset. The ARM backend uses
vixl::Register::operator[], but the x64 backend uses
PhysReg::operator[]. I'm not yet sure how I'll reconcile this.

Reviewed By: @ottoni

Differential Revision: D1097959
Pass inGenerator flag in RetCtrl and FunctionExitSurpriseHook

Code gen for FunctionExitSurpriseHook and refcount optimization RetCtrl
opcode processing needs to know whether these opcodes were used inside a
generator. They currently obtain this information thru curFunc(). This
information is known statically, so pass it explicitly.

Needed for unified inner/outer generator functions.

Reviewed By: @jdelong

Differential Revision: D1095196
chmod -x runtime/vm/jit/*.{cpp,h}

I don't know why this keeps happening.

Reviewed By: @jdelong

Differential Revision: D1098912