| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
This was missing from f21e8c641af6b2d10f0d7e7e0fc6a755dab3673c.
Task-number: QTBUG-48524
Change-Id: I5cc6a979d965a1ef6b7fbc916a7ca9df868b459a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
| |
Task-number: QTBUG-48594
Change-Id: Ifc207938de7f0c8995fc712df92665f222612647
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
|
|
|
|
|
|
|
|
| |
This brings us one step closer to getting rid of the
QQmlContextWrapper.
Change-Id: Ied57f4c174c2ebd95096310a4ad4c0c28787e7a4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
| |
And get rid of another temp in the IR.
Change-Id: I039393e020e5141f1986aee276246c30fd8057f3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
Add some runtime methods to access properties of the scope
object directly (using the QmlContext), and generate proper
code to call those.
Change-Id: I0b29357c9a3b9ad53ba568ec6cb763e8ecb10f21
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our generated code (JIT and interpreter) should operate on the
QML context to retrieve QML related things. That's better than
operating on 4 different temps.
So this commit introduces the QML context as a temp in the
code we generate for QML. The next commits will move things over
to use that context with specialized runtime methods instead of
using generic subscript/get calls on the different subobjects.
Change-Id: Ia05cf339de9cdd23003f35cf78ede17d2590f8de
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the QQmlScriptString we store the binding id and it is an index into the
runtimeFunctions array of the compilation unit. However we don't store the
compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve
it from the cache via the context url (we have the context after all). That
turns out to be not a reliable way, as sometimes the URL might slightly differ
from the originally compiled cache (qrc:/// turning to qrc:/ maybe).
Consequently the type is (unnecessarily) compiled again and unfortunately not
_linked_, therefore the runtime functions array is empty. Another option is
that when the component was created from a QByteArray, then no entry exists in
the cache in the first place.
This patch addresses the problem by storing a reference to the compilation unit
in the QQmlContextData. That we can safely retrieve and it'll make sure the
compilation unit also stays alive.
In the process of that the manual reference counting was switched over to
QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit.
Task-number: QTBUG-41193
Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL
Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
|
|
|
|
|
| |
Change-Id: Icbdf06a077014db5dd57cba42f84591433ec4196
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The coverity scan utility didn't understand the code flow and assumed
the compiledData would be leaked. Use a QScopedPointer and have the
::backendCompileStep() forward the ownership. From what I see the code
has not leaked memory.
Fixes: CID 10605, CID 10607
Change-Id: I7759f681871bbe12e2aa320a5f39c47c70f4e4e0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are a couple of reasons to split the temporaries off from the
arguments and locals:
Temporaries are invisible, and changes to them cannot be observed.
On the other hand, arguments and locals are visible, and writes to them
can be seen from other places (nested functions), or by using the
arguments array. So, in practice these correspond to memory locations.
(One could argue that if neither nested functions, nor eval(), nor
arguments[] is used, the loads/stores are invisible too. But that's an
optimization, and changing locals/arguments to temporaries can be done
in a separate pass.)
Because of the "volatile" nature of arguments and locals, their usage
cannot be optimized. All optimizations (SSA construction, register
allocation, copy elimination, etc.) work on temporaries. Being able to
easily ignore all non-temporaries has the benefit that optimizations can
be faster.
Previously, Temps were not uniquely numbered: argument 1, local 1, and
temporary 1 all had the same number and were distinguishable by their
type. So, for any mapping from Temp to something else, a QHash was used.
Now that Temps only hold proper temporaries, the indexes do uniquely
identify them. Add to that the fact that after transforming to SSA form
all temporaries are renumbered starting from 0 and without any holes in
the numbering, many of those datastructures can be changed to simple
vectors. That change gives a noticeable performance improvement.
One implication of this change is that a number of functions that took
a Temp as their argument, now need to take Temp-or-ArgLocal, so Expr.
However, it turns out that there are very few places where that applies,
as many of those places also need to take constants or names. However,
explicitly separating memory loads/stores for arguments/locals from
temporaries adds the benefit that it's now easier to do a peep-hole
optimizer for those load/store operations in the future: when a load is
directly preceded by a store, it can be eliminated if the value is
still available in a temporary.
Change-Id: I4114006b076795d9ea9fe3649cdb3b9d7b7508f0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Properly convert the argument to an object if
it's not null or undefined as mandated by the
standard.
Add a similar test case for the with statement.
Change-Id: Idd8e245e8dae4803eb0e2010e3d43bb912670444
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
| |
Make sure stepping works correctly, and we always
break at a valid breakpoint.
Change-Id: I6a3032b3ae204484b8a92b2031904a7f681c7f80
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
| |
compile time
Change-Id: Ieb7f6ee97a4f251f1e2369850ebb9e2931f84ac1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
| |
QQmlJS::MASM -> QV4::JIT
QQmlJS::V4IR -> QV4::IR
Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
| |
See 612785f39e325b0578be89e09b0e32d7d08d471e for details. The warning is
exactly the same as before, with the exact same solution as before.
Change-Id: I2f6cbc64234696f1d240611f376ab5daf8d0f89c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
Remove SafeValue, it was used to port over to an exact GC. Since
we now have that, we can now safely merge it with QV4::Value
again. Also rename SafeString to StringValue for better naming
consistency.
Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to
qv4value_inl_p.h.
It makes more sense to have the class definition in the file
that is named after the class and move the inline methods into
a _inl file. Doing this now, as I expect we'll be needing a few
more _inl files soon.
Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51
Reviewed-by: Simon Hausmann <simon.hausmann@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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
The life-ranges are only valid when the IR is in SSA form. So the use
of them in the interpreter after converting out of SSA form introduced
bugs. Instead, allocate a stack-slot for each unique temporary, and
re-use the code for this from the JIT.
Change-Id: I294f1116064f0b85996cf96a0b408b41a3c785e2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a non strict mode function uses the this object, we
need to make sure it's being correctly converted into a
object before being accessed. So far this was being done
by ScriptFunction::call. Move this into the generated code to
avoid overhead for methods not using 'this', and simplify our
ScriptFunction::call() implementation.
Change-Id: I739f4a89d29ed8082ce59e48d1523776224fc29d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
The QQmlContextData stores the JS objects of imported scripts in a
QList<PersistentValue>. Instead of indexing into that list, this patch changes
ctxt->importedScripts to be a JavaScript array, that in the IR we can index via
subscript.
Change-Id: Ie2c35fb5294a20a0b7084bb51d19671a27195fec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
We can resolve the use of names that refer to imported scripts at compile
time and load them at run-time by index through context->importedScripts.
Change-Id: I681b19e7d68dbf3b9a68af00b4cea2a9254c2d78
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
After the resolution of a property, we can set it by index at run-time instead
of via name resolution.
Change-Id: I479599dabe343cf9e6582dcda12291aebfcce418
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
objects at QML compile time
This avoids having to do a string lookup for ids and in the import cache at
run-time, before we can do a string hash lookup in the property cache. Instead
we resolve final properties in the context and scope object at compile time and
look them up at run-time using their index instead. The dependencies to these
properties are also tracked separately and recorded in the compiled data.
This is merely the initial patch. There's a lot left to do, such as having
specialized getter and setters for specific property types. Setters are missing
altogether right now and will fall back to name lookup.
Change-Id: If3cb4e7c9454ef4850a615f0935b311c9395b165
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can resolve lookups for objects referenced by id at QML compile time
and use a run-time helper to extract the id object out of the QML context
data by index instead of name.
Dependencies to id objects are also tracked at compile time and registered
separately before entering the generated function code.
The lookup of id objects is encoded in the IR as special member lookups.
Members will also then in the future be used to for property lookups in context
and scope properties, as well as any other property lookups in QObjects where
we can determine the meta-object.
Change-Id: I36cf3ceb11b51a983da6cad5b61c3bf574acc20a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simplify the generated code. Add a special block to catch
exceptions thrown inside a catch() statement.
store the exception on the stack when entering finally and
rethrow it at the end. This ensure correct behavior for
break/continue/return statements inside finally.
Don't check for exceptions after calling push_catch_scope
and pop_scope in the JIT'ed code. This can lead to infinite
loops when throwing inside an exception handler.
Change-Id: I67e9325794e2fd25b0773b21e02fbaadb43faab0
Change-Id: Ic1ea9c0c43eec1d49177dc1ab4552a1da04e96fe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start the work to remove c++ exceptions from our JS
exception handling. Rather rely on engine->hasException.
Check the flag after we return from any runtime call in the
JIT.
Implement new try/catch handling code in qv4codegen and
for the JIT that doesn't rely on exceptions. As an added
bonus, we can remove the Try statement in the IR.
Change-Id: Ic95addd6ae03371c43c47e04cac26afdce23a061
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not generate jump instructions when the target immediately follows
the current basic block, even if there are intermediate jumps in between
as long as they jump to the same basic block. In the IR snippet below,
no jumps will be generated at all.
…
L8: goto L6;
L12: goto L6;
L6: goto L4;
L11: goto L4;
L4: goto L2;
L10: goto L2;
L2: ….
Before this change, the gotos in L8, L6, and L2 were still generated.
Change-Id: I718ed0d41c603a6905f2279b782cd9e9cafb7d55
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: I889e760f75b485a28e1f2a2c26b2337ae9bfafac
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
| |
Inplace operations are expanded when building the IR, so the neither the
IR, nor the instruction selection backends or runtime need to handle
them.
Change-Id: Id01f9544e137dd52364cf2ed2c10931c31ddfff3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|\
| |
| |
| |
| |
| |
| |
| | |
This brings in the infrastructure for the new compilation of QML and JS
in the loader thread and the new VME replacement for creating objects
in the GUI thread.
Change-Id: Ib8127c10f5cb3ad238e57469723d031ab765a79b
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4isel_masm.cpp
src/qml/jsruntime/qv4script.cpp
src/qml/qml/qml.pri
src/qml/qml/qqmltypeloader_p.h
Change-Id: Ia784d855a2131e3289454f12d841ca2c65be15c1
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/qml/jsruntime/qv4script.cpp
Change-Id: I20136cab29d86862b5bd9208003200bc24bcdacf
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is needed for QML unit generation, when we share the JS generator
for QML types/strings and JS code.
Change-Id: I50f0c1fa6721d6e3e59417c6c256c82aec124e8f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
clang complains about our usage of offsetof(). What we do is not
strictly c++98 compliant, but compliant with c++11. So replace
the default offsetof with a handwritten macro to shut up clang
until we can switch to c++11 mode for all compilers.
Change-Id: Id724adb323ba9724ad5d7d9e0dba5a73b51af24f
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We generate lower level code in codegen and don't use these
runtime methods anymore.
Change-Id: If1023ce5295431305f4528839bcf2a3031fa7ad2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our synthetic exception unwind table for ARM is located at
(char *)codeStart + function->codeSize;
This relies on function->codeSize to contain the number of bytes of
instructions the function has, not the size of the MacroAssemblerCodeRef
(which contains the size of the entire area).
This patch fixes the calculation of function->codeSize and also replaces
the QHash for the IR::Function* -> CodeRef mapping in the masm backend
with a simple vector that's perfectly sufficient.
Bug spotted by Petr Nejedly
Change-Id: I78a53599085c613c6d97aa2490922f54e0bb4f63
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|/
|
|
|
|
|
|
|
| |
Like this we can hand the CallData through the runtime methods
without any need to modify them. This simplifies the code in there,
and should also speed them up to some degree.
Change-Id: Ibd92ff4a8f279a5c4a054c5678646f658cfed5ca
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment we collect a lot of compilation units (one per binding
expression!), which for long running QML accumulates and creates a horrible
performance when trying to retrieve back traces. There is work in progress
to reduces the number of units down to one per QML file, and then the
fixed sorted QVector might proof to be a more efficient data structure
for the lookups.
But until that code lands, this patch proposes to use a QMap instead for the
time being, that tracks all functions. This brings down the qtquickcontrols
auto-test run from 2.5 minutes to just under a minute on my machine.
Change-Id: I45bf609055877081daa984de90f291a030f2f24f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable the register allocator for X86_64 on Linux and MacOS. The
implications are:
- handle as much as possible with current code with as few changes as
possible
- temporarily force the register allocator to spill unop/binop arguments
to the stack by doing a call in the implementation (as is the current
case), so no change is needed here
- only have loadThis and loadConst handle registers
- have any method that might need to handle registrers actually cope
with them
- the inline versions of binops are not generated, as they cannot cope
with registers. This will change when ISel for binops is added in the
next patch.
This means that we are still running with the handbrakes on, but allow
for full-throttle in certain/limited cases.
Note about the changed test: multiplication always returns a Number
(double), so the operands are passed as doubles, so __qmljs_mul will
return a double. For addition this is different: because it might return
a Number or a String, the operands are passed as whatever fits best. So
__qmljs_add will return an int when both operands are ints. Hence the
change to the tests.
Change-Id: If5bd7dffca8f7de5ba45af700b9c7bb568fc74b7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
into dev
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4codegen_p.h
src/qml/compiler/qv4isel_moth.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtime_p.h
src/qml/jsruntime/qv4script.cpp
sync.profile
Change-Id: I1d785e2134bffac9553a1c16eed12816cbd1ad2c
|
| |
| |
| |
| |
| | |
Change-Id: I99004b872be9bd7d9dd0c798eb2d9bb4ddfa4cbd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|