aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Fix QtSharedPointer::ExternalRefCountData object leaks"J-P Nurmi2015-12-232-11/+2
| | | | | | | | | | This reverts commit 839d2d3e2368bc8e107d22203b0611c852f54319, which has been causing crashes in qtquickcontrols2 auto tests and making it nearly impossible to integrate anything over the past few days. Change-Id: I570b286a067aae5e3c2d8c56ad601e1a6cb58c20 Task-number: QTBUG-50134 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix QtSharedPointer::ExternalRefCountData object leaksJian Liang2015-12-182-2/+11
| | | | | | | | | | | Call destroyObject() for every QV4::Heap::QObectWrapper object in heap in QV4::MemoryManager::sweep() to make sure the QPointer object contained in QV4::Heap::QObjectWrapper is properly destructed. We also keep track of QObjectWrapper in QV4::Heap::ModelObject to make sure we destory them in QV4::MemoryManager::sweep() Change-Id: I3b3e96cfc300c2e21ab691762879ac2970afa90c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QML: Sanitize reading environment variables.Friedemann Kleint2015-10-221-15/+34
| | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Change-Id: Ia8b7534e6f5165bd8a6b4e63ccc139c42dd03056 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-062-0/+22
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Improve algorithm to handle GC of StringsLars Knoll2015-09-251-6/+7
| | | | | | | | | | | | The old algorithm could lead to excessive garbage collection in cases where lots of strings are being created. The new algorithm is a bit more agressive in doubling the GC limit for string data. This doubles the performance of both the v8 regexp and splay benchmarks. Change-Id: I2b5cd27c14410b033038a409d5ae03c9636d4f71 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cosmetic improvements to marking of objects during GCLars Knoll2015-09-251-2/+2
| | | | | Change-Id: I79a7093c7086ea7f34252f097f18fe7c835053aa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Avoid a function call when allocation new objectsLars Knoll2015-09-222-48/+44
| | | | | Change-Id: I5f30d4fc3901fcd77aba4e7601586aa34cc0f5d2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Simplify new construction schemeLars Knoll2015-09-221-30/+77
| | | | | | | | Declare the default prototype and internal class in the class itself. Change-Id: I08c2b42aa61a886580061336ae60cef8dedc0f03 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* move error objects over to new construction schemeLars Knoll2015-09-221-0/+28
| | | | | Change-Id: I533c7bf90d49aee10b5661fd15a98e013b1169bd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Convert variant object and ObjectProtoLars Knoll2015-09-221-0/+13
| | | | | Change-Id: I5ee3b453b74f5832997aca68d04979302f9afac5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Inline property data into the objectLars Knoll2015-09-221-9/+52
| | | | | | | | | | | | Append the part of the objects property data that is known ad instantiation time to the object itself and by that avoid creating a separate MemberData. Saves some memory and should speed up object creation. Currently implemented only for Object and ArrayObject. Change-Id: I7693bf2f3a28fb718522398ebb94ac115e021fa4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QV4_MM_STATS was missing largeItem detailsFrank Meerkoetter2015-09-221-0/+5
| | | | | | | | | The output of QV4_MM_STATS was only reporting the items allocated on the JS HEAP. It was missing out on the LargeItems which are allocated on the C++ heap. Change-Id: Ife3d7afd769beb31afd1ed681d503f9811b03b96 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Rename currentExecutionContext to currentContextLars Knoll2015-09-151-1/+1
| | | | | | | | Now that the other method is gone, let's use the shorter currentContext Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Store the stack of executioncontext's on the JS stackLars Knoll2015-09-151-3/+3
| | | | | | | | | | | | | | | | 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>
* Cleanup the ExecutionContextSaverLars Knoll2015-09-151-1/+1
| | | | | | | | 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>
* Fix performance of ListModel::get()Simon Hausmann2015-08-191-4/+2
| | | | | | | | | | | | | | | | | | When called, the function would return a full-fledged QObject that maps the list element addressed. It would contain a _copy_ of all values in the list item and it would create a new meta-object for each list element. This function exists for the JavaScript API, and therefore we now return a much more lightweight object. For compatbility reasons it still has to be a QObject, but the meta-object of it is created on-demand, i.e. only when accessing properties from the C++ side or when connecting to the changed signal of a property. Otherwise the JavaScript wrapper will return the live values from the model without copying them. Change-Id: Iabf3ca22192d2aee06ae9d4b4cfb2fcde2a021b1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Spencer Schumann <spencer.schumann@echostar.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-182-10/+55
| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
* Do not sort the vector of chunksFrank Meerkoetter2015-08-111-1/+0
| | | | | | | | I don't see why the vector needs to be sorted by the base() addresses of the contained PageAllocations. Change-Id: I31946a50075c64d01c6de98964ea42ebfc936c68 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* destruct qobject wrappers before sweeping the GC heapLars Knoll2015-08-102-30/+15
| | | | | | | | | The wrappers emit a destroyed signal, and it's important that the GC heap is in a well defined state when these signals are emitted. Change-Id: I423c4241b1e2fd3de727277d26bbe64f08862193 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Encapsulate and protect all accesses to the vtable of Heap objectsLars Knoll2015-08-103-13/+14
| | | | | | | | This is required, so we can safely access the vtable even while we're marking objects during GC. Change-Id: I34f56b61b4bca0d0742faf607eb5ab8b2c30685e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-041-1/+1
| | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/quick/items/qquickitemsmodule.cpp src/quick/items/qquicktext.cpp src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
* Fix build with QT_STRICT_ITERATORSSérgio Martins2015-05-151-1/+1
| | | | | Change-Id: I3df6ac107cb46b3a1b15b80f39d7c6015adcd9ac Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use Heap::Pointer in more placesLars Knoll2015-04-241-4/+3
| | | | | Change-Id: I2a64aadcd47ed05ad7d08a70a5d765d898a671fd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Rename Heap::Base::as() to cast()Lars Knoll2015-04-211-1/+1
| | | | | | | | The as() methods in other places to dynamic type checking, whereas cast() methods are basically the same as a static_cast. Change-Id: Iacd0174824b41b8fad05d6b55b1e62e3b44a31db Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of asManaged()Lars Knoll2015-04-211-2/+2
| | | | | Change-Id: I853417fdf1cc339f7d43a006c20e1626b6bfb288 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup some of the casting codeLars Knoll2015-03-201-3/+20
| | | | | | | | Get rid of value_cast, and move the Managed::as() method into Value. Change-Id: I440ac44ae77f4fda1a8a837383fe631f432f6532 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Wrap members in Object in a Heap::PointerLars Knoll2015-03-201-0/+3
| | | | | Change-Id: I0d132592487255027c215da21fbec15b23b00624 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-171-2/+4
| | | | Change-Id: I6033aba359ac551f450ad517d20a0986bf4655f6
* Move memory management related functionality into it's own folderLars Knoll2015-03-024-0/+925
Start moving the memory related functionality into it's own folder. This will simplify refactoring of the GC related functionality later on. Change-Id: I70ec6f512af7a7897625afb84d914c17572b0ccd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>