Commit Graph

101 Commits

Author SHA1 Message Date
Friedemann Kleint dc0a7d7021 Tools: Add product name, version and description to the .pro files
This information will then be visible in Windows explorer.

Change-Id: I9d2f936584308394b4e3246d57bed44083b3cbca
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-31 08:44:36 +00:00
Liang Qi 172260ebef Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I905dcd29377bf1b2e0ee086823b54277d18e78dd
2016-12-14 08:54:57 +01:00
Simon Hausmann 8bf579d8d4 Cleanup of builtin JS helpers for qmljs
Replace the hand-written gc and print functions with the print and gc
functions also used in Qml and QJSEngine. And while we're at it, this
also adds the console object.

Change-Id: Ia3a0ff24936b7ed5149cb689838b987f9178131e
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-11-26 09:17:36 +00:00
Liang Qi 5d4cbf4094 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/qml/jsruntime/qv4object_p.h

Change-Id: Iff4d3aba7710a999b8befdc493cbe959e1ce02f9
2016-11-23 10:49:37 +01:00
Friedemann Kleint 05e3cdd8ab Set Qt version on tools
Change-Id: I21d77b2eba7107528fc00db0cf5d87f8347b63be
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-11-09 09:18:44 +00:00
J-P Nurmi da5083c11d Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	tools/qmljs/qmljs.cpp

Change-Id: Ifa9e74bdb780eaff22fbc9ba1c514d0078a3fb29
2016-11-03 11:01:45 +01:00
Simon Hausmann 161473721d Add the ability to explicitly enable the code cache in qmljs
This also requires mapping the label pointers in the byte code back to
the instruction enum. Fortunately this reverse mapping is only needed in
the qmljs case. Normally in the QML engine we persist the byte-code to
disk before linking the compilation unit to the engine (where we map the
enum to goto labels).

Change-Id: If0b79288274bb1031161841b63a85f164502aaec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-23 13:36:47 +00:00
Liang Qi f04c2c40fd Merge remote-tracking branch 'origin/5.8' into dev
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
2016-10-18 08:33:26 +02:00
Lars Knoll 11e0e5574a Make the Moth interpreter configurable
Change-Id: I2b784820c4e39a7932f81bfee9ce78e01a2e96b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-10-10 14:11:44 +00:00
Erik Verbruggen 3b14e2ffdd QML: Make Heap::Object and all subclasses trivial
GCC6 might dead-store-eliminate out our secret write to Base::mmdata,
because it expects all memory content to be "undefined" before
constructor calls. Clang might take the same approach if the constructor
of Heap::Object is removed.

By making these structs trivial, it also makes them memcpy-able.

Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-10-06 11:44:08 +00:00
Anton Kudryavtsev 457bb7a465 tools: use const (and const APIs) more
For CoW types, prefer const methods to avoid needless detach()ing.

Change-Id: If9018391c001eba3b4b2061d06c4caa8136811ab
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-22 16:44:33 +00:00
Anton Kudryavtsev 3ef4fac9ff tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const
to prevent detach()'ing.
Use qAsConst where is not possible mark as const.

Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:52:34 +00:00
Erik Verbruggen 702c4247d7 V4: Pass scope around as parameters inside the runtime.
The implementation of many (or all) runtime functions consist of first
creating a QV4::Scope, which saves and restores the JS stack pointer.
It also prevents tail-calls because of that restoring behavior. In many
cases it suffices to do that at the entry-point of the runtime.

The return value of a JS function call is now also stored in the scope.
Previously, all return values were stored in a ScopedValue, got loaded
on return, and immediately stored in another ScopedValue in the caller.
This resulted in a lot of stores, where now there is only one store
needed, and no extra ScopedValue for every function.

Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-06-22 11:07:05 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Friedemann Kleint 16154fba86 Tools: Fix single-character string literals.
Use character literals where applicable.

Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-10-13 13:40:44 +00:00
Lars Knoll 2a8de9d8d8 Convert FunctionObjects to new allocation syntax
Change-Id: I269c20abdc7f9eb0d71a2d2d485d622b65405762
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-22 08:20:09 +00:00
Lars Knoll 833c99db20 Inline property data into the object
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>
2015-09-22 08:19:53 +00:00
Lars Knoll 0d54025cd2 Move exceptionValue and globalObject from the Engine onto the JS stack
We'll need to move all GC'ed objects currently stored in ExecutionEngine
onto the JS stack for easier management in a new garbage collection
scheme. This is the start of that change.

Change-Id: Ib3ad8e846875dade8a807ea79f063173d40e4aad
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-24 15:21:08 +00:00
Lars Knoll 0a499043fb Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.h
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>
2015-04-24 15:20:43 +00:00
Lars Knoll b4cb71e9d7 More cleanups
Get rid of Value::asObject(), and pass const Managed pointers
into some more vtable methods.

Change-Id: Ia4f427d5fd8868f77b4015d1ce5424d32bfc2115
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-21 13:01:47 +00:00
Lars Knoll 4930941197 Further cleanups
The get and getIndexed vtable methods should take a const Managed
pointer. Start cleaning up the asFoo() methods in Value and Managed
by removing asArrayObject() and asErrorObject().

Change-Id: Ibd49bf20773ef84c15785b7ac37a7bc9fd4745d5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-16 17:44:24 +00:00
Jani Heikkinen c5796292ad Update copyright headers
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>
2015-02-12 10:28:11 +00:00
Lars Knoll 13cf87fa93 Remove all remaining usages of ValueRef
Change-Id: Icd76d3d03fac2e57530e55f8ec15b97109dcdcbc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-23 08:07:35 +01:00
Lars Knoll 47fbcb4777 Get rid of all uses of Managed::engine()
Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-21 13:18:55 +01:00
Lars Knoll 36662b60b0 Remove all the setVTable() calls that aren't required anymore
The memory manager's allocation methods now set this up correctly
for us :)

Change-Id: I8492bf732df601f95a1a851fb3804127ffc83935
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-21 13:18:47 +01:00
Simon Hausmann 291aea1463 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	.qmake.conf
	src/qml/jsruntime/qv4context_p.h
	src/qml/jsruntime/qv4debugging.cpp
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4functionobject_p.h
	src/qml/jsruntime/qv4qobjectwrapper.cpp
	src/quick/scenegraph/shaders/visualization.frag
	tests/auto/qml/qjsengine/tst_qjsengine.cpp

Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30
2015-01-16 12:46:52 +01:00
Lars Knoll d3a6412c66 Remove most of the places where getPointer() is used
This is no longer required, and simply uglifies the code

Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:39:55 +01:00
Lars Knoll 05bf96997c Return Heap::ExecutionContext for globalContext()
Change-Id: Ide7c81735be4662ff45bf268cfe750ff1f784453
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-19 18:52:07 +01:00
Erik Verbruggen d2f4be34c7 QMLJS: remove unused/unsupported command-line options
Change-Id: I9710a20752c318a0572aef43779c0289bedf0aa5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-19 10:32:16 +01:00
Lars Knoll 4322c8d768 Better encapsulate access to the global object
Change-Id: I8a76112d821cb3fc172ba0d16ee8410d39b4422a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-11 08:40:48 +01:00
Lars Knoll ddfe9defa8 Encapsulate accesses to the root context
Change-Id: I668cef1363a5c1a5c5b9a7e138f3bd0338712eea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-11 08:40:41 +01:00
Lars Knoll 3dc7b5ddf6 Cleanup exception catching code
Change-Id: I85afd5758f72e19c280dc196601ee145f0c25f01
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-15 13:16:28 +01:00
Lars Knoll 7cc5fb2b53 Cleanup: remove Value::toString/Object overloads taking a context
Change-Id: I4cb63c3cc4eb9bb81f10f9826f80e581b4e1990c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-15 11:25:09 +01:00
Lars Knoll ef8ad8234b Move Data of FunctionObject and related classes into Heap
Change-Id: Iadf74f953798c1884e0ec704ccb7c70d971e3273
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 19:47:34 +01:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- 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>
2014-08-25 11:28:46 +02:00
Erik Verbruggen d10b97563f Rename main.cpp to qmljs.cpp.
Finding the one "right" main.cpp (when there are 90 of them) is hard. So
give at least this important one a good name.

Change-Id: I121f8cbd67bfa9e8ba9ccac384eed45eb46f0b75
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-23 17:22:41 +02:00
Lars Knoll da9d501661 Fix Managed::as<>() method
The as<> casting method was not doing the right thing
in 100% of the cases. It only checked if the object in
question was exactly of the type being asked for. It
however didn't check if the object was derived from the
type.

This commit fixes this by adding a parent chain to the
vtables, that is then being used to check this safely
at runtime.

Change-Id: I9e0b13adbda668aee8c7451e2bb71cd6d4e316d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:49:20 +02:00
Simon Hausmann b393c405b7 Change the object allocation scheme
Instead of allocating the data directly, centralize the object and its ::Data
allocation in one place in the memory manager. This is in preparation for
additional pointer indirection later.

Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-07-22 13:49:19 +02:00
Lars Knoll dba56a752c Convert remaining FunctionObject's to new constructor scheme
Change-Id: I440d5b128d0ee28566ebfa82c2505a4bd97bba6b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:49:18 +02:00
Lars Knoll 33593f00e8 Get rid of StringRef
Remove the Ref classes, as they won't be required
anymore once Managed and Managed::Data are separated.

Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:49:12 +02:00
Lars Knoll 9744e8bd42 Convert ExecutionContext to new storage scheme
Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:49:11 +02:00
Lars Knoll 05f17e841f Get rid of different macros for vtable specializations
Detect existence of a a vtable entry at compile time.

Change-Id: Ieed5d34b063184bc4435b22c6685ac0e3fabf493
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:48:54 +02:00
Lars Knoll 4427576fe5 Avoid calling destroy() on most objects
The method is now optional, and we can simply avoid
calling it if all members an object has are themselves
garbage collected.

Change-Id: If560fce051908bcc10409ead1a7d8a5bd5fa71d2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-07-22 13:48:53 +02:00
Andrew Knight 50f8133a1a Remove several uses of module includes
Module includes are discouraged because they may increase compilation
time. While debugging a broken core module include header, a number
of module include infractions were discovered in qtdeclarative. Replace
them with their more specific counterparts.

Change-Id: I614e9a6aa2177f396e5289f3cdb3c35faa0202c9
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-10 15:04:11 +01:00
Lars Knoll cad3ba5fd4 Clean up our internal namespaces
QQmlJS::MASM -> QV4::JIT
QQmlJS::V4IR -> QV4::IR

Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-23 09:39:52 +01:00
Lars Knoll 7d4fc70e70 Split ManagedVTable into two classes
Keep the basic methods in ManagedVTable, but have
the Object related stuff in an ObjectVTable class.

Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-01-21 20:46:50 +01:00
Lars Knoll fbcd0a22f6 Move the vtable pointer from the object to the internal class
This saves one pointer per object, and willmake other optimizations
easier in the future.

Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-12-04 09:45:45 +01:00
Oswald Buddenhagen 139df62f49 disable qml import scan for qmljs
there is nothing to scan here.

Task-number: QTBUG-35160
Change-Id: I47223a295eafe67f0f2dd85a12444260f88d0623
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-11-30 17:57:02 +01:00
Lars Knoll 0a3e9a41b1 Remove the last C++ exceptions from QtQml
Also clean up and compile the repository with exceptions
disabled again.

Change-Id: I653ae89353284b2f4ab884384f8ea6a5d100785d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-30 12:16:25 +01:00
Lars Knoll e0284ab41f Properly propagate parse errors
Replace all try/catch statements used when parsing
with checks for engine->hasException.

Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-29 10:38:55 +01:00
Simon Hausmann c7e7a650cd Rename v4 to qmljs
We don't want to officially support this binary in our release builds, so
give it a "safer" name and enable it only in developer builds.

Change-Id: Iaa007bc2ccdb133635161aae01d140efe0f44e23
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-22 10:00:04 +02:00