| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
As per reported bug, we have to protect ourselves against potential loops
and can mark the internal classes much simpler by just walking through
the memory pool they were allocated in.
Task-number: QTBUG-38299
Change-Id: I3ae96e8082e76d06f4321c5aa6d2e9645d2830a0
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is among other things needed to fix the qml import scanner to detect
dependencies from .js files correctly.
The patch also fixes the use of Q_QML_EXPORT towards Q_QML_PRIVATE_EXPORT
where appropriate and corrects the wrong include path for the double conversion
code to actually be relative to the file it is included from. This worked by
accident because of other include paths present in the build.
Change-Id: I338583dad2f76300819af8ab0dae8e5724c84430
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an ammendment to commit 60730cbb5e5475b5db6a15641211aa6958a93197
to further restrict the ability to set dynamic properties on JS wrapped
QObjects only on those that are associated with a qml context. Only one
such association comes with the static property lookup rules of QML and
therefore only those should be prohibited from dynamic properties.
The previous implementation on using the "compiledData" field to detect QML
association or not is not strong and reliable enough.
Change-Id: I10c0e6e58a2727c01a6cb56fdf912bf250333e1f
Reviewed-by: Jędrzej Nowacki <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
As the identifier table grows with long running programs, we may end up
allocating more identifiers than we have space left on the JS stack for them
alongside all the other objects in the environment. To mitigate this, we can
simply treat the identifiers as roots, mark them manually and only end up
putting sub-strings onto the JS stack if necessary.
Task-number: QTBUG-36183
Change-Id: Ie6994555305c84b007860792d066a8df60089847
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
Array methods such as forEach rely on the hasProperty boolean of getIndexed to
be set appropriately. Some getIndexed implementation - such as the
QQmlListProperty one - didn't initialize it correctly and therefore the
behavior was undefined.
Task-number: QTBUG-38088
Change-Id: I34bc3136d8cc2bc280397d0c4d5051e7d72269e8
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In QtScript you could add properties to a JS object that wraps a QObject.
Depending on the wrap option the property was either stored on the JavaScript
side or as dynamic QObject property.
In QJSEngine/QJSValue, neither was supported - properties could not be added.
For QObjects wrapped in JavaScript that weren't created by QML, we can restore
the behavior of storing dynamically added properties as JavaScript properties.
This makes porting from QtScript to QJS* much easier.
Task-number: QTBUG-37408
Change-Id: I5ef1f379c08c3d84de9bdcac9b6a9397238064de
Reviewed-by: Jędrzej Nowacki <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With a real prototype chain it can happen that an internal class' prototype's
class itself has a prototype. Therefore the first transition on the empty class
is a PrototypeChange one, but the class the transition leads to may have
PrototypeChange transitions itself, which weren't marked.
There are multiple solutions to this, but this patch is the minimal fix by
recursing fully through the internal class tree. That way it's easier to
back-port the fix also into 5.2.x based branches.
Task-number: QTBUG-37834
Change-Id: I901b13a2663fbad5844003ca5752f2f304de320c
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to avoid calling a destructor on objects
that don't require one. After the memberData change this
should be most objects.
Also fix a bug where we didn't call the destroy() method on
large objects, potentially leaking memory.
Change-Id: I1708055d568d85b0a3876899d35e8c3eb92dd222
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Move the allocated member data into the garbage collected
area, so that we can avoid using malloc/free for it.
Change-Id: I20625efa67ecd60238568742b74854b0c8cb2e3e
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Change the private header path to the canonical one. This fixes
shadow builds for me on Windows.
Change-Id: I7c18ec2d9f0769a51d296deac16c78ae41894c36
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Connection objects
We can re-use the expression we've compiled at QML type compilation time, as
long as we "inject" the signal parameters in the dynamic qml lookup chain.
Change-Id: Icc417531c41dea06ff5d033011179af49b03f542
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The right hand side of script string properties can be evaluated in entirely
dynamic scopes, due to QQmlExpressions' public API of allowing construction
from a QQmlScriptString and a variable scope/context. Nevertheless we should
compile these bindings at type compile time, as long as we make sure that the
compiled code doesn't try to do any compile time determined property lookups
and type resolution. This is implemented using a separate compilation pass
that ensures the disableAcceleratedLookups flag is set.
A few minor cleanups come with this patch:
* Ensure that the property caches array is always symmetric to the list of
compiled QML objects, as that allows the use of at() instead of value().
* The code for creating a QML callable function object for a given run-time
function is now centralized in a static function QmlBindingWrapper, used
for script strings and bindings from custom parsers.
The provided unit test verifies the successful execution of the same script
string with two different scope objects.
Change-Id: Ica2cea46dd9e47263b4d494d922d3cc9664b08ae
Reviewed-by: Michael Brasser <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Fix MinGW-warnings:
src/qml/jsruntime/qv4runtime_p.h:496:13: warning:
'static QV4::Bool QV4::Runtime::compareEqual(QV4::ValueRef, QV4::ValueRef)' redeclared without dllimport attribute after being referenced with dll linkage
Change-Id: Ieb212ed6aba2a0deeeddd033126ae7e9737bb38e
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
With this modification the CHUNKSIZE is setable by QV4_MM_MAX_CHUNK_SIZE
environment variable so the memory usage which is important for embedded
devices can be finetuned.
Change-Id: I3cd75158f2255651edd341873de035c1222e3c92
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
| |
creatScriptFunction -> createScriptFunction
Change-Id: Icdb9214b1ae067fa2b8693d50cdac0be9fe6d390
Reviewed-by: Michael Brasser <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When re-allocating the sparse array data, make sure to initialize the free list
correctly. Previously this was only done for the first allocation.
Test cases uses an object literal, as that's a reliable way to ensure
a sparse array is created.
Task-number: QTBUG-37892
Change-Id: Ib38cfce50104904af0c980f022c9dbb7461ae5f8
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This:
qint64 result = a + b;
is not equal to:
qint64 result = static_cast<qint64>(a) + b;
So checking if the former will overflow, and then doing the "double
case", will get thrown out by an optimizing compiler.
While we're in the area, optimize the X86 case a bit too.
Change-Id: Idfb69b16dbaaa0ae9f013a430ff060ca789526ba
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Small regression from commit 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510.
Processing the deletables might result in the onDestruction emission, which in
turn may end up in GC allocation and thus GC runs. That in turn may result
in m_deletables processing, which at this point is nested then. For that to
work we need to set m_deletables back to zero _before_ beginning with the
iteration.
Fixes tst_qqmlecmascript with aggressive gc.
Change-Id: Ibb310b30cd496644557f4c1bb23318b18ee8f36c
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Always call ~QObjectWrapper() to the wrapper object in
QObjectWrapper::destroy(), otherwise the m_object member of QObjectWrapper
may still hold a QtSharedPointer::ExternalRefCountData object which will
never been deleted.
I don't know why this will not cause leak in the past, but it seems that
the leak was introduced in 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510
Change-Id: I24b49bb11f95b7e3060c7adba1ab80b615da2942
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Cap the max chunk size at 2MB. This value still still doesn't
affect the v8 benchmark noticably, but should avoid extreme
memory usage in some corner cases
Task-number: QTBUG-37134
Change-Id: If2050374c4a7df7ff74194d64880e2d660ea26fd
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
This option doesn't make sense anymore, as we memset the object to
0 on destruction anyway.
Change-Id: Ie40563394f9cacda1b35fde114c9a6043f53d460
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
The method is only required for the QObjectWrapper, but
there we can instead simply register the deletable in the
destroy method.
Change-Id: I944319d327859cce33ac31a174e8d56fc4babfc1
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Optimize the code in case the setProperty call tries to
set something in the activation. Avoid resolving the property
index twice.
Change-Id: I60a4535adc014f7118bc3ab6773e10ed688ca0d6
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
There's no need to use scopes here, as instanceof can't
trigger any calls into the memorymanager. This slightly
speeds up the code.
Change-Id: Ie7f5c8f3982df1e24d21cfc4e0841d479a75c664
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Optimize construction of the internalClass for the object
being constructed.
Change-Id: Id5fc02c291664ec01c3595ae0acbb6895cc5b147
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per POSIX, localtime_r isn't required to call tzset(). This means that
we don't notice that the timezone has changed when calling
Date.timeZoneUpdated() from JS.
Call this in getLocalTZA() so that it always returns results pertaining
to the selected timezone.
Task-number: QTBUG-37683
Change-Id: Ia9098ef0100b7c909a82b125a5ea4f39fba1f306
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
They are neither used not accessible from QML.
Change-Id: I14fa6059b8e64cb2c3b9d025061548009a473f96
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Use QV4_MM_STATS to get some statistics about each GC run
written to stderr.
Change-Id: Idc30c06e1c3ca8353a2f16615cb26df13a8f23ed
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: Ia7df68e78ac105fe5519cb4f80a64561310d3324
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
This was meant as a debugging help after we took the exact
GC into use. Turns out it doesn't help debug any issues,
aggressive garbage collection is much more helpful in
finding GC issues.
Change-Id: Idfff26d3a4a15e570615009c1e57921bca6297ca
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
The old code rejected these escape sequences because of a
slight misreading of the spec.
Task-number: QTBUG-36968
Change-Id: I56a0e76295d1903b4798719de028bd21ad5be719
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Don't cast from ushort to uchar and back, and remove a
condition that's always true. Allocate some more
memory for matching.
Change-Id: I8167b6e4b4989365ca0ea8e17f4bdb15c0d8e27d
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
When resolving overloaded slots in a situation without property cache, then we
need to detect that we've reached the end of the overload lists and exit from
RelatedMethod with zero.
Task-number: QTBUG-37157
Change-Id: Ifaab8cc1b377725c99c1bb89bb9bb74d5a0af1b8
Reviewed-by: Michael Brasser <[email protected]>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-37303
Change-Id: I083ca0cc3223fe0dbf1c768ad43a0d4927579867
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
What remains is the code for removing .pragma from script source code (and
replacing it with white-space to preserve line/column numbers). The previous
code even returned the value of the pragmas, but for the remaining caller sites
that value isn't used, so we can just return void.
Change-Id: I16db15da236970660b817d6c4493005365a7a1af
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Move the .pragma and .import script extraction out of qqmlscript and
into qqmlirbuilder, where it can populate a QQmlIR::Document. Changed
the script part of the type loader to use that, which also allowed
eliminating the m_source member and m_metaData.
Change-Id: Icc64d219fff5666679a02e6afda73f7edfca132b
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
| |
Change-Id: I6185b59a7dfd6977ce82581ab4385e07d78f13f6
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
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 <[email protected]>
|
|
|
|
|
| |
Change-Id: I7f8a0ac8a368af23534378e8c31d820b3b9f1f4c
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Also add markObjects() calls to all the identifiers we keep
around in the engine. It's probably pure luck this hasn't caused
any issues until now.
Change-Id: Ie31d19793efa53867e4e240ba548070dcde32ec1
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some methods are being called with two different types of objects,
alternating between them. This adds a specialized lookup for that
case. Speeds up the splay test by ~20%.
Also create a clean path to a fallback lookup instead of going back
to the generic lookup and then alternating.
Change-Id: I3082d70d27155ef5f2cf2b680d227c6dd389956d
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
| |
Change-Id: I51af67e9ba4076216142e05b5de5b2e8f8c526bc
Reviewed-by: Michael Brasser <[email protected]>
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Make sure to create the array data. The earlier called copyArrayData()
doesn't have to do that.
Task-number: QTBUG-37506
Change-Id: I6671769fcd471234c4c2eaa1614aa61266db0e5c
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
| |
Don't ref CompiledData::CompilationUnit in constructor of ScriptFunction
since its has been referenced in its base class
Change-Id: I9ad2d6e190c2ac11de4ccd63015c81d2dead3971
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
A smaller maximum block size helps limit RAM usage on constrained
systems, at the cost of more frequent garbage collection.
Change-Id: Iba07d9cc628e3178dfaad35664c631844540bc9d
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
In the test case in the bug, the signal was emitted from the QApplication
destructor (somewhere from the qpa plugin when the platform windows were
destroyed)
Task-number: QTBUG-37351
Change-Id: Ieec59e12be10bab1428743b80eecdf22ef9d8bf6
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This reduces the size of QQmlBinding by 12 bytes.
Task-number: QTBUG-37134
Change-Id: Id55257edec8cee88d863374e8a96d7eebbeaf523
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Michael Brasser <[email protected]>
|
|
|
|
|
|
|
| |
Add some missing exports
Change-Id: I0c250231e902b6efeda257951ee5653ea363e288
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
| |
We don't know in which order the QML engines and the debug service are
deleted on shutdown.
Change-Id: I9d23b3c88eee125a93c5b0f8ea85466013233737
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Move all our runtime methods into the QV4::Runtime
struct and give them nicer names without underscores.
Sort them logically and remove a few unused methods.
Change-Id: Ib69b71764ff194d0ba211aac581f9a99734d8180
Reviewed-by: Simon Hausmann <[email protected]>
|