aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | 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>
* QML: Fix typeof context property.Erik Verbruggen2015-10-271-0/+8
| | | | | | | | This was missing from f21e8c641af6b2d10f0d7e7e0fc6a755dab3673c. Task-number: QTBUG-48524 Change-Id: I5cc6a979d965a1ef6b7fbc916a7ca9df868b459a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Rename currentExecutionContext to currentContextLars Knoll2015-09-151-4/+4
| | | | | | | | Now that the other method is gone, let's use the shorter currentContext Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup usage of ExecutionEngine::currentContextLars Knoll2015-09-151-7/+7
| | | | | Change-Id: Ic79d6da162375928ec25871cd0341daeab6483d2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * QtQml: Fix const correctness in old style castsThiago Macieira2015-07-091-4/+4
| | | | | | | | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c958364a2e9859 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Access the id objects through a specialized runtime methodLars Knoll2015-08-121-4/+4
| | | | | | | | | | | | | | | | This brings us one step closer to getting rid of the QQmlContextWrapper. Change-Id: Ied57f4c174c2ebd95096310a4ad4c0c28787e7a4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Access context properties through the qml contextLars Knoll2015-08-101-4/+19
| | | | | | | | | | | | | | And get rid of another temp in the IR. Change-Id: I039393e020e5141f1986aee276246c30fd8057f3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use the QmlContext to access properties of the scope objectLars Knoll2015-08-101-4/+19
| | | | | | | | | | | | | | | | | | Add some runtime methods to access properties of the scope object directly (using the QmlContext), and generate proper code to call those. Change-Id: I0b29357c9a3b9ad53ba568ec6cb763e8ecb10f21 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add ability to retrieve and use the QmlContext from our generated codeLars Knoll2015-08-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Don't MOTH_END_INSTR(Debug) after beginning a LineUlf Hermann2015-05-221-1/+1
| | | | | | | | | | | | | | | | This probably works because Debug and Line have the same internal structure, but obviously it's fragile. Change-Id: Ia27a769fa560726cec1ab73dee96f7c1e6812db0 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-1/+2
|/ | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Initial shot at native Qml-and-C++ debugginghjk2015-02-041-0/+234
| | | | | | | | | | | | | | This supports a Qt Creator debugging mode that allows to extract combined C++/JS stacktraces and JS variable values by examinining only the stack of the "native" debugger backend. Currently, only simple breakpoints and stepping with GDB is supported, and the setup requires a debug build of Qt(Declarative). Change-Id: I9d73041ee541fa45ed4a977f4deef8ebb0493ff9 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* CleanupsLars Knoll2015-01-231-1/+1
| | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-38/+38
| | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Managed inherit ValueLars Knoll2014-12-201-3/+3
| | | | | | | | This completes the first milestone towards being able to move objects across the GC heap. Change-Id: I8e6ce90254ea767188a31f0dc85b133534c87eb0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup code that modifies the JS stackLars Knoll2014-12-191-9/+4
| | | | | Change-Id: Ic043e256c3df984bb06c9a16b86573b0173b19a1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Replace usage of stdout for debug output by qDebugErik Verbruggen2014-12-191-50/+10
| | | | | | | | This way even paranoid Androids can be show interesting stuff. Task-number: QTBUG-43109 Change-Id: Ib0ef9e8f6c6fc66e9ea9bfcaf2cd9e33d7469070 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Return a Heap::Object in Object::prototype()Lars Knoll2014-12-171-1/+2
| | | | | Change-Id: Ice0265ae558ba14497421a5bbf25ee9db76adab5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix run-time string handling with regards to the new heapSimon Hausmann2014-11-211-20/+18
| | | | | | | | | | | | | | | | | Changed runtimeStrings to be an array of Heap::String pointers instead of indirect String pointers. Later that member along with other GC related members will go into a managed subclass. Meanwhile the generated code no more loads String pointers directly but just passes the index into the run-time strings to the run-time functions, which in turn will load the heap string into a scoped string. Also replaced the template<T> Value::operator=(T *m) with a non-template overload that takes a Managed *, in order to help the compiler choose the non-template operator=(Heap::Base *) overload. This allows removing a bunch of Value::fromHeapObject calls. Change-Id: I20415c0549d33cca6813441a2495976b66d4c00e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change signature or runtime methods to take an engine pointerLars Knoll2014-11-121-53/+56
| | | | | | | | | This makes a lot more sense in the long term and is the more maintainable solution, once the GC starts moving objects around in memory Change-Id: I8f327c0f5b5b0af38c5fe1a217852ee8c4a5c2fc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ExecutionContext::parent/outer to use a heap objectLars Knoll2014-11-121-8/+8
| | | | | Change-Id: I1b8ee831cfcdd5b1904ce24a341f5a796dce41cf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor ExecutionContextsLars Knoll2014-11-081-1/+1
| | | | | | | Move the Data class out into the Heap namespace. Change-Id: I2b798deb53812a08155c92a0e6ef2dcd2ea137b8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Changed Value to store Managed::Data pointers directlySimon Hausmann2014-11-041-2/+2
| | | | | | | | This is a step towards storing direct heap object pointers for the values on the JS stack, to avoid the costly indirection for data access. Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Accelerate property lookups for C++-based QObject singletons.Michael Brasser2014-08-071-0/+4
| | | | | Change-Id: Icbdf06a077014db5dd57cba42f84591433ec4196 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert Execution contexts to new constructor syntaxLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I4bc6a61b7a96139353e20871ff7ff007822c64c3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ExecutionContext to new storage schemeLars Knoll2014-07-221-24/+24
| | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup our runtime methodsLars Knoll2014-03-111-57/+57
| | | | | | | | | 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 <simon.hausmann@digia.com>
* Add a Line instruction to the interpreterLars Knoll2014-03-071-2/+7
| | | | | | | | | | This unifies the way we handle line numbers in the JIT and Interpreter. Remove the now unused lineNumberMapping code and data. Change-Id: I1d60b1fbb77e70b531fa73d93410683e84dd1e3c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Simplify our breakpoint handlingLars Knoll2014-03-071-2/+2
| | | | | | | | | | | | | | | | | Only store a Hash of break points in the debugger, instead of the involved logic that currently adds and removes break points. Add the current line number to the Debug statements in the interpreter, and pass them on to the debugger for checking whether we should really break. This adds a slight additional overhead to running inside the debugger, but greatly simplifies the logic and doesn't require modifying the bytecode anymore. This in turn opens up the possibility to run the debugger on JIT generated code later on. Change-Id: If2a3ae8f8d08b69a3a704cbbe0a84000f917a32e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Determine whether or not an object literal requires a sparse array at ↵Simon Hausmann2014-02-241-1/+1
| | | | | | | compile time Change-Id: Ieb7f6ee97a4f251f1e2369850ebb9e2931f84ac1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Clean up object literal handling with integral indicesSimon Hausmann2014-02-241-9/+1
| | | | | | | | | | | | | | | | | | | | | * Object literals with array indices are now created with one run-time call, instead of an initial one for non-integral keys followed by sub-sequent define_builtin_property calls. * Cleaned up propert name retrieval. Instead of using a visitor, it's easier to define a virtual method on the PropertyName type. The visitor doesn't buy us much as it's not possible to recurse within property names, and this way we can use it also from the function scanner to correctly determine the number of arguments needed for object literal initalizations. * Similarly the duplicated/common name member for all property assignments has been moved into PropertyName, for convenient access without AST casts. * Removed now unused builtin_define_property/settergetter functions from IR, run-time and moth. Change-Id: I90d54c81ea5f3f500f4f4a9c14f7caf5135e7f9f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Clean up our internal namespacesLars Knoll2014-02-231-2/+2
| | | | | | | | QQmlJS::MASM -> QV4::JIT QQmlJS::V4IR -> QV4::IR Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove add/sub/mul instruction specializations for numbersLars Knoll2014-02-071-18/+0
| | | | | | | | | | These instructions did hurt more than help, as they converted ints to doubles. Since the regular add/sub/mul runtime methods have fast paths for both ints and doubles, we're better off using those instead. Change-Id: I0b7a6f95818943bfc8a0669c1c56f7db4e7246e0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Specialize CJump into JumpEq and JumpNeLars Knoll2014-02-071-5/+10
| | | | | | | | This avoids the bool invert in the instruction stream, and some additional code in the VME. Change-Id: I0ea675a2e3d07c1b8c5234b888d8d9683bcee330 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove a memset that is not requiredLars Knoll2014-02-071-0/+2
| | | | | | | Keep it in debug builds to ease debugging. Change-Id: I334872d3c0ef30b5f09fb5febfc2129a3b450bca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add specialized instructions for right and left shiftLars Knoll2014-02-071-0/+16
| | | | | | | | These give a measurable speedup as the critical code paths are now inline. Change-Id: I3cee8a432fbe96d66ba1e6bd277a38e624a50c14 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove two unused parameters from VME::run()Lars Knoll2014-02-071-3/+5
| | | | | | | | These parameters are not used outside the function itself anymore, so we can safely remove them. Change-Id: I1694481c05a9927fc78a59ffb7fec43a88e85ac8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a MoveConst instruction to the interpreterLars Knoll2014-02-071-0/+4
| | | | | | | This simplifies and speeds up loading of constants Change-Id: I05b4f7a34abd4ed6416fa800a31debbb28b37104 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Smaller performance fixesLars Knoll2014-02-051-3/+4
| | | | | | | | | | Move commonly used variables in the ExecutionEngine to the beginning of the struct to increase cache locality. Keep the engine pointer in a register in the interpreter to save one memory load per instruction. Change-Id: If2540c66b62685701511f410aff495c0a20ca694 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a special Debug instruction to the interpreter and use itLars Knoll2014-02-051-2/+5
| | | | | | | | | | | | | | | This avoid having to check for the debugger at every instruction we execute. Instead we only add debug instructions at the beginning of every line and every basic block when we have a debugger. This still allows interrupting the JS execution at any time (as we can't loop inside a basic block), and single stepping through lines. But it has no overhead when the debugger is not running and a lot less when it is running. Change-Id: Ib17170b42944b608fc6caa1891082205dd2b2763 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Use lookups for get/setElement in the interpreterLars Knoll2014-01-311-0/+11
| | | | | | | Significantly speeds up crypto.js Change-Id: Icd3d59bea3fe4427e93e9e10e3526178e8de859c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused macroLars Knoll2014-01-311-9/+0
| | | | | Change-Id: Ie7044aecad59197fd2cab17d5ddcc7c44ad2ad84 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* CleanupsLars Knoll2014-01-311-18/+18
| | | | | | | | | | Remove SafeValue, it was used to port over to an exact GC. Since we now have that, we can now safely merge it with QV4::Value again. Also rename SafeString to StringValue for better naming consistency. Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename some filesLars Knoll2014-01-311-1/+1
| | | | | | | | | | | | Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to qv4value_inl_p.h. It makes more sense to have the class definition in the file that is named after the class and move the inline methods into a _inl file. Doing this now, as I expect we'll be needing a few more _inl files soon. Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add support for accelerated property access to QML types and namespace supportSimon Hausmann2013-11-281-0/+4
| | | | | | | | | | | * Resolve lookups in namespaces at compile time and instruct the SSA optimizer to eliminate reads from the namespace (QQmlTypeWrapper) if possible. For example access to attached properties of types (i.e. MyNameSpace.ListView.isCurrentItem) requires neither reading the namespace nor the type. * Add support for accelerated lookup of attached properties Change-Id: Ib0b66404ed7e70e1d4a46a1ac8218743a4cc8608 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Initial support for accelerated property access to QML singletons and enumsSimon Hausmann2013-11-251-0/+4
| | | | | | | | | With this patch we determine the meta-object of singletons, propagate it into the IR and load them separately using a dedicated run-time function. In addition enums in singletons and QML types are resolved at compile time. Change-Id: I01ce1288391b476d1c9af669cb2987a44c885703 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* IR Cleanup, resolve ID objects through array subscriptsSimon Hausmann2013-11-251-3/+3
| | | | | | | | | | | | ...instead of a special MEMBER type. This allows removing the type member from V4IR::Member altogether (and thus unshadow from V4IR::Expr::type). By not requiring the base of a id lookup member expression to be a NAME, we can also speed up repeated id lookups by fetching the id object array wrapper only once per function. Change-Id: I3e9b8f498d32ace4a0cc2254f49e02ecc124f79c Reviewed-by: Lars Knoll <lars.knoll@digia.com>