Disable the stack slot allocator

The allocator doesn't work correctly and sometimes assigns
temps with overlapping ranges to the same stack slot.

This fixes crypto.js and qt quick controls autotests running
with the interpreter.

Change-Id: If3d0f90edfac669f89da5174cd58eb345d48f2b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Rework exception handling

Start the work to remove c++ exceptions from our JS
exception handling. Rather rely on engine->hasException.
Check the flag after we return from any runtime call in the
JIT.

Implement new try/catch handling code in qv4codegen and
for the JIT that doesn't rely on exceptions. As an added
bonus, we can remove the Try statement in the IR.

Change-Id: Ic95addd6ae03371c43c47e04cac26afdce23a061
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Rework IR code generation for try/catch/finally

Simplify the generated code. Add a special block to catch
exceptions thrown inside a catch() statement.

store the exception on the stack when entering finally and
rethrow it at the end. This ensure correct behavior for
break/continue/return statements inside finally.

Don't check for exceptions after calling push_catch_scope
and pop_scope in the JIT'ed code. This can lead to infinite
loops when throwing inside an exception handler.

Change-Id: I67e9325794e2fd25b0773b21e02fbaadb43faab0

Change-Id: Ic1ea9c0c43eec1d49177dc1ab4552a1da04e96fe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Implement new exception handling for moth

Add the required instructions and check for
exceptions in the engine before storing any
results.

Change-Id: Ibfaf904d659859e8012920270825211ba202c63d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Exit the codegen in case we have thrown a parse error

This makes sure we get the right exception in the engine
in case there are multiple parse errors in the code, and
avoids running into assertions.

Change-Id: I8a11c6d043d09caf57a3e4c6aad5834e99cc1761
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Properly propagate parse errors

Replace all try/catch statements used when parsing
with checks for engine->hasException.

Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Correctly catch exceptions in the API methods

Replace all C++ try/catch statements with
engine->hasException checks.

Change-Id: I7c04e02664ec6b4d256478c6e18f6b20ae4f7bc1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Avoid side effects when en exception has been thrown.

We don't want to check for exceptions after every single
line on our runtime methods. A better way to handle this
is to add the check in all methods that have direct side
effects (as e.g. writing to a property of the JS stack).

We also need to return whereever we throw an exception.
To simplify the code, ExecutionContext::throwXxx methods now
return a ReturnedValue (always undefined) for convenience.

Change-Id: Ide6c804f819c731a3f14c6c43121d08029c9fb90
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Protect write accesses to objects

Don't write to objects if we have a pending exception to
avoid any side effects.

Change-Id: I9f93a9195a652dbae7033cc6ebb355d5d86e9b5e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix the remaining try/catch statements in C++

Change-Id: I2421dc48fb271b66bd476fb16a32a88fcc4c5177
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Cleanup: Remove now unused throwInternal() method

This method was throwing a C++ exception in the old exception
handling and is not needed anymore.

Change-Id: If67696cdbd260225ae60720a1035941fe7e1e650
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove qv4unwindhelper class

This class is not required anymore to generate stack traces, as
we now store the required information in the JS context stack.

Change-Id: I3893c805ca89dda70efde07fdd120e7dfaf3639f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix interpreter without computed goto and new exception handling

At the end of an instruction, don't break and run into the unreachable assert,
instead use "continue" to get to the top of the for (;;) loop to resume
execution.

Change-Id: I544104e76cb7a547c050714da1c67cde6f11ba04
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Disable DST related locale test temporarily

We prioritize getting other fixes into QtQml right now, so skip these tests.
According bug is filed.

Change-Id: I9b824e41d2164906b22282e75aa80a69a4ce5652
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Add references to Animators from the QML Type Reference

Task-number: QTBUG-34221

Change-Id: Iaa1d7f4dd70d2d8150e8360545a33ac984e6bebd
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Track size changes from transform animators.

When the size changes, so will most likely also the transform
origin, so we need to check for it and update accordingly.

Task-number: QTBUG-34140
Change-Id: Ic3d6c1ac599db499ab196a8cbe550308a75e837f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Seed Math.random in v4

Task-number: QTBUG-34105

Change-Id: I6cb5c8b80f158677aaf334feeaa206a5eaf9cfc3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add a constant table to the compiled data

This will help simplifying and speeding up the moth generated
code.

Change-Id: I1b87c4b25dbfa6ce2e8a0b77e526f7fc063b0de2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Move constants into the compiled data for the interpreter

This makes it possible to remove the Value stored as
part of the instruction stream. Reduces the size of the
instruction stream and will allow to optimize Param lookup.

Change-Id: I23dab5dbed76bf8d62df7042934064d4676bc43d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove the LoadValue instruction

With the constant table this is exactly the same as a move.
Also renamed MoveTemp to Move, as it not only moves Temps
but also other variables.

Change-Id: I1fccc04314661954179d903519adbc39777395e5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>