aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Drain the markStack while collecting rootsLars Knoll2017-09-081-1/+4
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids overflows in the markStack for test cases where we have a huge amount of compilation units with many runtime strings that all want to get marked. Task-number: QTBUG-63063 Change-Id: I7c1df0fdb9afada1830f8c218a0e52ebcd093850 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-08-181-3/+3
|\| | | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/qml/qqmlcustomparser.cpp src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypenamecache.cpp src/qml/qml/qqmltypenamecache_p.h src/qml/qml/qqmltypewrapper.cpp src/qml/qml/qqmltypewrapper_p.h src/qml/qml/qqmlvmemetaobject.cpp src/qml/util/qqmladaptormodel.cpp Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
| * Use QQmlType by valueLars Knoll2017-08-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | QQmlType is now refcounted, and we need to use it by value, to control it's lifetime properly. This is required, so we can clean up the QQmlMetaTypeData cache on engine destruction and with trimComponentCache() Task-number: QTBUG-61536 Change-Id: If86391c86ea20a646ded7c9925d8f743f628fb91 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-52/+84
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4argumentsobject.cpp src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4errorobject.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4managed.cpp src/qml/jsruntime/qv4managed_p.h src/qml/jsruntime/qv4object.cpp src/qml/jsruntime/qv4object_p.h src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4heap_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/memory/qv4mmdefs_p.h src/quick/scenegraph/util/qsgdistancefieldutil.cpp src/quick/scenegraph/util/qsgdistancefieldutil_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
| * Move the engine() accessor from Object to ManagedLars Knoll2017-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We can easily do this now that Managed has a pointer to an internal class (which always has a back pointer to the ExecutionEngine). Remove the extra engine pointer from ExecutionContext, and clean up tow methods in String. Change-Id: I98d750b1afbdeadf42e66ae0c92c48db1a7adc31 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Get rid of the old way of defining builtin functionsLars Knoll2017-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | The old calling convention used for builtin functions is very inefficient. It was still being used in a few places. Clean those up and convert them to the new and much more effiecient calling convention. Change-Id: I6b769c6185df7e9be1e80709330fc1ca868576c1 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Move the prototype into the internal classLars Knoll2017-05-191-45/+61
| | | | | | | | | | | | | | | | | | | | 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>
| * Move the internalClass field from Heap::Object to Heap::BaseLars Knoll2017-05-191-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | And do not store the vtable in Heap::Base anymore. This change makes the internal class the main distinguishing feature of all garbage collected objects. It also saves one pointer on all Objects. No measurable impact on runtime performance. Change-Id: I040a28b7581b993f1886b5219e279173dfa567e8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add ICs for String, MemberData and ArrayDataLars Knoll2017-05-191-0/+4
| | | | | | | | | | Change-Id: I43ddcb4842e501cbea8a950ab6ffa2d906014efd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Move the list of default internal classes into EngineBaseLars Knoll2017-05-191-44/+46
| | | | | | | | | | | | | | | | And store them in an enumerated array. This will simplify upcoming changes. Change-Id: I82eac03b9f6264843ae625e36e150464fe08be9d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Move a few more members from ExecutionEngine to EngineBaseLars Knoll2017-05-191-3/+1
| | | | | | | | | | Change-Id: I5d1e0d2251e04cc871f9c298849aafac17f23fbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QmlContextWrapper -> QQmlContextWrapperRobin Burchell2017-05-041-1/+1
| | | | | | | | | | | | | | That poor Q looked so lonely. Change-Id: I29a0aa0574fefa5be8ffaa9857e03500c914c830 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QmlTypeWrapper: -> QQmlTypeWrapperRobin Burchell2017-05-041-1/+1
| | | | | | | | | | | | | | That poor Q looked so lonely. Change-Id: Ie4cef3fa8f2ecb8ba106654e8a9d6611a9407aa2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-04-221-1/+1
|\| | | | | | | Change-Id: I95266fdaf5c6dc65969bd2e28403da7969367d32
| * Fix build without features.qml-interpreterTasuku Suzuki2017-04-211-1/+1
| | | | | | | | | | Change-Id: I5f9c00541c27377e8310d32bf045c2860eeffcb4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-04-071-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4vme_moth.cpp Change-Id: I865d794e550a263387a39ca8d051ebf48b70cbc0
| * Fix value type encoding constant usage when cross-compilingSimon Hausmann2017-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our two value encodings use different masks for the upper 4 bytes. Depending on the target architecture we must use different values when generating code that uses these masks. This patch replaces the #ifdef'ed ValueTypeInternal_* enum values with two C++11 scoped enums that allows for the co-existence of both throughout the code base as well as selective use in the code generators. Change-Id: I380c8c28b84df2874cca521b78bfe7f9388ed228 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Separate the stack used for GC from the regular JS stackLars Knoll2017-04-071-10/+17
| | | | | | | | | | | | | | | | This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | CleanupsLars Knoll2017-04-071-17/+13
| | | | | | | | | | | | | | | | | | | | | | * Only call ExecutionEngine::markObjects() on a full GC, it doesn't do anything in the incrementall case anyway. * Move the marking of child objects into it's own method for clarity * Move collection of gray items down to happen directly before we drain the mark stack Change-Id: I41067e17d483067bd1c4d60da22c5628482dae78 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove assertObjectBelongsToEngine methodLars Knoll2017-04-071-6/+0
| | | | | | | | | | | | | | | | | | | | It's only used during mark() calls, where we can be reasonably safe that the assertion holds. But mark() needs to change and become independent of the execution engine for concurrent collection, so remove the assert as a preparation. Change-Id: I52266af719afd76048d73efdcfcf96c0abc8843f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into HEADSimon Hausmann2017-03-231-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4mmdefs_p.h Change-Id: I9966750b7cd9106b78e4c4779f12b95a481cca40
| * Complete transition to standard layout classes for JIT accessSimon Hausmann2017-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix running of 32-bit JIT code generated on 64-bit hostsSimon Hausmann2017-03-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Incremental garbage collectionLars Knoll2017-03-091-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | Add an incremental mode to the garbage collector, that will get used for many collections. This should significantly reduce average stop times for GC. Make sure that manual calls to gc() still do a full collection, to ensure consistency and keep tests that rely on gc() working. Change-Id: I87b13529377b7639ce993dbd99e85ff0a555acd8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Implement a real write barrierLars Knoll2017-03-091-3/+3
| | | | | | | | | | | | | | | | | | | | Implement a Steel write barrier for our objects. The barrier is interesting as it can also be used for incremental GC runs by simply turning the barrier on and leaving old objects marked as black. Change-Id: I0b273974d94a990dee3cd9298089b8b202c75bf2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Make writes to ArrayData write-barrier safeLars Knoll2017-03-091-1/+3
| | | | | | | | | | Change-Id: I2e46100fe72fd83b36b3195130eefce5289d1627 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Make all write operations to Pointer<> types go through a set() methodLars Knoll2017-03-091-2/+2
| | | | | | | | | | | | | | | | The new set() method also taked an ExecutionEngine pointer. This makes it trivial to now add a write barrier for those operations. Change-Id: I321eccfe6fb279cc240b5c84910e6854f71759f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Separate SimpleCallData and CallDataLars Knoll2017-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | SimpleCallData doesn't need any loca variables, so move it into a separate CallData Heap object. This also allows getting rid of the manual markObjects() implementation for CallContext. Change-Id: I9014eb2f815d3e2fe63a951a9d126c38e8aaa0a3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Unify mark handling for MemberData and ArrayDataLars Knoll2017-03-091-3/+3
| | | | | | | | | | | | | | | | Introduce a ValueArray class, that defines an array of Values at the end of a Heap Object. Change-Id: I00efbf6f5839a6687dd5bc5fc037ec8f06e0936e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-281-0/+2
|\| | | | | | | Change-Id: I92b13a9c1727644d63e125c1e6f1fdac72720ad7
| * Add a javascript push method binding to QQmlListPropertyIonut Alexandrescu2017-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | NumberObject: Copy parseInt and parseFloat from the global objectRobin Burchell2017-02-031-3/+22
|/ | | | | | | | | | | | | | | | | | | | | | | Per the spec, these use the same FunctionObject as the global object. Implements: 20.1.2.12 20.1.2.13 For es6 test/built-ins/Number, we go from: === Summary === - Ran 490 tests - Passed 412 tests (84.1%) - Failed 78 tests (15.9%) to: === Summary === - Ran 490 tests - Passed 416 tests (84.9%) - Failed 74 tests (15.1%) Change-Id: I7e6f84ef81a429a4bce4895663ad6dc10f389f86 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make the JIT ISelFactory a templateSimon Hausmann2017-01-311-1/+1
| | | | | | | | That way qmldevtools can - in the future - instantiate that also for the cross-compilation targets. Change-Id: If15b195f24e54226dc4f2fd9f0ad6874f44cb5af Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add fixes for INTEGRITYKimmo Ollila2017-01-311-3/+5
| | | | | | | Full definitions of types are needed in static_casts. Change-Id: I028ffc40a76cdb16cb297a181b3d9dfe9d09c945 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-141-2/+0
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
| * Get rid of the GCBlockerLars Knoll2016-12-281-2/+0
| | | | | | | | | | | | | | | | | | It's a hack we needed when we still had a conservative GC, but it is not required anymore. The only thing we still need is the protection against running the GC recursively. Change-Id: I55cd51d4929c828db5b61b38e781467c5bf77314 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-24/+39
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Get rid of SimpleScriptFunctionLars Knoll2016-12-111-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
| * Refactor the calling code for (Simple)ScriptFunctionLars Knoll2016-12-091-3/+2
| | | | | | | | | | | | | | | | | | | | | | Factor the common code out into separate methods that can later on be reused by the QQmlJavaScriptExpression. Also ensure a CallContext is safe to use with a 0 FunctionObject. Change-Id: I1181a8e320b8c931d9df5b2c91bc143d8587fb60 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Change ExecutionContext::getFunctionObject() to getFunction()Lars Knoll2016-12-061-9/+5
| | | | | | | | | | | | | | | | | | And return a QV4::Function from now on. This simplifies code in other places and provides all the info required for stack traces and debugging. Change-Id: I512a8ac3932268d8cfc60675e75c4661d1f16fd8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Start cleaning up the QmlContextWrapperLars Knoll2016-12-041-2/+22
| | | | | | | | | | | | | | | | | | 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>
| * Cleanup Value::isObject/objectValue usagesLars Knoll2016-11-291-2/+2
| | | | | | | | | | | | | | | | Try to avoid calling both as objectValue() already checks isObject(). Change-Id: I1d770d4d9dabed4ea4cc3e322b8fdc5a64f5bd2b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Clean up Value::isString()/stringValue() combinationsLars Knoll2016-11-291-4/+4
| | | | | | | | | | | | | | | | It's enough to just call stringValue(), as that already does the isString() check. Change-Id: I7be0e643a7975c0704b4c9c43b337deb8db9fce0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-7/+13
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * Make the Moth interpreter configurableLars Knoll2016-10-101-0/+6
| | | | | | | | | | | | Change-Id: I2b784820c4e39a7932f81bfee9ce78e01a2e96b5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QML: Introduce destroy() on Base subclassesErik Verbruggen2016-10-051-3/+3
| | | | | | | | | | | | | | | | This removes the destructors of subclasses of Base, making them nearly trivial. Change-Id: Ia6f7d467e87899b5ad37b8709a8f633a51689d59 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QML: Move the ScarceResourceData from VariantObject onto the heapErik Verbruggen2016-10-051-4/+4
| | | | | | | | | | | | | | So now VariantObject is nearly a trivial struct. Change-Id: Ifc54c04d9686c03e12066c5287823dd3b1315d2a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-011-3/+4
|\| | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4qobjectwrapper.cpp Change-Id: I1a125b2334532ec5de4af39c0d6628890f4d0587
| * QML: Make all context objects trivialErik Verbruggen2016-09-301-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change also adds a check to the d() calls for Managed, verifies that the object has been initialized. This is only done for debug builds. To prevent other code from tripping the check, a number of other classes are either marked as trivial, or do initialization in the constructors. Because of template function changes in them memory manager (those now call init() instead of in-place new), String has an extra parameter to force it to temporarily use an old/unmodified template function. Change-Id: I8c35161ce7680835d830638b6d21498c5129b02b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Qml jsruntime: replace 'foreach' with 'range for'Anton Kudryavtsev2016-09-161-1/+1
| | | | | | | | | | Change-Id: Ieb99b73037bc5b07caf62121d51a17c3025df97c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>