Fix a bug in qmljs_set_element and improve it's performance

Avoid expensive function calls for setting indexed properties
in the common case. The spec requires us to read the value before
writing it to check whether it's empty. In that case we need to
fall back to the slow implementation that checks the proto chain.

Change-Id: If278ba81f170d35c18135d2f8661459262e7e606
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Implement Lookup::indexedSetter

use this instead of the generic runtime method. This gives
around 10% speedup for array heavy Javascript such
as crypto.js.

Change-Id: Ic8f478c5b18893f2ef49e3f658b1ef24ae22e64f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Rename some files

Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to
qv4value_inl_p.h.
It makes more sense to have the class definition in the file
that is named after the class and move the inline methods into
a _inl file. Doing this now, as I expect we'll be needing a few
more _inl files soon.

Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Move ArrayElementLessThen to qv4arraydata.cpp

This is the only place the class gets used.

Change-Id: Iebb0cba7af30c1b2da68f67596c349d5e20c5053
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Get rid of the SafeObject class

Having SafeValue is enough, and we can pass an ObjectRef instead
of a SafeObject * for function calls.

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

Remove SafeValue, it was used to port over to an exact GC. Since
we now have that, we can now safely merge it with QV4::Value
again. Also rename SafeString to StringValue for better naming
consistency.

Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Move Encode into qv4value_p.h

This is where the class logically belongs.

Change-Id: I366013aad2c9b6324ae82ab5f3250f1d9c719da4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Disentangle some includes

ScopedValue should require less dependencies. Hopefully we can then
move it together with the main class definition at some point (ie.
move ScopedValue int qv4value_p.h; similar for the other types).

Change-Id: Ie7b31715cb718a90dba40845c7ae785a29855062
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Move ValueRef into qv4value_p.h

The ref class belongs logically together with the value.

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