| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Statically initializing QObjects will cause e.g. the main
thread pointer in QCoreApplication to be set when the library
is loading. On Android, this is never the real main thread.
The effect was a warning about QApplication not being initialized
on main thread, and a race condition which sometimes caused
apps to hang on startup.
[ChangeLog][Android] Fixed possible hang on startup for Qt Quick
applications.
Task-number: QTBUG-36426
Change-Id: I7bd8a8f35ef1a2548949978563e3157f8dc854c7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Spills for targets of phi-nodes are already inserted by the renumbering,
so they don't need to be added (again) while resolving edges.
This fixes a problem with crypto.js.
Change-Id: I4b1d79fc92236b4a6b0b6d6d30ada17c8581a093
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
For _ZN13BenchmarkDemo11initPhysicsEv from the Octane testsuite, the
total allocated memory drops from 1.5GB to 51MB. Peak memory usage stays
at 29MB.
Again, slow implementations of malloc()/free() will see a performance
improvement.
Change-Id: I21bc2f0d3735de0980fc9b3745906016e2e48a61
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the work for the dominator tree/frontier calculations,
because there are less blocks to consider. All blocks inserted by
splitting the critical edges, have (by definition) no effect on the
dominator calculations. However, the immediate dominators for all new
blocks needs to be added, because this information is used by the block
scheduling.
This change reduces memory/time usage during optimization passes,
especially when processing excessively big switch statements.
Change-Id: Ia69882e9dabdddffa1c98b1079012d8d988e1e8f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes to datastructures and more re-using of locally used temporary
vectors. For the test regress-74474-002.js this lowers the total
allocated memory from 1.98GB to 158MB. Thse peak memory usage stays at
75MB. There is no functional change.
This should give a modest performance improvement which mainly depends
on the speed of malloc()/free().
Change-Id: I1877c1903e59a33ee79ff2b801ef6f2c1cee30a6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
| |
The basic block scheduling uses this information to place loops. When
the immediate dominator information is invalid, the scheduling can be
sub-optimal, or will sometimes forget to schedule some blocks.
Change-Id: Iaeb45f2b757b676310be25a658ceadc07d5722ec
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When doing edge resolving, too many spills were generated, and the
dependency tracking of moves was not complete. Now we only insert spills
that are caused by phi-nodes (because any other spill would be generated
at the point a variable was defined). However, there can still be
multiple dependencies between the moves generated by the edge resolving.
Instead of only checking the first dependency, all of them are tracked.
The bug report was a case where an unneccesary spill was generated, that
got tracked, but "suppressed" the other (valid!) dependent move. The
randomness was caused by the hash seeding of QHash.
Task-number: QTBUG-35840
Change-Id: Ifbc3c8fc13de53c46a8b5859721b2497189921a3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes the dominator frontier storage from a set of basic-blocks for
every basic-block to a BasicBlockSet for every basic-block. This new
class stores a maximum of 8 nodes in a vector, and switches to a bit
vector when going beyond 8 nodes.
This is important in two cases: most basic-blocks have 2-3 nodes in the
frontier, and an array is faster than a set in these cases. The few
cases where the frontier goes beyond 8 nodes, is when a switch
statement is used with lots of cases that all fall-through.
On regress-74474-003.js this reduces peak memory usage from 1.68G
to 60M. The switch statement in this test results in 27000 basic-blocks.
Change-Id: I42646522ba9f8642d42a5d70fc6b760bb47ae69f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Property access to id objects is optimized at compile time, but we cannot do
that for QQmlPropertyMap instances (or generally fully dynamic types).
This issue was a regression against Qt 5.1
Task-number: QTBUG-35906
Change-Id: I759a1a899f6a3a1f6466282f455b289ad7451086
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a regression against 5.2.0 (which didn't have this bug), due to
optimizations introduced in the stable branch after the release. The code path
for optimizing access to the members of C++ based singletons through the
regular meta-object properties would end up excluding access to enums when the
lookup happens at run-time. The run-time getter for the singleton itself would
return a wrapped QObject instead of a QQmlTypeWrapper, and only the latter
includes enums.
As QML based singletons (composite singletons) cannot declare enums, we can
continue to do fast lookups on these, but otherwise have to fall back to the
slower code path.
Task-number: QTBUG-35721
Change-Id: Icc66bdaf3572622cdb718f82b706e3204afa0167
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
Calculation of all the children of nodes in the dominator tree is now
calculated as a local variable right before computing the dominator
frontier. The effect is that they are not retained after their only use.
Change-Id: I83c962c691b78cb767708eb04cf30d3b7a760deb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
Both type inference and the optimization pass do not do anything with
unconditional jumps. So, instead of adding them to the worklist and
later on removing them again, it’s faster to never add them in the first
place.
Change-Id: Ib81d43e9ea6df2b1a70e9dd1e9b9c29cb6d345d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
Replace hashes from basic-block to basic-block with vectors that
associate basic-block index to basic-block index.
Change-Id: I834ea3d825e4d2b02c075b1b0f080f5a65f41317
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
|
|
|
|
|
|
|
| |
Also fixed some comments.
Change-Id: I4aedff84bdbf8de248025bc48805a859704bdd8a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
This makes time- and memory-complexity a lot better when compiling
big JavaScript functions.
Change-Id: I2a7cb9b5979844254747fa5cf7355cca0b113904
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the
expressions in PropertyChanges {} introduced a regression in where the
evaluation context was incorrect and thus bindings would not be able to
access the correct properties. For example
PropertyChanges {
target: someObject
y: height / 2
}
Here height should be looked up in the context of "someObject", not of the
PropertyChanges element.
This patch introduces an auto-test that verifies that the lookup context is
correct and fixes the bug by disabling accelerated compile time property
lookups for binding expressions that are requested from a custom parser.
Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
Replace the recursive calls and subsequent clean-ups by pushing actions
on a to-do stack, and processing that stack in a loop.
Change-Id: I83536e88d400592b6e9f5fda3d795e41711a131a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a follow-up to the previous commit, this patch cleans up the data structures
used to track dependencies of QML binding expressions and functions to context
and scope properties, determined at compile time.
Instead of "collecting" these depending properties upfront (codegen time), we
propagate the information that a property is a context or scope property into
the IR at codegen time and later in the isel collect these properties and their
notify signal index in a hash in the IR functions. The CompileData structure
generator then can read these hashes directly when writing out the dependency
information.
Change-Id: I32134706e2d24bf63d1b1abad0259ab072460173
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were incorrectly calculating writing to a context or scope property as a
dependency for an expression. We don't know whether a property is being written
only or also being read from at lookup time, but we can make that decision in
the isel then when generating the move instructions.
So initially context and scope properties end up in a candidate set first
and get promoted to real dependencies when they're being used in reading
moves.
Task-number: QTBUG-35210
Change-Id: Ia67057abafc2d611e1e6605327b4965ebe91cbed
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: I5cb0c7798d0e530f3137710bf0e723bd7b64dc89
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: I9926f1ab10ea04387f17794944dcc11f4a2a9054
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
| |
This avoids a hack in QV4::Codegen where we created a V4::String
on the stack to convert to an array index.
Change-Id: I9a88d45817bbcde52a4037a52fbae299b8c9cb1a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
| |
The wrapper method for Function::code() was still there
from the times we used C++ exceptions. It's not needed
any more, so get rid of it.
Change-Id: I2ec25fbca71eeef9d7a94a38b5adfa42e4de3a84
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: I0e35533af7f65200a8bc3c4024c29344fa6f4b7a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
E.g.:
a | 0
b & 0xffffffff
These operations force the operands to be converted to int32 without
changing their value. At this point we already added convert calls to
the IR, so we can safely get rid of these operations.
Change-Id: Ic4d3b989e13439eccd2c878fa7bf5030acae7630
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
| |
Fixes a crash in octane.
Change-Id: Ib72ac0b7a2941230a87543f30fcf7e55d7094886
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
Both the base and the index of a subscript can (and are allowed to) be
other things than temporaries.
Change-Id: If073e262712bab488f18eac5ebe097be99c40359
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
For properties on id referenced objects, we can ignore the lack of the FINAL
keyword on properties, as we want the same "lexical" lookup rules like for
properties on the scope or context objects. In addition we need to initialize
the resolver on the returned temp, to ensure a successful type determination in
the use of the id object afterwards.
Change-Id: I496c942ade55aa331e6972f06b21c2c86d4b00a4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
We can't do a fast property index based access on them, due to the inability to
read individual fields from the original object (i.e. the logic in
QQmlValueTypeWrapper). However what we can determine and propagate is the type
information of the individual properties, i.e. that the x and y properties of a
QPointF are always doubles.
Change-Id: Iee71ece2117294b7bc0b93deb0a77d7c51148b11
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
| |
This helps to optimize property access, especially for attached properties.
Change-Id: Id47a9c5f184f84ce5ab813d3b01d1a6c6031233e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* Resolve lookups in namespaces at compile time and instruct the SSA optimizer
to eliminate reads from the namespace (QQmlTypeWrapper) if possible. For example
access to attached properties of types (i.e. MyNameSpace.ListView.isCurrentItem)
requires neither reading the namespace nor the type.
* Add support for accelerated lookup of attached properties
Change-Id: Ib0b66404ed7e70e1d4a46a1ac8218743a4cc8608
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|\
| |
| |
| |
| |
| | |
into stable
Change-Id: I0bf06be69927d5961f1bdb4948c3572ef6111923
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the index is a double, the branchTruncateDoubleToUInt takes care of
branching when the index is negative, but when it's an integer we need
to perform that check ourselves.
Without the patch it's rather easy to cause the application to crash.
Change-Id: If908923ddc2077b3fb3dd42350f038ff0072e8e1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We store QQmlPropertyData pointers in our IR for Qt meta-object property
resolution at compile time. As it turns out however, it is possible that these
pointers change after retrieval from the QQmlPropertyCache, as the cache may
change later in the compilation process. Therefore we must do what also
QQmlCompiler does by storing a copy of the QQmlPropertyData. For the JS IR we
can do that conveniently through the IR memory pool.
A side-effect of this bug was that QQmlPropertyData pointers were re-used
and so the identity check in the isel later such as
_function->contextObjectDependencies.contains(m->property)
for dependency tracking failed. In the example given in the bug report it was
determined that the window.contentWidth property wouldn't need a property
capture, and therefore the binding was not re-evaluated as window.contentWidth
later in the binding evaluation phase received its correct value.
This patch also fixes the incorrect debug output names assigned to JS binding
expressions, where the index used to look up the name is per compiled object,
not per QML component.
Task-number: QTBUG-35063
Change-Id: I3e5bbfaac11e5c122a2ed15a3e486a93988e1b6e
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With this patch we determine the meta-object of singletons, propagate it into
the IR and load them separately using a dedicated run-time function. In
addition enums in singletons and QML types are resolved at compile time.
Change-Id: I01ce1288391b476d1c9af669cb2987a44c885703
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
...instead of a special MEMBER type. This allows removing the
type member from V4IR::Member altogether (and thus unshadow from
V4IR::Expr::type). By not requiring the base of a id lookup
member expression to be a NAME, we can also speed up repeated
id lookups by fetching the id object array wrapper only once
per function.
Change-Id: I3e9b8f498d32ace4a0cc2254f49e02ecc124f79c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| | |
It is technically redundant to the Member::property field.
Change-Id: If0ee35b2c94a2c9373784d36a1f8dfe8ad7dcfb3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of querying for the context, scope or imported scripts object on each
access, do it once at the beginning of the expression in the IR and re-use the
temp. The optimizer will optimize away unused temps.
Change-Id: I703e737469030c4454d23c567873012a2b537d71
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Propagate QObject properties in member expressions across temporaries
as part of the type interference SSA pass. This replaces the earlier
attempt to resolving QObject properties in fieldMemberExpression()
in the codegen, but it was incomplete and now things like the following
are fully resolved:
var tmp = blah.somePropertyThatReturnsAQQuickItem; <-- QQuickItem property return type propagated into tmp
var width = tmp.width; <-- and picked up here again to resolve the index of width instead of by name
With this patch Temp gets a helper structure with a function pointer,
initialized to aid the resolution of properties in Qt meta objects. This
structure is propagated into the temps until it reaches the next member
expression that uses the temp. Similarly QObjectType is added as IR type, next
to VarType.
The resolution inside the SSA type interference pass also requires passing
through the QQmlEngine from the upper caller levels, in order to resolve the
property type to a potential QMetaObject property.
Change-Id: I14c98fa455db57603da46613ce49c174d0944291
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of storing the current instruction pointer in the
ExecutionContext, we might as well directly store the current
line number there.
Leads to simpler code, works cross platform and should also
be faster.
Change-Id: Ifb7897cf8dbe8a962505fe876aa3ed43283ebb06
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|/
|
|
|
|
|
|
| |
This is not used that often, but it removes one more place
where we do lookups by name.
Change-Id: I9f798b8b4a64be3fdf3e53090e4288724c9d2b22
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
Assert failed for cases where the node’s ancestor with lowest
semi-dominator number was not the same as the parent. The test case
exemplifies this.
Task-number: QTBUG-34792
Change-Id: Ie6847b22a27211801bff7479bfcbfaf329c6005a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
References to id addressed QML objects are member expressions, which are unlike
other member expressions by not being lvalues. Handle this correctly.
Task-Number: QTBUG-34890
Change-Id: Ied6230edbc561128ad36bf0d1a1918185204deec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Changed three recursive routines to worklist-based iterative ones. This
not only speeds up the dominator frontier calculation, but also prevents
the algorithm to run out of stack space.
This is a partial fix for QTBUG-34047.
Change-Id: Ife8dc35724d50408ad356e1621884bdb82db9626
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-34152
Change-Id: Ibb93d1cac8c343a7ca34ce7d010f24fc56ba89df
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous approach of collecting the dependencies through an IR visitor
doesn't work, because it relies on a fixed structure - for example MEMBER(NAME,
prop) - which we can't guarantee (it's usually MEMBER(TEMP, prop)). But it
turns out that we can only pre-calculate dependencies for context, scope or id
properties, so we can do that right away in the QML specific JS codegen, store
that information in the IR function and use it from there in the data structure
generator as well as in the isel as a parameter to getQObjectProperty to tell
the run-time whether capture is required or not.
Change-Id: I33711c3420d6534c653c2a6a4284f0fc12e941cf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
When converting a double to int, make sure we check for >= 0
before using it, otherwise we get out of bounds accesses.
Task-number: QTBUG-34635
Change-Id: If72e116c08fe1dff03cd88ce510cf8b96d249b92
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous version left unreachable cycles untouched. For example in:
function f() {
if (false)
while (true) { doSomething(); }
anotherThing();
}
The edge to the then-part would be removed, but the loop itself would
not be removed. This resulted in the basic-block scheduler choking when
hitting the block with the anotherThing() call, because it wants to have
all blocks from incoming edges resolved first.
Task-number: QTBUG-34776
Change-Id: I5b3a79140e6058c4ade4ec7687c1a795f1a74f97
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
|
|
|
|
|
|
|
|
|
| |
Otherwise clang generates a warning which is fatal because of
treating warnings as errors.
Change-Id: I47c280edf6b0f8efa5ce24f9e92551304aed15fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If there are multiple incoming edges to a block, and there are one or
more phi nodes at the start, then only check the temp uses for the edge
we are resolving.
Task-number: QTBUG-34770
Change-Id: Ibb5c7c323d6be8bc1ed492b08ed098de2f2726cc
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
|