Lookup::lookup should not return a Property pointer

Change-Id: I5c9858f636c199b9cbe7cb2bffa03db14b6e1ae4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
clean up Object::has(Own)Property

hasProperty is now implemented by calling hasOwnProperty
on the proto chain. In addition, it should be slightly
faster and doesn't use API that returns a Property pointer
anymore.

Change-Id: I6312d83ccfed3f0a1a8ec4c72c436a426d6eab44
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove Property * return value from ObjectIterator

The added side effect is that the QJSValueIterator is now
somewhat faster.

Change-Id: I01ba9f2a72a34224f5691130df69a91ab75b72e6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Don't return a Property pointer in Object::advanceIterator

Change-Id: Iac4cb2a2252b18e40455910e51e3e374df7c1e80
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix a small bug in queryIndexed() for StringObjects

The string is immutable, thus queries indexing into the
string data need to return Attr_NotWritable|Attr_NotConfigurable
(see 15.5.5.2 of the ecma spec).

Change-Id: I180d983b04a209c29fcd37b11682999b57bc42fe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Small bug fix

Change-Id: I5c670d898cd7a049de6f8a78d966df1c6fbde2c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fixes to sparse array handling

deleting entries in sparse arrays could lead
to rather unexpected results where values got
moved to wrong indices, as we didn't correctly
update the size_left values in the red-black tree.

Change-Id: If71fcc04d39f257194394cb4f734d0db14b92b69
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Changes to the structure of Property

Put the getter into the regular value, and the setter into
the next value following. Like this we can compress property
data to only use 8 bytes per property for regular properties
and simply allocate two slots for accessor properties.

Change-Id: I330b95dbd583ebc2658fed79d37ac3b53492c0cd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Save memory on array data

Store a simple vector of Values in the array data,
instead of a Vector of Property's. This halfes the
memory consumption on 64bit and simplifies our code.

If an indexed property gets converted to an accessor
property, we simply convert the ArrayData into a
SparseArrayData.

Add support in SparseArrayData to allocate double slots
(two Value's) to hold a full Property in case someone
sets an accessor on an indexed property.

Some methods still return a Property*, but this is safe, as
only the first Value in the Property pointer will ever get
accessed if the Property doesn't contain an accessor.

Change-Id: Ic9b0f309b09a2772a328d947a10faaf3be9fe56f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Add a SimpleArrayData class

This makes the ArrayData class 'pure virtual'. SimpleArrayData
now contains the implementation of simple arrays. This makes the
separation between simple and sparse arrays a lot cleaner.

It also allows us to move len and offset from the base class into
the SimpleArrayClass. This fixes some bugs where we accessed len
for sparse arrays leading to some buggy behavior.

Added a virtual length() method to ArrayData to query the highes
used index in the Array.

Change-Id: Iab2ba2a48ebe5b7031759eeb4ebe02b4d86233f0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Use lookups for indexed accesses

This speeds up reading array data from objects significantly.

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