| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Instead of collecting all compilation units in a hash, let's collect
linked units in a doubly-linked lists that makes the removal at
destruction time dramatically cheaper.
Change-Id: I9fd59600d082be3566f605d90f14a86a58ac9296
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Accoding to the standard the regexp objects created by literals should
be separate objects as if calling new. We were violating that by caching
the same object for every instance of a literal.
This also fixes a problem with leaking values of lastIndex between
separate instances of the same global regexp literal.
Task-number: QTBUG-62175
Change-Id: Ib22e9ee68de1d1209fbd4212e72f576bc059d245
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
This way we don't have to manually initialize and delete them.
Change-Id: I0104c744dba380e957271d0924498e3643856e9e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This saves another pointer on all Objects.
Currently introduces a slight performance regression
on some of the v8 benchmarks, that needs addressing.
Change-Id: I87de8e1d198d2683f4e903c467ce2a60ba542243
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
And store them in an enumerated array. This will simplify
upcoming changes.
Change-Id: I82eac03b9f6264843ae625e36e150464fe08be9d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Idf87618e4ebff99f3b3c269c950191d67a0182b2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I5d1e0d2251e04cc871f9c298849aafac17f23fbf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the Runtime function pointer array into EngineBase so that
we can eliminate the last use of qOffsetOf.
For improved cache locality the memory manager point is now also
located in the EngineBase.
Change-Id: I0b3cf44c726aa4fb8db1206cc414a56c2f522a84
Task-number: QTBUG-58666
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current way of encoding the offsetof() of the method_ members in
QV4::Runtime is not portable when cross-compiling from a 64-bit host
(where the offsetof would be calculated on) to a 32-bit target (where
the offset would be different), or vice versa. In preparation for making
this work, this patch first replaces the direct use of the run-time
members with use through a void * and an enum for indexing. This gives
us some type-safety in some places and will also allow for a translation
of the pointer offset from host pointer indexing to target pointer
indexes.
As a bonus we can avoid going through the engine->runtime indirection in
the interpreter altogether and call the static methods right away.
Task-number: QTBUG-58666
Change-Id: I3cd6459523923a9719408317fa729bca19c2bf3c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The offsets of members encoded in JIT generated code differ between
32-bit and 64-bit architectures. This patch moves some of the
ExecutionEngine members into a separate standard-layout EngineBase class
(in line with the same class in commit
2a554434a571dcefd26cf10ef8c5ae8b3b7d66db and subject to merging). By
ensuring that the members are stored at pointer intervals, we can
translate from host pointer size to target when generating the code.
Task-number: QTBUG-58666
Change-Id: I1c38a7da059826848b80fd9972ed073214501386
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Create a PropertyList prototype, and add the push method to
QQmlListProperty that call the append function if it has been defined.
Added a unit test and updated the documentation.
Change-Id: I2647766e98b60bf0546f6d6ed1422a616e0d3a07
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Now that the code paths are very similar, we can simply to the
check whether to do a fast or slow function call in
ScriptFunction::call/contruct. To make this fast, cache the
result of the required check in QV4::Function
Change-Id: I03085ca2beb83b1721b60b0d7b2ab4c9266d1e48
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
The class should get merged with the QV4::QmlContext class.
Simplify the cleanup by moving both classes into a common
file.
Change-Id: I0074da79701d5f41eb51681b70fcde85bfd45fc1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ib044be254dbb41bd9fb4a6e0baa3bd3c007e6a2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The JS stack allocation initializes the contents, but in most cases the
caller will immediately store a value in that stack slot. When the
allocation code is inlined, the compiler can use dead store elimination
to remove the unnecessary initialization code.
Change-Id: I0495417adc7c1c8764f845032611bd506a8b7df9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Replace the hand-written gc and print functions with the print and gc
functions also used in Qml and QJSEngine. And while we're at it, this
also adds the console object.
Change-Id: Ia3a0ff24936b7ed5149cb689838b987f9178131e
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
GCC would often generate a call to a special "safe" version of memset,
which would in turn prevent inlining in many cases. A simple for loop
does not prevent inlining, and compilers can still decide to replace it
with a memset. It also makes it easier for the compiler to do dead store
elimination.
Change-Id: I60fa3e321c2edb9225699bf57e8a31a3f8356ddc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By specification, date conversion functions for dates before the epoch
are not DST corrected. We converted QTime to a QDateTime where we set
the date part to Jan. 1, 1970, and then convert that to msecs since the
epoch UTC. For places on Earth where they had DST on that day (e.g.
Hobart in Australia), strange things happen: conversion from a QTime to
DateObject will use DST (because it's after the epoch in local time),
but conversions from DateObject to QTime won't use the DST because it's
before the epoch (in UTC).
Now as everyone knows, a 24-hour clock time has no meaning without a
date, only "elapsed time" has. But users still expect to be able to pass
QTime to QML/JS. So, we do the conversion on day 0 of month 0 of year 0,
and all of it in local time. This gives a stable conversion in both
directions, and the values in both C++ and QML/JS are the same for any
timezone (with or without DST) on this planet.
Task-number: QTBUG-54378
Change-Id: I892e16a93f015e92d311c6cae3ae7768b7373f6a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
| |
It's debatable if the uglification is worth the overhead of a few
pointers.
Change-Id: I63b55b2043b8752a94d4b862c3892915135a72b7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
This will allow us to #define them away on -no-qml-debug, saving two
pointers per engine.
Change-Id: I400cffd32cd7f55ff0e68565734b6002b9f901d5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
This way QtQml doesn't need to know the ctors.
Change-Id: Ie74049092b5eb9837537591c0cf37ad1487e4066
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
This method is used in ExecutionEngine::getProperty, which is called
quite often.
Change-Id: Ide49d158005ef1d9f51d1e734cf9e3b19f52cf26
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation of many (or all) runtime functions consist of first
creating a QV4::Scope, which saves and restores the JS stack pointer.
It also prevents tail-calls because of that restoring behavior. In many
cases it suffices to do that at the entry-point of the runtime.
The return value of a JS function call is now also stored in the scope.
Previously, all return values were stored in a ScopedValue, got loaded
on return, and immediately stored in another ScopedValue in the caller.
This resulted in a lot of stores, where now there is only one store
needed, and no extra ScopedValue for every function.
Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/jsruntime/qv4engine_p.h
src/qml/jsruntime/qv4runtime_p.h
src/qml/qml/qqmldelayedcallqueue.cpp
src/qml/qml/qqmlvaluetypewrapper.cpp
src/qml/qml/qqmlvmemetaobject.cpp
src/qml/qml/v8/qv8engine_p.h
tests/auto/quick/qquicktext/tst_qquicktext.cpp
Change-Id: I3f0608c7beb88088cbbef4d0db59920f56deaea9
|
| |
| |
| |
| |
| |
| |
| |
| | |
All other changes are just to be able to include qv8engine_p.h in
qv4engine_p.h
Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4engine_p.h
Change-Id: I89ffccd699bee675732758d039e22224b275d60d
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Getting the native stack size can be really expensive. For example, on
Linux/x86_64 (Ubuntu 15.04), it is at least 200,000 instructions for a
single-threaded application. With more threads (like qmlscene) it typically
ends up around 1M(!) instructions. Worse, it is called twice in the
ExecutionEngine constructor.
So, now we limit the depth of JavaScript calls to a fixed number, 1234 by
default. This can be changed by setting the environment variable
QV4_MAX_CALL_DEPTH to the desired depth.
Change-Id: Ic13c8efb2769e64fbc73deee6f6fa39d7c0b7af5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The old code was using absolute addressing for calls into
methods of the Runtime. This produces non relocatable code,
which is bad for caching.
So instead, we'll have a table of function pointers for all
runtime methods in the ExecutionEngine, and do the runtime
calls through that table.
Change-Id: I75c04f699ea11c38f742575f9ce264c0c5ad0c96
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
We will need to access the runtime API in the engine, so
let's separate the API from the implementation details.
Change-Id: Iaa638fa19cc3859fcd210963396a248e64fb6955
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
| |
| |
| |
| |
| | |
Change-Id: If9d1f87fd7cf0b12d2827c4574109234be7e8ab8
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|
|/
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
... into a pure interface and a QV4::Debugging::V4Debugger implementation.
This is in preparation of a second implementation of this interface
to be used with 'native mixed' debugging.
Change-Id: I3078dcfe4bdee392a2d13ef43a55ca993e7b88d8
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
|
|
|
|
|
|
| |
Task-number: QTBUG-48594
Change-Id: Ifc207938de7f0c8995fc712df92665f222612647
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
|
|
|
|
|
|
|
|
|
| |
Move the connect/disconnect methods for signal handlers into
their prototype, so that we don't need to define them per instance
anymore.
Change-Id: Iac1e6d1dd7bce86730dbb6c51e2c3f79713641f7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I79a7093c7086ea7f34252f097f18fe7c835053aa
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
| |
Gives around 10% speedup on the v8 splay benchmark.
Change-Id: I47f64e7b73bde59ac3bdd2c94fc199ecfbbf290e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the name and message property into the prototype as
per JS spec. Only define the message property in the
object itself if the value used for construction is not
undefined.
In addition, clean up creation of the objects and centralize
it in a few template methods.
Change-Id: I014017b710575b30bf4e0b0228111878f5c73b9a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I533c7bf90d49aee10b5661fd15a98e013b1169bd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Gives around 10% speed improvement on the v8 regexp
benchmark.
Change-Id: Iad37bcbc79ccbfb92f65852b660364c919862a75
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I0241efe10d115f8e4a646f840e47e220eb6cfc18
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I9bfc96096ec5e2c8bd4d3c5bad13fc78ae657962
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Now that the other method is gone, let's use
the shorter currentContext
Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Ic79d6da162375928ec25871cd0341daeab6483d2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This saves one pointer per allocated execution context.
Now every execution context that is pushed, allocates two
Values on the js stack. One contains the context itself, the
other one the offset to the parent context.
Things are a bit tricky for with and catch scopes, as those
are called from the generated code, and can't open a Scope
anymore. In addition, all methods iterating over the js
stack frames need to work with ExecutionContext pointers,
not ScopedContext's.
Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Avoid the implicit push inside the execution context constructor
and rather make this explicit in the code.
Change-Id: I1bb0fb523fddbb273fc666370d619f55f49cd40a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Always operate on the current context (as that's what we do
in practice anyway).
Change-Id: I4171207a7a86e69aa685754956c0764ac6e152a7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Id8c0d9e15dd85b3818e283ab6769a49bb2e6d0f7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
| |
One more step towards removing the class alltogether.
Change-Id: Ic9f6794eb3c5c6605ee43ad23a6d432ebbf321a1
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The union in QV4::Value is used to do type punning. In C++, this is
compiler-defined behavior. For example, Clang and GCC will try to detect
it and try to do the proper thing. However, it can play havoc with Alias
Analysis, and it is not guaranteed that some Undefined Behavior (or
Compiler depenedent behavior) might occur.
The really problematic part is the struct inside the union: depending on
the calling convention and the register size, it results in some
exciting code. For example, the AMD64 ABI specifies that a struct of two
values of INTEGER class can be passed in separate registers when doing a
function call. Now, if the AA in the compiler looses track of the fact
that the tag overlaps with the double, you might get:
ecx := someTag
... conditional jumps
double_case:
rdx := xorredDoubleValue
callq someWhere
If the someWhere function checks for the tag first, mayhem ensues: the
double value in rdx does not overwrite the tag that is passed in ecx.
Changing the code to do reinterpret_cast<>s might also give problems
on 32bit architectures, because there is a double, whose size is not the
same as the size of the tag, which could confuse AA.
So, to fix this, the following is changed:
- only have a quint64 field in the QV4::Value, which has the added
benefit that it's very clear for the compiler that it's a POD
- as memcpy is the only approved way to ensure bit-by-bit "conversion"
between types (esp. FP<->non-FP types), change all conversions to use
memcpy. Use bitops (shift/and/or) for anything else.
- only use accessor functions for non-quint64 values
As any modern compiler has memcpy as an intrinsic, the call will be
replaced with one or a few move instructions. The accessor functions
also get inlined, the bitops get optimized, so in all cases the compiler
can generate the most compact code possible.
This patch obsoletes f558bc48585c69de36151248c969a484a969ebb4 (which had
the exact aliassing problem of the double and the tag as described
above).
Change-Id: I60a39d8564be5ce6106403a56a8de90943217006
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
|