Commit Graph

7264 Commits

Author SHA1 Message Date
Lars Knoll 4d40fa24c3 Move Value::toInteger(double) and related to Primitive
Also clean up a few other direct uses of Value

Change-Id: Ie27d42c1b31b9e6d16d0a60071cb5e4e1c5b9e8b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:32 +02:00
Lars Knoll abd82c68d5 Make API of QV4::JsonObject GC clean
Change-Id: Ie7f2d63402c9486b30caf5866af8c747026c091d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:27 +02:00
Lars Knoll cf2a253f2f Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of
QV4::Value that need fixing.

Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:24 +02:00
Lars Knoll 7872b38006 Use SafeValue in more places
Change-Id: Ic15c1419c74f22bd7639ce8746ff11b15240b718
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:19 +02:00
Lars Knoll 4d49787af4 Clean up QV4::ExecutionContext
Remove an unused variable, and don't copy runtimeStrings

Change-Id: I2197a7eb82ab3dbefea83cc917567390266f9673
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:14 +02:00
Lars Knoll 0f2cf9074d Fix CallContext to not hold arguments on the C stack anymore
Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:08 +02:00
Jerome Pasion 1ef957834b Doc: Updated imports, \qmlmodule, and \inqmlmodule versions in src/qml.
-QDoc ignores the version in \inqmlmodule so its better to remove them
to avoid confusion.
-Qt QML import version is 2.2 for 5.2 release
-Qt Quick import version is 2.2 for 5.2 release

Task-number: QTBUG-32172
Change-Id: I15df270f1fb4df0476a9ddd854fb9ddf58e9fc7c
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-27 12:31:01 +02:00
Tor Arne Vestbø 6ce4772473 Update after changes to QTestResult API in qtbase
Change-Id: I8a28418753a21c700a365dd369d7befa8ab14f76
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-09-27 08:39:43 +02:00
Gunnar Sletta 0150202cc7 Allow animators to work properly with multiple windows
Change-Id: I5ba663ba0fa089ea786cf43cb4dfa40cbc955342
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2013-09-26 20:08:19 +02:00
Dmitry Shachnev c40d9f64a6 QSGRenderLoop: don't dereference gl pointer if it has been deleted
Change-Id: Icd612b243cdfe1248d1b94964c53f5102f9558d2
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-26 17:33:04 +02:00
Gunnar Sletta 57ae961bcf Support looping for "uncontrolled animations".
The render thread animations rely heavily on uncontrolled
animations, meaning animations with duration=-1. We support
this by adding a m_currentLoopStartTime and incrementally
counting the finish time of each uncontrolled animation.

Change-Id: I1f2ccea09aff4c51b1a7f98a2ddb58636af50557
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-09-26 17:32:40 +02:00
Lars Knoll 6d425ebab3 Skip two tests that don't work reliably with a conservative GC
Change-Id: I5619d533b6e48c88fda063bc7cdcc62d6838bcdf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:45 +02:00
Lars Knoll 0c22fb091e Convert more methods in QV8Engine
Change-Id: I5b059b41842b4a6d9541525b3955d2b64c0011c3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:38 +02:00
Lars Knoll 74807c0725 Move more API over to use ValueRef
Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:32 +02:00
Lars Knoll 9062476491 Make parts of qv8engine_p.h GC safe
Change-Id: Iaa15423cedc307a09b3cd7287272d93d7a604caf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:25 +02:00
Lars Knoll 0f204625dc Fix QQmlV4Function API to be GC safe
Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:22 +02:00
Lars Knoll a57085f00b Fix API of QQmlV4Handle
Change-Id: Iac4a3fefebd33a5990408598486231a5add8e639
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:19 +02:00
Lars Knoll 12fd2ccd3f Fix Persistent/WeakValue API
Don't use unprotected Values in the API anymore.

Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:16 +02:00
Lars Knoll 2e4f66caa8 Cleanups in qv4stringobject
Make the methods GC clean, and simplify some logic

Change-Id: I02df8cb571f27d640c6effc871ea7c24b23b8368
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:13 +02:00
Sérgio Martins 6752b6fef6 Fix WinCE build.
Change-Id: Ie0536ad94f88efe1e54226ed7f1d9e1042ffcc19
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 22:56:10 +02:00
Friedemann Kleint 36ab6e0160 qmlimportscanner: Print usage when no arguments are passed.
Change-Id: I2ba5e18fff635705b1f5e8e19c104ba078c8e3a1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-25 22:55:37 +02:00
Mitch Curtis aac2309ade Import QtQml instead of QtQuick now that Locale is available there.
97feace2aa made it available.

Change-Id: I4a263a26c1db164f410c49fe0fca776aed53f7e8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-25 19:54:16 +02:00
Topi Reinio c708848d7c Doc: Fix documentation of qmlProtectModule
Fix the function signature used in \fn command and
document the parameters.

Change-Id: Ieda9b2b402886b81691195dbad17663fd454f282
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-25 16:16:15 +02:00
Gunnar Sletta 63727e4d38 Avoid out-of-bounds read.
Change-Id: I28777806b13da1b0a9e1fecc2734de0614f2443c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-09-25 16:16:15 +02:00
Gunnar Sletta 15f8ef2f36 Initialize variable
Change-Id: I1f3cf8b922849fc482b3c1346eb476019f466a13
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 16:16:15 +02:00
Erik Verbruggen 7d37b2c3fb Split off crashing test from qqmlecmascript.
Task-number: QTBUG-33658

Change-Id: I5a9f24d49ab894e3cde745cc0c1d44ef0880510f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 16:16:15 +02:00
Gunnar Sletta f2233c7250 Convenience class for FBO rendering in Qt Quick
Change-Id: I5712bbfa0cde9f2fe5fddc35c4cc23597717065c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 16:16:15 +02:00
Jerome Pasion 0e62896fdc Doc: Fixed and updated Qt Quick's \qmlmodule page
-incremented version to Qt Quick 2.2 (in \qmlmodule page)
-import changed to QtQuick 2.2
-\inqmlmodule no longer needs the version. QDoc will ignore the version
but it is better to remove it now to avoid confusion

Task-number: QTBUG-32172
Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-25 13:51:51 +02:00
Jerome Pasion 89042598c4 Doc: Made \since commands in src/qml consistent.
-QDoc displays the Qt version in the HTML output.
-If there is only one argument to \since, QDoc assumes it is the Qt
 version.

"QtQuick 2.1" -> "Qt 5.1"
"QtQml 2.1" -> "Qt 5.1"
"QtQuick 1.1" -> "Qt 4.8"

Task-number: QTBUG-32172
Change-Id: I3c0da4dce8e44d717a6840bea250b4f0f9d78128
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-25 13:51:39 +02:00
Jerome Pasion 779182eb4a Doc: Made Qt Quick items' \since consistent.
Qt 5.2:
-"\since QtQuick 2.2" -> "\since 5.2"

Qt 5.1:
-"\since QtQuick 2.1" -> "\since 5.1"
-"\since Qt 5.1" -> "\since 5.1"

Qt 5.0:
-"\since QtQuick 2.0" -> "\since 5.0"

Task-number: QTBUG-32172
Change-Id: I699b00b31373a434ddb8f4caccfef40c588bf8a4
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-25 13:51:06 +02:00
Jerome Pasion 3e6305f6ac Doc: Made \since command in Dialog QML types consistent.
-QDoc only requires the version number for Qt versions

Task-number: QTBUG-32172
Change-Id: Ifa3a94fa66194807d58b079b4f451af90cc1d00a
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-25 13:23:04 +02:00
Sérgio Martins 6bb0b40083 wince: Build fix, NtCurrentTeb() is not available in this platform.
This was copied from qtscript's:
src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp

Change-Id: Iaa5549e6915aa4aa4bf532fbe7c9117a0858ff02
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:18:33 +02:00
Simon Hausmann 36919b3e9e Fix Component.onCompleted emission and bindings for composite types
When instantiating the composite type with a sub QQmlObjectCreator,
make sure to link the componentAttached objects back into the parent
creator. Similarly we need to collect the bindings the sub-creator
created, as finalize() is only called on the top-level creator.

Fixes remaining failures in tst_qqmllanguage::onCompleted

Change-Id: If79b31ee94000aeec280284200df8ee97e57fd03
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Simon Hausmann 17588320da Fix lookup scopes into the context object
Given

QtObject {
     property int value: 42
     property var o: QtObject {
         Component.onCompleted: print(value)
     }
}

Should print 42 - the lookup for "value" should fail in the
scope object (o) and succeed in the context object.

Fixes part of tst_qqmllanguage::onCompleted

Change-Id: If48d6a780aa0f3cb4a7757694f93359e57757973
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Simon Hausmann 5c6534773f Fix component boundary detection
For a component boundary, the type in question has to be an actual
QQmlComponent. If it's a type that itself is derived from a component (type ==
0 && component != 0 in typereference), then it is not a boundary.

Fixes tst_qqmllanguage::componentCompositeType

Change-Id: I938abe94c2fa4c69788176235ac74d0c6e385c0c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Simon Hausmann b3449f333b Fix bug in assigning to self-declared properties in child object literals
When createInstance() calls populateInstance, make sure that the QObject
used for bindings is the instance we just created, not the _qobject from
the caller side (which is completely wrong and unrelated).

Change-Id: I7dc44ffaa70799b2f37258aeacdb33d8a1cf8c48
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Simon Hausmann cefcba03d7 Fix assigning composite type object literals to object properties
When doing the assignability test, pick the property cache from our
property caches for the created sub object and only otherwise fall
back to the regular engine cache.

Change-Id: I07b9746335a9a169e1055a3f4dc7fd3f0ab0fdef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Simon Hausmann 443f99eafb Fix bindings on properties in grouped value type properties
... such as
    point.x: { someExpression }

This requires special handling to install the QQmlBinding not on the
value type itself (not possible) but on the point property itself.

Fixes tst_qqmllanguage::valueTypes

Change-Id: I8f95379e1872dff7cdcc0480c229a5e68f3cf575
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Simon Hausmann f1901b9289 Fix setting the id property when also present in the type itself
Fixes tst_qqmllanguage::idProperty

Change-Id: I3051da6a55f29bfca58aa83647fe5d51fb2a67e0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:13:30 +02:00
Friedemann Kleint bbbb33011a Fix warnings about includes.
QtQml: WARNING: qtdeclarative/src/qml/qml/qqmlabstracturlinterceptor.h
QtQml: WARNING: qtdeclarative/src/qml/qml/qqmlfileselector.h
includes qtqmlglobal.h when it should include QtQml/qtqmlglobal.h

Change-Id: I1cc4e3a201e0f3bec34c5e4bca8ec1578c8b0224
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-25 13:13:30 +02:00
Shawn Rutledge 8495296f4f qml: handle all possible QtMsgType in switch because of -Werror
Perhaps this illustrates why having -Werror is more of an annoyance
than whatever it was supposed to help:
https://codereview.qt-project.org/#change,65253 cannot be merged
until the new enum value that it adds is handled _everywhere_ that
it can be.

Change-Id: I2bba730b471683487e38693c9ace2d09be4c874d
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-25 10:33:37 +02:00
Erik Verbruggen 0635fd8f2b V4 SSA: cleanup: rename single letter variables.
Because "targetTemp" and "sourceTemp" is clearer than, say, t1 and t2.

Change-Id: I5195c75f1958a3bea3c370924685ff6ba9c9c515
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:25 +02:00
Erik Verbruggen 1bc7518529 V4 SSA: change life-time interval coverage calculation.
When iterating over the ranges in a life-time interval, stop when the
range starts after the position to check.

Change-Id: Ib64cbfc644820fdb4c0167b8db0b40dacfb5d076
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:22 +02:00
Erik Verbruggen cb52d1cfdb V4: enable register allocator on linux and macos on x86_64.
Change-Id: I958cf90da5c44b0119c5666df6ed2e4820444841
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:19 +02:00
Erik Verbruggen 750e15320a V4 regalloc: fix intersection calculation.
The previous version was plain wrong: when the first interval had more
than one range, those ranges would never be checked for intersection.

This version iterates over all ranges in the first interval, and returns
the index of the first range in the second interval that overlaps with
that range. Iterating over the second interval is cut off when an
interval is found that starts after the current one end (the ranges of
both intervals are sorted).

Change-Id: I87c254a645164eb6639925c2e3b7fd7c1b1bfa0a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:17 +02:00
Erik Verbruggen a5b82cca18 V4: fix move mapping
When resolving conflicting register use between basic blocks, only
insert the resolving moves into the successor when it has one incoming
edge. Because of the absence of critical edges, this implies that it is
also save to insert those moves into the predecessor block if there is
more than one incoming edge (the predecessor will only have one outgoing
edge).

Change-Id: I83c41b4ca86946d3aa09619f20ddab3e692136f2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:15 +02:00
Erik Verbruggen 51c31660b1 V4 JIT: fixes after NaN boxing changes.
Change-Id: I22a1b46f488dc65513ed287dabe7d85469cc5173
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:11 +02:00
Erik Verbruggen 226f8cc9fe V4: re-enable SSA transformation and optimization.
But keep the register allocator disabled for now.

Change-Id: I475835ec35ef31d76e084788a754c00b1f8fdda6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:09 +02:00
Erik Verbruggen 0bf86704fc V4 JIT: generate code for unary not operator.
Change-Id: I00a47d261a76db0b938f8c9300be9afc06b42d02
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 09:46:05 +02:00
Morten Johan Sørvig 68c75745f8 Add qmlimportscanner.
qmlimportscanner scans for import statements in qml
files and returns a JSON-formatted list of imports.
This is done recursively in order to get all dependencies.

Usage: "qmlimportscanner path/to/app/qml/"
		-importPath path/to/qtbase/qml

Change-Id: I0e99caaf4216058c52a4706f7fdbeaf1eba0bbc1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-23 06:49:44 +02:00