aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Get rid of the compilation unit related members in ExecutionContextLars Knoll2017-08-031-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And change the signature for VME::exec to take the QV4::Function that should be executed. This is in preparation to being able to run functions that will not need to allocate an execution context on their own. Change-Id: I34538a8723006f4ec24583805e88a66e750100c3 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Fix unary minus: -UINT_MIN is not an integerErik Verbruggen2017-08-021-1/+2
| | | | | | | | | | | | | | | Change-Id: I460273c19784aeb36e2e17e1bfb3c0b3e4f7f09b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Introduce an accumulator in the interpreter, and change instructionsErik Verbruggen2017-08-021-42/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the number of stores to the stack (for which we need a write-barrier in the future) by keeping the last calculated value in the accumulator register (which is a local variable). In the future we might want to collapse certain common instruction patterns into a super-sized instruction. Change-Id: I02ebed2db957765e994c8f939bf7585894881deb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Simplify and unite handling of activation objects in ContextsLars Knoll2017-07-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All ExecutionContexts (except for CatchContext) have or can have some sort of activation object. Unify them in one pointer in the ExecutionContext class, and unify it's handling where it's actually the same. Change-Id: I6750999ddbd5d1d74235ef4b34dcd7546c432541 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Bring back captureRequired on scope/contest property loadingErik Verbruggen2017-07-041-72/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to properly register permanent/temporary dependencies This patch also removes related interpreter instructions that should have changed, but were not used. Change-Id: Ie53c4611766680734c02e328b7f2c752cae150e0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Remove interpreter instructions we can't generate anymoreErik Verbruggen2017-06-301-51/+8
| | | | | | | | | | | | | | | | | | | | | This includes the backing runtime methods. Change-Id: Ib8fb6091974794b11f732fadeb047a7347a50d66 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add support for post increment/decrementErik Verbruggen2017-06-211-2/+42
|/ / | | | | | | | | Change-Id: Ie3f03a548105fe49d29e3d60bf823435f21b0340 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-151-1/+3
|\| | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp Change-Id: I3c41b9fc9ba7d41741e4dd400402ae80dd7726d9
| * Fix integer divisionErik Verbruggen2017-06-081-1/+3
| | | | | | | | | | | | | | | | 0/-1 == -0.0 in JS, which cannot be encoded in an int. Change-Id: Ice5b09fa3d42dc24d543d4581d77c6bfa743b2ca Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-28/+82
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Get rid of the MemoryManager pointer inside StringLars Knoll2017-05-191-2/+2
| | | | | | | | | | | | | | We can always get the pointer through the internalClass. Change-Id: If68432845e7c67da70d9e19aef1a90ebe1e6056b Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Move the list of default internal classes into EngineBaseLars Knoll2017-05-191-1/+1
| | | | | | | | | | | | | | | | And store them in an enumerated array. This will simplify upcoming changes. Change-Id: I82eac03b9f6264843ae625e36e150464fe08be9d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Optimize Runtime::method_get/setElementLars Knoll2017-05-101-25/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | This is now actually just as fast as the lookup code, so disable the generation of lookups for indexed accesses for now. This saves some runtime memory, as we don't need the data structures for the lookup. We can reintroduce lookups, once they offer a real performance benefit. Change-Id: Idc3fa7b248e2e25b4b2cd60d5053e2815634c8b7 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-0/+2
|\| | | | | | | Change-Id: I95266fdaf5c6dc65969bd2e28403da7969367d32
| * Silence GCC 7 warnings about implicit fallthrough in Qt codeThiago Macieira2017-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-03-271-0/+2
|\| | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4functionobject_p.h Change-Id: I4bbed45f1fe02cf64df3c8a5f92f811e38e772f3
| * Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Simon Hausmann2017-03-251-0/+2
| |\
| | * Merge remote-tracking branch 'origin/5.8' into 5.9Simon Hausmann2017-03-151-0/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmltypecompiler_p.h src/qml/qml/qqmltypeloader.cpp src/qml/qml/qqmltypeloader_p.h Change-Id: I4894555ab7a0879b56bbda7a46d16d1c40c19e7c
| | | * JS: Fix 0 == -0Erik Verbruggen2017-03-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The double representation of 0 and -0 are different in the sign bit, so the raw values are not the same. However, neither is managed, so non-strict equality comparison erroneously returned false. Task-number: QTBUG-56808 Change-Id: If966ddbc9f1a1c006dc5901aecafca063f71e404 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | Merge remote-tracking branch 'origin/5.9' into HEADSimon Hausmann2017-03-231-3/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Protect CompilationUnit member usage against word size differencesSimon Hausmann2017-03-171-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Currently we only use the runtimeStrings offset in JIT generated code, so move that into a standard layout base class and use that instead. Task-number: QTBUG-58666 Change-Id: Id933ba5df3a6990e89886c2b328e9e814ec5e413 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Make writes to ArrayData write-barrier safeLars Knoll2017-03-091-1/+1
| | | | | | | | | | | | | | | Change-Id: I2e46100fe72fd83b36b3195130eefce5289d1627 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Go through proper set() functions when writing to MemberDataLars Knoll2017-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is required, so we only have to add the write barrier in one place. Change-Id: I4e8bde823b30ad18f043312ac3f1ed46597b91a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Unify mark handling for MemberData and ArrayDataLars Knoll2017-03-091-1/+1
|/ / | | | | | | | | | | | | | | 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>
* | Fix a potential crash in pushWithScopeLars Knoll2017-02-131-2/+6
| | | | | | | | | | | | | | | | | | | | | | toObject() can potentially allocate a new object. If a GC accurs between that allocation and newWithContext(), we'd free the withObject Fixes a crash on test262 ch12/12.10/12.10-2-1 when running it with aggressive GC. Change-Id: Id8e957a748658a8f31ae39ff83509e9574ed51f7 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | jsruntime: Add a vtable hook on Object for instanceofRobin Burchell2017-01-261-27/+7
| | | | | | | | | | | | | | | | | | | | This will hopefully allow us to customize the behavior of QmlTypeWrapper to allow comparison QMetaObject comparison against a QObjectWrapper lhs (i.e. foo instanceof Item will hopefully be possible) Task-number: QTBUG-24799 Change-Id: I780c8b424ec14d6ed6f93eeac46390e2fc920000 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add some asserts to help debuggingLars Knoll2017-01-221-0/+1
| | | | | | | | | | Change-Id: I49419e45ee2686e6e8646c49b839b4d77f2e05fd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-109/+108
|\| | | | | | | | | | | | | | | | | | | | | | | 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
| * Optimize code in instanceOf() of FunctionObject::protoForConstructor()Lars Knoll2016-12-131-10/+11
| | | | | | | | | | | | | | Saves around 1.5% instructions for the Earley Boyer benchmark Change-Id: I552d324d5e1713f655ab9909f30c9527bb4ff777 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Start cleaning up the QmlContextWrapperLars Knoll2016-12-041-1/+1
| | | | | | | | | | | | | | | | | | 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>
| * Hint the compiler that exceptions are exceptional and not the hot pathErik Verbruggen2016-12-011-3/+4
| | | | | | | | | | Change-Id: I981f0cb643a67027a37db38363e26b220d3c216f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Cleanup Value::isObject/objectValue usagesLars Knoll2016-11-291-38/+47
| | | | | | | | | | | | | | | | 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-36/+47
| | | | | | | | | | | | | | | | 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>
| * Clean up some duplicated methodsLars Knoll2016-11-291-23/+0
| | | | | | | | | | Change-Id: Iad64dd2c330ca85a28f8f5c776b0ede623203558 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-2/+2
|\| | | | | | | Change-Id: I905dcd29377bf1b2e0ee086823b54277d18e78dd
| * V4: check for exceptions after convertThisToObjectErik Verbruggen2016-11-241-2/+2
| | | | | | | | | | | | | | | | | | The method_convertThisToObject method was invalidly tagged as not needing exception checks. As a side-effect method_pushCatchScope and method_popScope are now correctly tagged with a NoThrowEngine. Change-Id: I11d987e62136216a29eadcbd641546311030058f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-6/+6
|\| | | | | | | | | | | | | | | | | | | 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
| * QML: Make Heap::RegExp and Heap::String trivialErik Verbruggen2016-10-051-3/+3
| | | | | | | | | | Change-Id: Ia8eda67c9d59069d3a64363699720a79ba1348a1 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>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-011-3/+3
|\| | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4qobjectwrapper.cpp Change-Id: I1a125b2334532ec5de4af39c0d6628890f4d0587
| * QML: Make all context objects trivialErik Verbruggen2016-09-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-211-8/+8
|\| | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4isel_moth_p.h Change-Id: I8e86a649d1ef8ad27dc66cc8c290093b2faabc69
| * Fix binding dependencies when used in together with functionsSimon Hausmann2016-08-301-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | When a function called from a binding would access a scope or context property, we would end up registering those dependencies as permanent dependencies in the expression and set m_permanentDependenciesRegistered to true. Then after the binding evaluation itself, we would not end up registering the real binding's permanent dependencies. Change-Id: I3b6c1c181aa064d535362c736b5b2bbc4f576ba9 Done-with: Erik Task-number: QTBUG-54394 Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-191-3/+3
|\ | | | | | | Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-181-3/+3
| |\ | | | | | | | | | Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
| | * Fix throwing an exception inside a finally block with a return in catchSimon Hausmann2016-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When exiting a catch block with a return statement, we'll unwind the exception handling manually and emit finally statements right before jumping to the exit block. If we throw an exception in the final block, we'll end up using the exception handler of the catch block that contains the return statement, which means we'll end up popping the exception scope one too many times, once through ScopeAndFinally::CatchScope in unwindException() and then when executing the exception handler block. The latter we should not be executing, instead we should jump straight to the exit block. Therefore any statements emitted as part of the manual exception unwinding (finally block here) need to be part of a new basic block with no exception handler. This bug became visible in debug builds where the Scope destructor compares the scope mark against the engine stack top to ensure correct cleanup order (which was wrong). However that in turn was hidden in debug builds again due to an accidental = instead of == in a Q_ASSERT. With the Q_ASSERT fixed this use-case is covered by ch12/12.14/S12.14_A13_T3 Change-Id: Id74a1b2bb3e063871b89cc05353b601dd60df08e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Fix qmldevtools for QML compilerSimon Hausmann2016-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Re-add some run-time functions in the qmldevtools and replace the use of the WTF assert that pulls in some wtf functions with a Q_ASSERT. Change-Id: Id7b4bdb02c54e8b498db3fab78870463fa4fac9a Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>