platform/upstream/qtdeclarative.git
10 years agoV4 JIT: enable register allocator on win32.
Erik Verbruggen [Mon, 3 Mar 2014 12:40:39 +0000 (13:40 +0100)]
V4 JIT: enable register allocator on win32.

Change-Id: I7134bd3721df0e000ad0bd135c01e76c55271156
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoReduce size of QQmlBoundSignalExpression in the common case.
Michael Brasser [Mon, 3 Mar 2014 18:06:51 +0000 (12:06 -0600)]
Reduce size of QQmlBoundSignalExpression in the common case.

This reduces the base size of QQmlBoundSignalExpression by 20 bytes,
by moving member variables specific to runtime rewrites in to an "extra"
structure.

Task-number: QTBUG-37134
Change-Id: I235895a395ba4304a7ea071d88aa9aebcfff61cb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove all binop related code into qv4binop*
Lars Knoll [Fri, 21 Feb 2014 07:45:09 +0000 (08:45 +0100)]
Move all binop related code into qv4binop*

Change-Id: I8f96b8d570dd4c0139b0a2e595055b3b2c6dae70
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years ago[new compiler] Fix tst_qqmlvaluetypes
Simon Hausmann [Mon, 3 Mar 2014 11:39:32 +0000 (12:39 +0100)]
[new compiler] Fix tst_qqmlvaluetypes

* Make sure to remove earlier set bindings for any value type property, not just
  scripts. We want font.bold: false to also override an earlier actual binding
  for example.
* Propagate on assignments on qualified property names throughout the
  chain of bindings - that makes it easier to detect them early on.
* The group property collection in the bindings validator should only include
  value bindings to group properties, not on assignments - as they can always
  appear in parallel.

Change-Id: Ib7ec4de755a5a8d269324a77cba36eb945366274
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Detect when writing to read-only value type property and bail out
Simon Hausmann [Mon, 3 Mar 2014 11:04:57 +0000 (12:04 +0100)]
[new compiler] Detect when writing to read-only value type property and bail out

Also annotate QML expressions in the IR with a proper function name, to
make debugging easier.

Change-Id: I5bacf446f40d35896f50bed0732f6f10408d9c97
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove unused ExecutionEngine::allFunctions
Lars Knoll [Mon, 3 Mar 2014 11:21:22 +0000 (12:21 +0100)]
Remove unused ExecutionEngine::allFunctions

Change-Id: I69a736ac7920a10667949475600460ee43d61480
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove unused codeSizes
Lars Knoll [Mon, 3 Mar 2014 11:13:52 +0000 (12:13 +0100)]
Remove unused codeSizes

Change-Id: I13c7d9dda7cd1e771079f6fdaa175008b3a3e0e5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove nArguments and name from QV4::Function
Lars Knoll [Mon, 3 Mar 2014 10:51:17 +0000 (11:51 +0100)]
Remove nArguments and name from QV4::Function

Saves 12 bytes per Function

Change-Id: I9a495805f9201eb6162a520ff5c2defeb73dc37a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years ago[new compiler] Fix tst_qquickloader::deleteComponentCrash by introducing a watcher...
Simon Hausmann [Wed, 26 Feb 2014 15:59:46 +0000 (16:59 +0100)]
[new compiler] Fix tst_qquickloader::deleteComponentCrash by introducing a watcher for self-deletion

Change-Id: I809a4860831847ab61c7ca0ba302057ec165ee24
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix some typos
Sergio Ahumada [Mon, 3 Mar 2014 16:28:30 +0000 (17:28 +0100)]
Fix some typos

Change-Id: Iea540b768232ea423ea7f04e41655198931cf36d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoWork around MSVC having issues with nested classes and templates
Simon Hausmann [Mon, 3 Mar 2014 14:01:04 +0000 (15:01 +0100)]
Work around MSVC having issues with nested classes and templates

Move SharedState into its own top-level structure.

Change-Id: I0b6baeade57ff342df23672808d77933fa6ad26d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: Renamed Qt Quick Code Samples page.
Jerome Pasion [Tue, 18 Feb 2014 15:32:48 +0000 (16:32 +0100)]
Doc: Renamed Qt Quick Code Samples page.

-new name is Qt Quick Examples and Tutorials
-includes tutorials, not just examples or code samples.

Task-number: QTBUG-36838
Change-Id: I660770cac1cdd71cd3b34bad878b0e59a088924b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
10 years agoV4 JIT: enable disassembler on windows.
Erik Verbruggen [Mon, 3 Mar 2014 12:39:48 +0000 (13:39 +0100)]
V4 JIT: enable disassembler on windows.

Change-Id: I55a2a96a1a774c79cc2146c6b47d441fede1d102
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoV4 JIT: fix MSVC warning.
Erik Verbruggen [Mon, 3 Mar 2014 12:12:09 +0000 (13:12 +0100)]
V4 JIT: fix MSVC warning.

d:\dev\qt5-dev\qtdeclarative\src\qml\jit\qv4assembler_p.h(394) : warning C4146: unary minus operator applied to unsigned type, result still unsigned

Change-Id: Iff972f419d7505ecedeb42b4b7eb456295225cb2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix build with QT_FORCE_ASSERTS
Konstantin Ritt [Tue, 25 Feb 2014 15:11:50 +0000 (17:11 +0200)]
Fix build with QT_FORCE_ASSERTS

Change-Id: Ie87b574f6cabe6095a531129511823ec55c58929
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoPrefer to use normalised signal/slot signatures
Sergio Ahumada [Sun, 2 Mar 2014 10:32:29 +0000 (11:32 +0100)]
Prefer to use normalised signal/slot signatures

Change-Id: I9856c110399c4b6b1ea6aba2d92392cecff04656
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years ago[new compiler] Set class name for QML types correctly
Simon Hausmann [Sun, 2 Mar 2014 21:28:25 +0000 (22:28 +0100)]
[new compiler] Set class name for QML types correctly

As required by the tst_qqmlinfo tests.

Change-Id: Id163c9dab539e7fd1e1da43c4fa0dfb0d1fb6e34
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix a crash in the register allocator
Lars Knoll [Fri, 21 Feb 2014 14:48:39 +0000 (15:48 +0100)]
Fix a crash in the register allocator

The base for an indexed access can be a constant.

Change-Id: Icc529c02fb0ff2ac30d6f40088781b6ecfba81fc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoMake QQmlPropertyData::name const
Albert Astals Cid [Fri, 28 Feb 2014 12:45:29 +0000 (13:45 +0100)]
Make QQmlPropertyData::name const

Change-Id: Idfa52f625fd116b9fc858bb383a1ee17b3ff3e66
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake it possible to call QQmlEngine::setObjectOwnership at any time
Simon Hausmann [Fri, 28 Feb 2014 15:19:10 +0000 (16:19 +0100)]
Make it possible to call QQmlEngine::setObjectOwnership at any time

QJSEngine::newQObject should call setObjectOwnership only if it wasn't
called before, to preserve any policy set by the user earlier. Otherwise
it's only safe to call after newQObject and then you'd have to call it
_every_ time the QObject is wrapped, at all call sites. Instead this
patch preserves any policy set.

Task-number: QTBUG-37160

Change-Id: I6178fa38cd7f4b09d818b6f18762c21588562422
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix calls to overloaded slots for QObjects not created by QML
Simon Hausmann [Fri, 28 Feb 2014 15:01:53 +0000 (16:01 +0100)]
Fix calls to overloaded slots for QObjects not created by QML

If we don't have a property cache, we need to fall back to a slower method of
determining the overload methods. We have the code for that in RelatedMethod,
once we determine that we're calling overloads, but we never hit that code path
because we did not _initially_ determine that the method was an overload.

Task-number: QTBUG-37157
Change-Id: I8ff39156e5668236b3797400b4086ed545624398
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix warnings in qml list model custom parser
Simon Hausmann [Sun, 2 Mar 2014 19:43:09 +0000 (20:43 +0100)]
[new compiler] Fix warnings in qml list model custom parser

For the warnings to have the correct column/line number information, we
need to set it on the QQmlData before calling the custom parser.

Change-Id: I6e1c729491df6af846e41ee88e785b32e4715751
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Add the correct object index to the custom parser
Simon Hausmann [Sun, 2 Mar 2014 19:35:57 +0000 (20:35 +0100)]
[new compiler] Add the correct object index to the custom parser

Without the correct index the calls to astForBinding run out of bounds. Fixes
tst_qqmllistmodel crash.

Change-Id: I6fb8b77866cbf247e7373cdbece6833c92be3615
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake QQmlExpression more robust when initializing from script string
Simon Hausmann [Sun, 2 Mar 2014 10:22:26 +0000 (11:22 +0100)]
Make QQmlExpression more robust when initializing from script string

Don't require a binding id to initialize the url/col/line. Fixes
tst_qqmlexpression with the new compiler code path, where the id isn't needed.

Change-Id: Ic09d850038c93fdc4f2bee6190cb515081dd5865
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Cleanup
Simon Hausmann [Fri, 28 Feb 2014 15:49:51 +0000 (16:49 +0100)]
[new compiler] Cleanup

Move SignalHandlerConverter into the type compiler and make it a proper
compile pass sub-class.

Change-Id: Ice8fc9acdfdb613e1d7b25728401a2376a692ccc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix for tst_qqmlconnections
Simon Hausmann [Fri, 28 Feb 2014 12:06:28 +0000 (13:06 +0100)]
[new compiler] Fix for tst_qqmlconnections

Make sure to pass onFooChanged handlers to QQmlConnection's custom parser by
not relying on the signal handler converter to set the
IsSignalHandlerExpression flag.  That should only be set for real signal
handlers, the custom parser gets the raw bindings.

Also don't try to initialize bindings at creation time the custom parser
covers.

Change-Id: Iae22bc886c312843136f073959e59da440f4184c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix qquickvisualdatamodel tests
Simon Hausmann [Fri, 28 Feb 2014 07:12:55 +0000 (08:12 +0100)]
[new compiler] Fix qquickvisualdatamodel tests

Allow for signal handlers to be installed on group property objects. We determine
the property cache objects earlier correctly, so the empyt type name check is not
necessary.

Change-Id: Idc38fdc1a78c0f4d5147ec882e7872a62510e790
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix QQmlPropertyMap tests
Simon Hausmann [Thu, 27 Feb 2014 20:48:18 +0000 (21:48 +0100)]
[new compiler] Fix QQmlPropertyMap tests

QQmlPropertyMap is treated as a type that cannot be cached with QQmlPropertyCache,
doesn't allow for accelerated property access and also doesn't allow for declarations
of any kind in sub-types.

Change-Id: Id8a6811120aa61ffb5037394e758cc62501e0fc3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix tst_qqmlengine::trimComponentCache
Simon Hausmann [Thu, 27 Feb 2014 12:06:10 +0000 (13:06 +0100)]
[new compiler] Fix tst_qqmlengine::trimComponentCache

Fix bug in QQmlCompiledData refcounting.

Change-Id: I09528419c602d3173db2f13c516d2f0d79abd92e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix tst_qqmlqt's trace test
Simon Hausmann [Thu, 27 Feb 2014 12:05:47 +0000 (13:05 +0100)]
[new compiler] Fix tst_qqmlqt's trace test

Fix name of signal handler functions to be the original onFoo name.

Change-Id: I80247cd9be9d77d99e4de0f0e945ff5a1a420244
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Clean up error handling in AST pass
Simon Hausmann [Thu, 27 Feb 2014 08:59:43 +0000 (09:59 +0100)]
[new compiler] Clean up error handling in AST pass

When traversing the AST, record all errors using the same method, which makes sure to
include the url - as expected by some tests.

Change-Id: Ib83623742db86f20144b9aa41f7f0628702d285a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix tst_qqmlqt::createComponent
Simon Hausmann [Thu, 27 Feb 2014 07:41:26 +0000 (08:41 +0100)]
[new compiler] Fix tst_qqmlqt::createComponent

Initialize the binding's self-pointer before calling addObject(), as some funky tests
try to delete the binding from within there and the self-pointer allows us to find out
later that the binding was deleted.

Change-Id: I8c9e3fe7304f304eace29c0631263b1ec021a8c4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix a few more tests related to property declarations with initializers
Simon Hausmann [Thu, 27 Feb 2014 07:11:40 +0000 (08:11 +0100)]
[new compiler] Fix a few more tests related to property declarations with initializers

Consistently declare the property first before processing the initializer tree or binding
statement. Some tests expect errors in the declaration to show up before errors in the
statement for example.

Change-Id: If66bc4969fe9db7ae32f00023f3c90343bbe98e0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoAdd a column to the default method error message
Simon Hausmann [Wed, 26 Feb 2014 17:43:28 +0000 (18:43 +0100)]
Add a column to the default method error message

This brings both compilers in sync by reporting line and column if doing a signal object
assignment without a default method.

Change-Id: I8b1bf90c4ce3cd7b117ad7eecdbfe319b07b1191
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Report an error when trying to append to a read-only list
Simon Hausmann [Wed, 26 Feb 2014 14:58:12 +0000 (15:58 +0100)]
[new compiler] Report an error when trying to append to a read-only list

Change-Id: I9c6d7f2f0983274ecb8b7cc15c0dbe21f3e0d58f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix property assignments to resolved enums
Simon Hausmann [Wed, 26 Feb 2014 13:22:12 +0000 (14:22 +0100)]
[new compiler] Fix property assignments to resolved enums

Force the type of the property to write to int, if we resolved the enum earlier
at type compile time. This is consistent with the VME and allows for
assignments to enum properties without a string converter. Fixes
tst_qquickgridview in particular.

Change-Id: Ic29f4a6115930bd7fff45f1658c00d0bfc24c7ec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Remove incorrect assertion
Simon Hausmann [Wed, 26 Feb 2014 10:54:50 +0000 (11:54 +0100)]
[new compiler] Remove incorrect assertion

It is perfectly valid for example to do

    Behaviour on someColor.r

Change-Id: I39961509b4698c19441f71baa4af197f633c5b39
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix remaining qquickanimation test failures
Simon Hausmann [Wed, 26 Feb 2014 10:48:50 +0000 (11:48 +0100)]
[new compiler] Fix remaining qquickanimation test failures

It can happen that even during initial binding evaluation, additional
finalization callbacks are registered. Catch those by setting the
activeObjectCreator pointer in the QQmlEngine accordingly - the VME does
it the same way.

Change-Id: If0fc902a4c8bdf7e8eec17bf433fd2bf11be7c04
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix qquickanimation test crash
Simon Hausmann [Wed, 26 Feb 2014 10:43:21 +0000 (11:43 +0100)]
[new compiler] Fix qquickanimation test crash

Share finalization callbacks across all sub-instances of ObjectCreator,
by moving into into SharedState.

Change-Id: Ibcd679caecd2009b4705d04c859b2fea4c2295fd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix implicit component determination inside group properties
Simon Hausmann [Wed, 26 Feb 2014 09:53:02 +0000 (10:53 +0100)]
[new compiler] Fix implicit component determination inside group properties

Don't only scan full-typed objects for property bindings that may define
components implicitly, do this for any types we know (propertyCache populated)
and that aren't explicitly of Component type.

Change-Id: I918b636be6d524e919cdd4efd49c33e63da64de3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix evaluateEnum for custom parsers
Simon Hausmann [Wed, 26 Feb 2014 09:26:51 +0000 (10:26 +0100)]
[new compiler] Fix evaluateEnum for custom parsers

When storing the string for a script binding - next to to the AST node - then
for expression statements skip the (potentially synthetically inserted)
semicolon. Its omission is required for the use of QQmlCustomParser::evaluateEnum.

Change-Id: I3b556fd6a884f5c9c290d7d793eeab4dd135343e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Compile functions and bindings in appropriate scopes
Simon Hausmann [Tue, 25 Feb 2014 15:36:41 +0000 (16:36 +0100)]
[new compiler] Compile functions and bindings in appropriate scopes

This enables accelerated property access also for this code path.

Change-Id: Iafb177b1fe7878e6c54cfb258f2e8d8ea32aa59e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix memory leaks
Simon Hausmann [Tue, 25 Feb 2014 13:22:36 +0000 (14:22 +0100)]
[new compiler] Fix memory leaks

In memory pool allocated classes we cannot have members that require a
destructor to run to free memory. Therefore this patch removes the QSets in the
object class used for duplicate property and signal name checking. The checking
is instead done using linear search, which should be fine given that usually
the number declared signals and newly declared properties is low per type.

Change-Id: Id7a7a9bdd9e145975dcee4d5340489615f4f71e3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix error location for run-time binding errors
Simon Hausmann [Mon, 24 Feb 2014 15:35:20 +0000 (16:35 +0100)]
[new compiler] Fix error location for run-time binding errors

We should point to the expression itself, not to the property.

Change-Id: I1d5b7dd80f7865076852228985717f79ceb79134
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix lazy binding evaluation
Simon Hausmann [Mon, 24 Feb 2014 15:28:25 +0000 (16:28 +0100)]
[new compiler] Fix lazy binding evaluation

Similar to commit 5dc7649f5ad7dca6e13707e827d001c3f118a6ef in the vme, we
need to set the pending binding bit for non-value-type property bindings
in order for the optimization to work and the tests to pass.

Change-Id: I89c0a3ea78c331b9c82eb8595bd4ab252b271ab5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix error reporting for group properties
Simon Hausmann [Thu, 20 Feb 2014 12:48:24 +0000 (13:48 +0100)]
[new compiler] Fix error reporting for group properties

Report errors when setting group properties multiple times, or when
assigning values to them. Some of this can be done right after parsing,
some of it requires knowledge about the type of group property (QObject or
value type)

Change-Id: I1aa33e64a5f64dfa4f625469f5b6a84cd8dfb18d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix error reporting when trying to set list properties multiple times
Simon Hausmann [Thu, 20 Feb 2014 11:51:53 +0000 (12:51 +0100)]
[new compiler] Fix error reporting when trying to set list properties multiple times

Change-Id: Ifcbed45894b739a57873356e8963670084614880
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Don't allow for attached properties inside group properties or nested
Simon Hausmann [Thu, 20 Feb 2014 11:25:36 +0000 (12:25 +0100)]
[new compiler] Don't allow for attached properties inside group properties or nested

Change-Id: I7ca4e1c1b111d587f519275b146179b4e6f6a51f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] When resolving names of attached properties, don't report the error...
Simon Hausmann [Thu, 20 Feb 2014 11:21:21 +0000 (12:21 +0100)]
[new compiler] When resolving names of attached properties, don't report the error at import time

Instead report it later with a more specific error message. This is consistent with the old compiler.

Change-Id: Iba345b7ecc8a9ff474938f69118665eb0d965594
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix determination of property caches for attached properties
Simon Hausmann [Wed, 19 Feb 2014 16:16:35 +0000 (17:16 +0100)]
[new compiler] Fix determination of property caches for attached properties

That in turn fixes error messages around property validation in attached
types.

Change-Id: Idef9f7652b225c5769b7fdf43e41731b197c1144
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Improve error message for incorrect signal assignments
Simon Hausmann [Wed, 19 Feb 2014 15:03:03 +0000 (16:03 +0100)]
[new compiler] Improve error message for incorrect signal assignments

Change-Id: I16e7cdc6b5b49200259ea7e57d84e00f095554f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Ensure that qualified type names end in an id with an upper case letter
Simon Hausmann [Wed, 19 Feb 2014 14:55:11 +0000 (15:55 +0100)]
[new compiler] Ensure that qualified type names end in an id with an upper case letter

Change-Id: I35166b86ddc7c2e87dc77b59f4d8272279ca5688
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Report errors when a property name starts with an upper case letter...
Simon Hausmann [Wed, 19 Feb 2014 14:40:17 +0000 (15:40 +0100)]
[new compiler] Report errors when a property name starts with an upper case letter and lacks a qualification

Change-Id: I66e9669459920cfb3543a3ebcec8501465c2ef85
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix error reporting for invalid component specifications
Simon Hausmann [Wed, 19 Feb 2014 12:08:34 +0000 (13:08 +0100)]
[new compiler] Fix error reporting for invalid component specifications

Change-Id: I435845ab1188e65a7ef019d758fbbba57e2e0bec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years ago[new compiler] Fix error location when id property is used in list model elements
Simon Hausmann [Wed, 19 Feb 2014 11:54:02 +0000 (12:54 +0100)]
[new compiler] Fix error location when id property is used in list model elements

Change-Id: Iec648d593d30117c512009dcc6ab0d50b8fc51af
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix debug output when tests fail
Simon Hausmann [Thu, 20 Feb 2014 10:38:41 +0000 (11:38 +0100)]
Fix debug output when tests fail

The tests with expected .errors.txt files support setting the DEBUG=1
environment variable to produce string output. Unfortunately "Actual:"
and "Expected:" were swapped in the output.

Change-Id: I2b378b0d9dcc6e513d82837abf9f8b0d5d7e1392
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoGlyph node: Those null coords are useful after all
Gabriel de Dietrich [Fri, 28 Feb 2014 17:39:53 +0000 (18:39 +0100)]
Glyph node: Those null coords are useful after all

Artifacts were visible on Linux after 3f88a5b835198e39
and this seems to be the only behavior change hitting
non-retina displays.

Change-Id: I0d4dc5ca05adb4585c6afad2a24d9c3a8551d809
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
10 years agoImprove memory usage in QML/V4 engine.
Michael Brasser [Thu, 27 Feb 2014 21:59:39 +0000 (15:59 -0600)]
Improve memory usage in QML/V4 engine.

* Don't create prototype Object for bindings and
  signal handlers. It is inaccessible and not required.
  This saves one Object-sized allocation per binding.
* Shrink the size of QQmlContextWrapper by removing
  the v8 member variable.
* Shrink the size of QObjectWrapper by moving the destroy
  identifier to the engine.

Change-Id: I76e84e4c0581e97a19d2e959f814ac84d9c431fa
Task-number: QTBUG-37134
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoQQuickWindow: fix content item size
J-P Nurmi [Fri, 21 Feb 2014 14:04:21 +0000 (15:04 +0100)]
QQuickWindow: fix content item size

Resize content item in QQuickWindow::resizeEvent() instead of using
signals and slots. The signal-slot connections were only established
when child items were added in QML. It should work in C++ too, since
QQuickWindow and QQuickItem are part of the public C++ API and using
them in C++ is a perfectly valid use case.

Resizing the content item in resizeEvent() is not only faster than
using signals and slots, but also in theory a bit more flexible as
one would be able to override the event handler and implement their
own layouting.

Task-number: QTBUG-36938
Change-Id: Id05d4cf6d547021803050633e6f0a3359129a9f3
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
10 years agoFixed regression from fd5c629f4336b1f79
Björn Breitmeyer [Tue, 25 Feb 2014 09:18:06 +0000 (10:18 +0100)]
Fixed regression from fd5c629f4336b1f79

Buffer offsets were wrong, and a type
in the buffer content.

Task-number: QTBUG-36989

Change-Id: I863976420d495b006692c4b614f74c285649cb1a
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoQQuickWidget: handle hide and show events properly
Paul Olav Tvete [Fri, 28 Feb 2014 10:07:11 +0000 (11:07 +0100)]
QQuickWidget: handle hide and show events properly

Task-number: QTBUG-37062
Change-Id: I3763385168eaa0ccd009ada563f56ea0251029a5
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoTidy up DropArea documentation.
Mitch Curtis [Fri, 28 Feb 2014 08:13:58 +0000 (09:13 +0100)]
Tidy up DropArea documentation.

The delegate property was removed because it doesn't exist.

Change-Id: I010880773629868f3c640c0a4ed34f132454d2f7
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoEnsure that ShaderEffectSource's texture has correct parameters.
Gunnar Sletta [Wed, 26 Feb 2014 15:36:58 +0000 (16:36 +0100)]
Ensure that ShaderEffectSource's texture has correct parameters.

The provider is created on demand in textureProvider(), but its
parameters are set in updatePaintNode() so if updatePaintNode() was
called before a consumer asked for the texture provider, they wouldn't
be set until the next time updatePaintNode() was called.

Change-Id: Iff866d50a8fe16f3d371cb8e590528f5f8c5ee61
Reviewed-by: Mikko Harju <mikko.harju@jolla.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoThreaded render loop should block until the frame is swapped.
Gunnar Sletta [Thu, 20 Feb 2014 16:27:03 +0000 (17:27 +0100)]
Threaded render loop should block until the frame is swapped.

Introduced the concept of an expose cycle, as the WM_Expose
is followed by WM_RequestSync and only after we handled the
sync and then swap, should we unlock. Otherwise, we are
potentially waiting for the wrong swap.

This also fixes a bug when we get an expose while the render
thread is animating on its own. We would previously set
RequestRepaint, but this could potentially be reset by a render
thread animation if the GUI thread took a short while getting
to the point where it sent the RequestSync. If that requestsync
did not result in SG changes, we would not render anything.
With the exposeCycle, we are now guaranteed to repaint after
we handled the sync, which is how it should be.

Task-number: QTBUG-35805

Change-Id: Ib5c588f135763142e57f84b39dd3827fd05b9485
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoFix renderType: Text.NativeRendering on retina screens
Tor Arne Vestbø [Wed, 26 Feb 2014 14:27:23 +0000 (15:27 +0100)]
Fix renderType: Text.NativeRendering on retina screens

The QSGDefaultGlyphNode's QSGTextMaskMaterial failed to take the device
pixel ratio of the surface into account, both when building the glyph
cache in init() and when blitting the glyphs from the cache in populate().

We now handle both, resulting in equal rendering as the raster engine,
which itself matches CoreText, except for some minor shaping differences.

One snag with the QSGTextMaskMaterial compared to eg. the raster engine
is that the incoming glyph positions (from shaping) are not pre-scaled,
which means we have to be careful to apply the device pixel ratio before
rounding the coordinates, to match the behavior of the raster engine.

Change-Id: I51cf796bd437f68fad298f689ee3f2d9a2863b4d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoFix tst_qquicktext::hover()
J-P Nurmi [Thu, 27 Feb 2014 10:04:04 +0000 (11:04 +0100)]
Fix tst_qquicktext::hover()

Task-number: QTBUG-36938
Change-Id: I28da25235ae7b8805ebc474777a5edd43ceef941
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
10 years agoCanvas: do not emit paint signal when invisible
J-P Nurmi [Thu, 27 Feb 2014 14:13:33 +0000 (15:13 +0100)]
Canvas: do not emit paint signal when invisible

Task-number: QTBUG-31830
Change-Id: I23c6fc822547120f14c2d9a09f01a8f985745e2a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
10 years agoRevert "Fix item polishing"
J-P Nurmi [Thu, 27 Feb 2014 13:54:09 +0000 (14:54 +0100)]
Revert "Fix item polishing"

This caused items like positioners and itemviews to not
relayout or update as appropriate when items were hidden,
and therefore caused problems all over in eg. controls.

This reverts commits
43f983350a548b1b663ea07a0e87e4cc58834214
01e609e9fa0ca1317e0f4eff4802a79584450357
439f31f128e70ecae16544ee7041695c60e0b2d6

Task-number: QTBUG-36954
Task-number: QTBUG-36934
Task-number: QTBUG-31830
Change-Id: If04cdce51206568c360a45e24efc0bd04764750b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
10 years agoFix behavior when starting/stopping multiple QML profilers at once
Ulf Hermann [Wed, 26 Feb 2014 17:42:48 +0000 (18:42 +0100)]
Fix behavior when starting/stopping multiple QML profilers at once

Make sure they're all inserted into the m_startTimes map before any of
them is actually stopped. Otherwise multiple "Complete" messages can be
generated for only one profiling session.

For consistency, also allow all profilers to be started at the same
time with only one call to startProfiling().

Task-number: QTCREATORBUG-11532
Change-Id: I8f80e2f7432c31d5911e139f9632c36f2494cb96
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoMark tst_qquickpathview insignificant on OS X
J-P Nurmi [Thu, 27 Feb 2014 18:06:13 +0000 (19:06 +0100)]
Mark tst_qquickpathview insignificant on OS X

Task-number: QTBUG-27740
Change-Id: I0dbf74b9fb8a4e7542d9d5b3c4f1d0516b04cd36
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoqmlplugindump: adding isComposite
Fawzi Mohamed [Thu, 13 Feb 2014 15:33:18 +0000 (16:33 +0100)]
qmlplugindump: adding isComposite

Change-Id: Ia742c26402156b09bc91590cef6a10755a8df754
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoMake GridView/ListView attached "view" property available to all delegate types
Nils Jeisecke [Mon, 7 Oct 2013 09:55:12 +0000 (11:55 +0200)]
Make GridView/ListView attached "view" property available to all delegate types

This is useful for accessing the view (e.g. "width", "cellWidth", ... properties)
from within section (ListView only), header, footer and highlight delegate components.

A typical usecase are components that are used in multiple views and therefore
cannot use the views's id for access.

The only attached property valid for those non-item delegates is "view". This
has been added to the documentation.

Change-Id: I33d976da778be23ed531a3b193ceee95ed9800d2
Task-number: QTBUG-32836
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix global object handling in worker script JS files.
Michael Brasser [Mon, 17 Feb 2014 15:35:20 +0000 (09:35 -0600)]
Fix global object handling in worker script JS files.

Task-number: QTBUG-36874
Task-number: QTBUG-36881
Change-Id: Iacf4807dd37862e792ad1ba4ce540a6d48f1e495
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd double-click to QQuickWidget
Ulf Hermann [Mon, 24 Feb 2014 11:45:39 +0000 (12:45 +0100)]
Add double-click to QQuickWidget

Task-number: QTBUG-36935
Change-Id: I498561f6bbd5a9b279034d16ef5ae4fb36607ed3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agotst_qquickpathview: show window before flicking
Shawn Rutledge [Tue, 25 Feb 2014 11:57:45 +0000 (12:57 +0100)]
tst_qquickpathview: show window before flicking

It's uncertain whether this caused any actual CI failures, but other
tests show the window first, and this one tests interactive
functionality so it makes sense that it should be visible.

Change-Id: I92c26ce596f556765917409ca4e9037bdaccfa23
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
10 years agoAdd support for scanning javascript files.
Morten Johan Sørvig [Tue, 11 Feb 2014 14:19:33 +0000 (15:19 +0100)]
Add support for scanning javascript files.

Javascript may contain ".import" pragmas/statements,
which should be treated in a similar way as qml file
imports.

Add findQmlImportsInJavascriptFile() which extracts and
parses the .import lines. Refactor findQmlImportsInFile()
to handle both .qml and .js and call out to the correct
parsing function.

Add "-jsFiles" for specifying javascript
files on the command line similar to "-qmlFiles".

Task-number: QTBUG-35349

Change-Id: I6b8e0cc254c1edcf16940bec5cfda7c2637f115e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix crashes and incorrect extension queries on GL3+
Laszlo Agocs [Sun, 23 Feb 2014 12:22:13 +0000 (13:22 +0100)]
Fix crashes and incorrect extension queries on GL3+

glGetString(GL_EXTENSIONS) is deprecated in OpenGL 3.0+.
This means that in core profiles on 3.2+ (or without the fwd
compatibility bit on 3.0/3.1), the call is not supported and may
return NULL. This causes a crash in at least one place where we
try to blindly strstr the result. The correct solution is to use
QOpenGLContext::extensions() and hasExtension() which is prepared
to handle GL3+.

Change-Id: I52fec7dcee001cdc0933af03f5eed4b7c822b2bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
10 years agoIntroduced a few more signals to QQuickWindow.
Gunnar Sletta [Mon, 10 Feb 2014 14:51:16 +0000 (15:51 +0100)]
Introduced a few more signals to QQuickWindow.

Also marked the new afterAnimation() signal as \since 5.3 and
introduced proper revisioning on the new signals.

[Changelog][QtQuick] Added QQuickWindow::afterSynchronizing(),
openglContextCreated(), sceneGraphAboutToStop(). Useful for
deeper integration with the rendering.

Change-Id: I5532b310506c2432325595e55ef9307b8934abee
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix wrong assert in QSGRenderLoop::setInstance
Marco Bubke [Wed, 19 Feb 2014 13:54:24 +0000 (14:54 +0100)]
Fix wrong assert in QSGRenderLoop::setInstance

The assert before test not if the scoped pointer is null but the pointer
which was holding the scoping pointer.

Task-number: QTBUG-36932
Change-Id: I7a5e51752446556c1796bb677fe69cbceffdd3e0
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoqmlplugindump: adding writeBooleanBinding to write booleans
Fawzi Mohamed [Thu, 13 Feb 2014 15:32:17 +0000 (16:32 +0100)]
qmlplugindump: adding writeBooleanBinding to write booleans

Change-Id: I13077ad0d6522d91af0dab7d7bc30346b188ee4b
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoRegister the QML profiler's animation callback from the GUI thread
Ulf Hermann [Fri, 21 Feb 2014 16:37:40 +0000 (17:37 +0100)]
Register the QML profiler's animation callback from the GUI thread

QUnifiedTimer is thread-local, so that a different object is returned
from instance() for each thread. This patch makes sure we register to
the one that performs the animations.

Task-number: QTCREATORBUG-11536
Change-Id: I23c3ff49f94668517b9894298a4d770a8c30e705
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoDon't needlessly flush start times when stopping profiling
Ulf Hermann [Fri, 21 Feb 2014 13:15:51 +0000 (14:15 +0100)]
Don't needlessly flush start times when stopping profiling

QQmlProfilerService::messageReceived() can call stopProfiling() multiple
times in a row. If we flush the start times every time we get
inconsistent data in the client. Profiler adapters should be removed
from the start times when they're deleted, though.

Task-number: QTCREATORBUG-11532
Change-Id: I6820971b7a93a7337cd8ad1b7b8b5aafdd654ab5
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoDetermine whether or not an object literal requires a sparse array at compile time
Simon Hausmann [Sat, 15 Feb 2014 03:39:33 +0000 (04:39 +0100)]
Determine whether or not an object literal requires a sparse array at compile time

Change-Id: Ieb7f6ee97a4f251f1e2369850ebb9e2931f84ac1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoClean up object literal handling with integral indices
Simon Hausmann [Sat, 15 Feb 2014 01:16:43 +0000 (02:16 +0100)]
Clean up object literal handling with integral indices

* Object literals with array indices are now created with one
  run-time call, instead of an initial one for non-integral keys
  followed by sub-sequent define_builtin_property calls.

* Cleaned up propert name retrieval. Instead of using a visitor,
  it's easier to define a virtual method on the PropertyName type.  The visitor
  doesn't buy us much as it's not possible to recurse within property names, and
  this way we can use it also from the function scanner to correctly determine
  the number of arguments needed for object literal initalizations.

* Similarly the duplicated/common name member for all property assignments
  has been moved into PropertyName, for convenient access without AST casts.

* Removed now unused builtin_define_property/settergetter functions from IR,
  run-time and moth.

Change-Id: I90d54c81ea5f3f500f4f4a9c14f7caf5135e7f9f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMerge remote-tracking branch 'origin/release' into stable
Frederik Gladhorn [Mon, 24 Feb 2014 18:55:03 +0000 (19:55 +0100)]
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I68fd0e1d837bcd918c8efaf67fa88dee4a90b3be

10 years agoSmaller cleanup
Lars Knoll [Fri, 14 Feb 2014 11:28:06 +0000 (12:28 +0100)]
Smaller cleanup

Cleanup the code to generate a swapValues instruction
to only require one code path for 32/64 bit. In
addition, this seems to be slightly faster even on
x86-64.

Change-Id: I0584c3eb5249606ca7541abfbce227e5cb44711f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoClean up our internal namespaces
Lars Knoll [Fri, 14 Feb 2014 12:58:40 +0000 (13:58 +0100)]
Clean up our internal namespaces

QQmlJS::MASM -> QV4::JIT
QQmlJS::V4IR -> QV4::IR

Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove binops out of the isel
Lars Knoll [Tue, 11 Feb 2014 08:46:45 +0000 (09:46 +0100)]
Move binops out of the isel

Move the binop handling into qv4binop* to clean up the
code and ease maintenance.

Change-Id: I0053380be7f326a2100302a63e921698a5b28c2a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove unops into it's own file
Lars Knoll [Mon, 10 Feb 2014 15:31:18 +0000 (16:31 +0100)]
Move unops into it's own file

Change-Id: I17aaff4d044608462e1edabc5612685591b3a433
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove the Assembler class into it's own file
Lars Knoll [Mon, 10 Feb 2014 14:58:11 +0000 (15:58 +0100)]
Move the Assembler class into it's own file

Change-Id: I9968b3ae5ad5fbad3490e08e173c22e4a643c91f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove JIT infrastructure into it's own directory
Lars Knoll [Mon, 10 Feb 2014 14:46:28 +0000 (15:46 +0100)]
Move JIT infrastructure into it's own directory

This is a starting point to clean up some of the
code base for the JIT.

Change-Id: I388ce8df7d4ab87095e227cf36643f4be2594b7d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove unused method
Lars Knoll [Mon, 10 Feb 2014 13:27:55 +0000 (14:27 +0100)]
Remove unused method

Change-Id: I03d30ef5b06408d4d482e81f86bdc27c71a5d7e8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoReally eliminate a|0 and b&(-1)
Lars Knoll [Sun, 9 Feb 2014 20:11:16 +0000 (21:11 +0100)]
Really eliminate a|0 and b&(-1)

The old code wasn't doing what it promised to do
and failed to remove these expressions.

Change-Id: I6718539fd528f293db537e47ff1c9ac4b27ada55
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAvoid some unneccesary instructions in swapValues
Lars Knoll [Sun, 9 Feb 2014 19:09:10 +0000 (20:09 +0100)]
Avoid some unneccesary instructions in swapValues

If source and target values are of the same type, there's no need
to write the type to the stack once again.

Change-Id: I3e1600407012f7bd7f2e5ba91b279b0421be9e68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMask rhs of shift operations in the IR for constants
Lars Knoll [Fri, 7 Feb 2014 21:29:13 +0000 (22:29 +0100)]
Mask rhs of shift operations in the IR for constants

Saves an instruction for shifts with contants

Change-Id: Ia12355d2fe2b9f80631056cda5edd79b45189e99
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSlightly simplify generated code for conversion to int
Lars Knoll [Fri, 7 Feb 2014 21:03:57 +0000 (22:03 +0100)]
Slightly simplify generated code for conversion to int

Take only one branch for integers, and save one instruction in
total.

Change-Id: I496f11fb3f080f71e9f415ebb4201228c63471b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove unused text stream
Lars Knoll [Fri, 7 Feb 2014 14:13:17 +0000 (15:13 +0100)]
Remove unused text stream

Change-Id: I23a1f5f2c6f782fab315db4725412a9473178b70
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove some code duplication
Lars Knoll [Fri, 7 Feb 2014 13:55:47 +0000 (14:55 +0100)]
Remove some code duplication

Change-Id: If336731a49bcb5e1812d50a39cb97e263f23b183
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoCleanup: Pass the function into the various SSA stages
Lars Knoll [Fri, 7 Feb 2014 13:40:10 +0000 (14:40 +0100)]
Cleanup: Pass the function into the various SSA stages

Pass in the function object instead of the variablesCanEscape
flag. Cleans up the code a bit.

Change-Id: If2d24b30fb223fa03e27f75f40ad42b881b2b3a0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSimplify some runtime code
Lars Knoll [Fri, 7 Feb 2014 08:46:02 +0000 (09:46 +0100)]
Simplify some runtime code

Simpler code and delivers the same performance.

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