aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compiler_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor le integer types from qjson_p.h to qendian_p.hAllan Sandfeld Jensen2017-07-061-2/+2
| | | | | Change-Id: Ibb24b0a55dd94e03fea3104e8af5ddb266004300 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve robustness of qml disk cachingSimon Hausmann2016-07-231-1/+2
| | | | | | | | Perform various basic checks before proceeding to load an existing cache file, including the qt version, architecture, data structure version and others. Change-Id: Ie822b056e944ac120643aad260e97f62616688bf Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Simplify CompiledData::Unit serializationSimon Hausmann2016-07-151-1/+4
| | | | | | | | | | | | | | | There are currently two places where we calculate the total size of a CompiledData::Unit including all of its data, once in its calculateSize() function and then when constructing the Unit itself. This is error prone when trying to do changes to the layout, as two places need to be adjusted. Instead we can centralize the populating of the entire CompiledData::Unit header, the calculation of the various offsets as well as the entire size in one shot in a new generateHeader function. Afterwards we can allocate the final amount of memory and copy the remaining bytes across and assemble the final data structure. Change-Id: Ic26d7812e59d2bee2f45cd72742e3195a56950df Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up JS internal class serializationSimon Hausmann2016-07-151-2/+2
| | | | | | | | We can serialize the compiled JS class data right when we collect it from the IR. That makes the assembly of the compilation a little simpler later on. Change-Id: I36d7dd2cc74241338fb1c236ce7778405066c8b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove unused fields in CompiledData::FunctionSimon Hausmann2016-07-141-2/+1
| | | | | | | | The table for referencing the inner functions is not needed. This also allows making the function offsets table a local variable. Change-Id: I3f1a1d6ab8c4f417edeafdc174e5b41d2d2b611b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up CompiledData::FunctionSimon Hausmann2016-06-071-1/+1
| | | | | | | | | * We don't need 64 bits for the flags, for now 8 bits are sufficient. * Removed the unused index member. It's symmetric to the index of the function object in the function table anyway. Change-Id: I18248e8ed79b3c3af87e17689dadf7323d5d9bb3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* 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>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* Cleanup: Simplify CompiledData::Unit structure to always include the string ↵Simon Hausmann2014-09-241-2/+7
| | | | | | | table at the end Change-Id: Iae86b8f4dc0dc67c14974472f627e28d6795369f Reviewed-by: Lars Knoll <lars.knoll@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>
* CleanupSimon Hausmann2014-08-151-2/+1
| | | | | | | | | Merge QV4::CompiledData::QmlUnit into QV4::CompiledData::Unit. For pure JS units it means a slight increase of memory usage by a few bytes, but overall it makes the code a lot simpler. Change-Id: Ib48927749720b056f004aac0fe22cb8ec729e3f6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Extend the QML bootstrap library by the IR buildersSimon Hausmann2014-04-231-2/+2
| | | | | | | | | | | | | 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 <lars.knoll@digia.com>
* V4 string table cleanupsSimon Hausmann2014-03-281-1/+2
| | | | | | | | | | Move the string table (index and data) to the end of the compilation unit. That makes it easier to extend the string table later with new strings - for example when transitioning from JS data to an entire QML unit - because all the other offsets within the JS data remain the same. Change-Id: Ib28caf943ee2ec74b7acc19c2980de0853bb8086 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Various cleanupsSimon Hausmann2014-03-281-8/+27
| | | | | | | | | | | | | * Encapsulate the string pooling for the V4 data generation into a StringGenerator class. * Move type reference collection into the IR::Document, where it belongs (as it writes into the typeReferences there) * const fixes * Remove unused methods and members * Store unit and qml unit sizes right in the generated data structure. That makes copying easier (like we do when generating the QML data based on the JS fields) Change-Id: I053146ab0b00cc90ac7f72f867415962d1be121b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a Line instruction to the interpreterLars Knoll2014-03-071-3/+0
| | | | | | | | | | 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>
* Clean up object literal handling with integral indicesSimon Hausmann2014-02-241-1/+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-8/+8
| | | | | | | | QQmlJS::MASM -> QV4::JIT QQmlJS::V4IR -> QV4::IR Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement Lookup::indexedSetterLars Knoll2014-01-311-0/+1
| | | | | | | | | use this instead of the generic runtime method. This gives around 10% speedup for array heavy Javascript such as crypto.js. Change-Id: Ic8f478c5b18893f2ef49e3f658b1ef24ae22e64f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use lookups for indexed accessesLars Knoll2014-01-201-0/+1
| | | | | | | This speeds up reading array data from objects significantly. Change-Id: I5d17a7b3e7583a16dc76d1ee6cbc1d7134e4c2fa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Clean up property dependency data structuresSimon Hausmann2013-12-051-7/+0
| | | | | | | | | | | | | | | | As a follow-up to the previous commit, this patch cleans up the data structures used to track dependencies of QML binding expressions and functions to context and scope properties, determined at compile time. Instead of "collecting" these depending properties upfront (codegen time), we propagate the information that a property is a context or scope property into the IR at codegen time and later in the isel collect these properties and their notify signal index in a hash in the IR functions. The CompileData structure generator then can read these hashes directly when writing out the dependency information. Change-Id: I32134706e2d24bf63d1b1abad0259ab072460173 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Initial support for resolving meta-property access for the scope and context ↵Simon Hausmann2013-10-311-1/+9
| | | | | | | | | | | | | | | | | objects at QML compile time This avoids having to do a string lookup for ids and in the import cache at run-time, before we can do a string hash lookup in the property cache. Instead we resolve final properties in the context and scope object at compile time and look them up at run-time using their index instead. The dependencies to these properties are also tracked separately and recorded in the compiled data. This is merely the initial patch. There's a lot left to do, such as having specialized getter and setters for specific property types. Setters are missing altogether right now and will fall back to name lookup. Change-Id: If3cb4e7c9454ef4850a615f0935b311c9395b165 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Speed up id object lookupsSimon Hausmann2013-10-291-0/+1
| | | | | | | | | | | | | | | | | We can resolve lookups for objects referenced by id at QML compile time and use a run-time helper to extract the id object out of the QML context data by index instead of name. Dependencies to id objects are also tracked at compile time and registered separately before entering the generated function code. The lookup of id objects is encoded in the IR as special member lookups. Members will also then in the future be used to for property lookups in context and scope properties, as well as any other property lookups in QObjects where we can determine the meta-object. Change-Id: I36cf3ceb11b51a983da6cad5b61c3bf574acc20a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a constant table to the compiled dataLars Knoll2013-10-291-0/+3
| | | | | | | | This will help simplifying and speeding up the moth generated code. Change-Id: I1b87c4b25dbfa6ce2e8a0b77e526f7fc063b0de2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Beginning of a new qml parserSimon Hausmann2013-09-081-5/+6
| | | | | | | | | | | | | | The goal is to parse QML and JavaScript binding expressions/functions in one go and generate data structures that allow for the parsing to happen in a thread and the instantiation of the object tree in another thread, just reading from the generated data structures. This will replace qqmlcompiler and the VME. This new way of loading QML is currently hidden behind the QML_NEW_COMPILER=1 environment variable. There's lots of work left to fill in the gaps in object construction, Component support, Component.onComplete, error messages, etc. etc. Change-Id: I5e40643cff169f469f0b6ce151584ffee5ca5e90 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of engine pointer in iselSimon Hausmann2013-08-181-1/+1
| | | | | Change-Id: I58759712624713cd2215621dca4ccc86fa9a9194 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Ported the compile-time class setup for object literals to be run-time basedSimon Hausmann2013-08-161-0/+5
| | | | | Change-Id: I21225e4bf0f66914229cf64fa29ce870548c0e93 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Store line number mappings in the compiled functionSimon Hausmann2013-08-161-1/+5
| | | | | Change-Id: I4e37aac3618b20ccd52ce4833098781374a3daf6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Ported regular expressions over to be run-time generated dataSimon Hausmann2013-08-161-0/+4
| | | | | Change-Id: I04e693d4923c97c3d869a5beb17011f6aad85f03 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Ported lookups to use the compiled data infrastructureSimon Hausmann2013-08-151-1/+7
| | | | | Change-Id: Idf75cd51087ea825f22aabda59661be461fd3b86 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move codeRef out of QV4::FunctionSimon Hausmann2013-08-151-1/+1
| | | | | Change-Id: I65700b9cc4907aaa28623a95204e88f87fccfd49 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Begin using the compiled data structures for runtime stringsSimon Hausmann2013-08-151-2/+0
| | | | | Change-Id: Idbf278a96624bf101df35de40577b38e593f22be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Initial version of generator for new data structuresSimon Hausmann2013-08-151-0/+82
Change-Id: I172a504f8b4f8284967a4a02e207bf4c0a04c2a4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>