Add support for translations in pure QJSEngine based environments

Re-add the QScriptEngine::addTranslatorFunctions API that brings back
qsTr() and friends to pure QJSEngine based environments.

The auto-test were also ported where applicable.

Change-Id: Ib03e3495ef09eeea9e4c8341061499768caed307
Sanity-Review: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 RegAlloc: change life-time intervals from closed to half-open.

There are two changes in this patch, that go hand-in-hand. First, when
re-numbering the statements in order of occurrence in the scheduled
basic-blocks, the (new) position is not stored in the statement itself,
but in the LifeTimeIntervals class. This makes it possible to re-use
information gathered during SSA formation or optimization.

The re-numbering itself has also changed, resulting in some minor
changes to the life-time interval calculation. The new numbering
is described in LifeTimeIntervals::renumber(). The reason is to make it
easy for the register allocator and stack-slot allocator to distinguish
between definition of a temporary and its uses. Example:

  20: %3 = %2 + %1
  22: print(%3)

If the life-time of %2 or %1 ends at 20, then at the point that %3 gets
assigned, it can re-use the storage occupied by %1 or %2. Also, when
both %1 and %2 need to get a register assigned (because they were
spilled to the stack, for example), %3 should be allocated "after" both
%1 and %2. So, instead of having a closed interval of [20-22] for %3, we
want to use an open interval of (20-22]. To simulate the "open" part, the
life-time of %3 is set to [21-22]. So, all statements live on even
positions, and temporaries defined by a statement start at
statmentPosition + 1.

Change-Id: I0eda2c653b0edf1a529bd0762d338b0ea9a66aa0
Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 RegAlloc: simplify algorithm after introducing half open ranges.

Now that all ranges are half open, and temporaries are defined at the
end of the (defining) statement, the linear scan algorithm get simpler.
Specifically, when allocating a register for a temporary, the check if
the temporary is defined or used is not needed anymore.

Another simplification is the handling of phi-nodes. Previously they
shared the same statement number as the first "real" statement in a
basic-block, and special checks were needed to handle them. Those are
now gone too.

Change-Id: Ia4266ea5ede8c2aff0e70c6579fba9575c6719fb
Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>