Speed up QV4::InternalClass

the old code used QHash to store the id to index
mapping, which got detached whenever a new internal
class gets created.

Replace this with a much cheaper custom made hash table.
The new hash table actually doesn't require a detach for
the first transition to a new internal class. This saves
significant memory and time esp. for very large objects
such as the Qt object.

Change-Id: Id1e3af4db59cff39d44ff1c211d46f37ff117ea6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Some optimisations for QV4::Script

Change-Id: I468288a537a1a2fa4c38eb188c7b026a390fe13d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Don't use a PersistentValue in QHashedV4String

The class is only used on the stack and critical to
performance in a couple of places. This speeds up
some QML benchmarks quite a bit.

Change-Id: Id36682487396d42ddacdc71f7a32792a09318cf9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
A frozen class is also sealed

Change-Id: Ib4c755cc702155a5cd0428901cf0b8256b76b50a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
More correct assertion in QHasheV4String

Change-Id: Id34dcae9c7e52fe0262b4d9480a7307a393226ee
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove an overoptimisation that was only used (wrongly) in one place

Let's simplify this code. The goal is to replace most of the
code in qhashedstring with an identifier based hash table.

Change-Id: I2f9a38ad0bb2f43a2b2b87914823c23ed231f48c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove the symbol optimisation from hashed string

Simplify the code, so we can move over to identifiers later.

Change-Id: I42cb164840ecfd3f765049ab9fa46746a0d4a85b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove a potentially dangerous optimisation

The code could fail in case the hashing would happen to return
the same value for both strings.

Change-Id: I7c256754b38aafd8c49b9fbbd2f01b9cc0346a2b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Get rid of QHashedV4String

This was required while we were using V8, but now
we can simply pass QV4::String pointers.

Change-Id: If6338e4a455d6132fe14e5e603e4fe9e477d1ffb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Introduce an Identifier class

Identifier are now (opaque) pointers. They contain the
string and it's hash value making conversion from Identifier
back to it's string value a no-op.

Change-Id: Ied7e845a981514890ff6a686e0e3e3057e6b6fbf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove some unused code and forward declarations

Change-Id: I2ab2818159c60b199cae4f7573ea47b01a178e7b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Rename IdentifierHash to IdentifierTable

Change-Id: Ifbf9e947c305e33def311b76a38af17dae90b46b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Rewrite identifier table

Use a hand written hash table for the identifiers. This
saves quite some memory, speeds up the table, and allows
converting 8bit strings into identifiers.

Change-Id: Id289764097b50bf6c1fc83b1b8c930b5e62a7538
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Add a replacement for QQmlIntegerCache

Change-Id: Ie3e23e10644ce957a0029e83a43367a2339d5335
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Get rid of QQmlIntegerCache

Replace by the new IdentifierIntHash.

Change-Id: Ib210cd898a30ad3e2f9349387e1a74d92ed5f831
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Convert IdentifierHash to be template based

Make it a template based class, so we can store
more then just integers here and replace more
StringHash'es with it.

Change-Id: I21442d13c6260f184bc7b63a8a58e826699f0c83
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Convert QV8Engine::illegalNames() to use the identifier hash

Change-Id: I436c2a17e417cb311f10290a4cc6e5b728b4b7be
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Move the IdentifierTable into it's own file

This reduces compile time dependencies.

Change-Id: I7e68ec36022fb0b1dcc10be0cc345aa207ea110c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reuse the hash value inside identifier to hash them

Hashing on the pointer value of an identifier doesn't
really make sense. We already have a good hash value
for the identifier, so let's re-use it. In addition, this
allows to look up strings that aren't identifiers.

Change-Id: I9bdb4aa89ae36410f24b3e58c641339e115e4c5f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Don't convert to a temporary QString just to compute it's hash

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