aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential null pointer dereferencingFrederik Gladhorn2014-05-301-2/+3
| | | | | | | | | These were found by http://www.viva64.com/en/b/025 most issues are rather cosmetic. Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Polish property binding explanationsSze Howe Koh2014-05-161-10/+8
| | | | | | | | | - Minor rearrangements - Express things more clearly and/or concisely - Add links Change-Id: If1ed639609e39ed1a2c12aed3971da3ee2c8f8a0 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove V8 profiler serviceUlf Hermann2014-05-091-1/+0
| | | | | | | | | It's broken and useless and it sends confusing data to the profiler client. Task-number: QTCREATORBUG-12188 Change-Id: I944cf19a78ee4378d5773e7aa80876f199a0f03b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix crash in conversion from QVariantMap to QJSValueSimon Hausmann2014-03-281-1/+5
| | | | | | | | | | When the key is an array index, use arraySet instead of trying to insert an array index as internal class member. Task-number: QTBUG-37854 Change-Id: I23f01cc9d6be98b57d3f13ac7ee847298e9632a3 Reviewed-by: Matt Broadstone <mbroadst@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove redundant QQmlBinding members.Michael Brasser2014-03-112-30/+42
| | | | | | | | | This reduces the size of QQmlBinding by 12 bytes. Task-number: QTBUG-37134 Change-Id: Id55257edec8cee88d863374e8a96d7eebbeaf523 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Reserve a double slot for accessor propertiesLars Knoll2014-03-071-2/+4
| | | | | | | | | | Reserve two slots in the internal class for accessor properties. This opens up reducing the default storage required per data property to one Value. In practice this implies cutting the required memory in half. Change-Id: Ifed897852bbdfd810018f0d6b049fca6690ead2c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the name member of FunctionObjectLars Knoll2014-03-071-1/+1
| | | | | | | | The data is anyway stored in the name property of the FunctionObject, and is not performance critical. Change-Id: If1784b0ec6f368bc474c246bb9c2c50d5e56b689 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add the features of QLoggingCategory to QML's debugging methods.Giorgos Tsiapaliokas2014-03-071-4/+10
| | | | | | | | | | It is now possible to modify the output of QML's debugging methods. Also the prefix of "qml" makes it possible to capture the output from the QML files using qInstallMessageHandler. This commit depends on qtbase/4967c7106568d5df0be4d40bf793583c7c6bdb69 Change-Id: I2c7a2cb96a0b91fd3249dc2dacbab63e6ac68243 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Reduce memory usage for object literals with integral keysSimon Hausmann2014-02-161-2/+7
| | | | | | | | | | | | Be more aggressive about using sparse arrays for object literals than for regular array handling, to reduce the memory usage in this use case. The current heuristic is that indices over 0x1000 switch to sparse, which means a simple { "3000" : "test" } creates a long vector instead of a sparse array. Task-number: QTBUG-36803 Change-Id: Id05c76f0f597cd016114cd27ec54effbebe26e48 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Infrastructure for supporting multiple profilers in qqmlprofilerserviceUlf Hermann2014-02-131-22/+6
| | | | | | | | | The concepts of "global" and "engine" profilers are introduced. Profilers can either be attached to specific QML engines and run in their threads or they can be unspecific global profilers running in arbitrary threads. Change-Id: I3862fc65c07ccb33a1ca08cd2425e4079d3ffc02 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Rename some filesLars Knoll2014-01-312-2/+2
| | | | | | | | | | | | 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>
* Change virtual methods in ArrayData to take Object pointerLars Knoll2014-01-241-4/+4
| | | | | | | | | Pass a pointer to the underlying object instead of the ArrayData to virtual methods that modify the arrayData. This prepares for allocating the ArrayData together with the array itself. Change-Id: I66fe187f8b1e4d382ab243a518dbde5f18a1d16d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename V8 profiler classes to V4Ulf Hermann2014-01-233-46/+3
| | | | | Change-Id: I54a71b83bdcaa4198b63a08572bc3d9d1bf8deea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-221-1/+1
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Split ManagedVTable into two classesLars Knoll2014-01-212-6/+6
| | | | | | | | 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>
* Add a SimpleArrayData classLars Knoll2014-01-201-12/+6
| | | | | | | | | | | | | | | | This makes the ArrayData class 'pure virtual'. SimpleArrayData now contains the implementation of simple arrays. This makes the separation between simple and sparse arrays a lot cleaner. It also allows us to move len and offset from the base class into the SimpleArrayClass. This fixes some bugs where we accessed len for sparse arrays leading to some buggy behavior. Added a virtual length() method to ArrayData to query the highes used index in the Array. Change-Id: Iab2ba2a48ebe5b7031759eeb4ebe02b4d86233f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-171-1/+3
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/imports/dialogs/DefaultFileDialog.qml src/imports/widgets/qquickqfiledialog.cpp Change-Id: I00de6dd05cb773f01254061d585a82c90b229acd
| * Make sure that profiling can only be started if debugging is enabled.Ulf Hermann2014-01-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | Enabling the profiler doesn't make much sense if there is no debug service as the messages can't be sent anywhere then. Furthermore, the profiler instance is only properly initialized if debugging is enabled and thus enabling profiling without debugging being enabled can cause problems. Change-Id: I784a110126d45a9a2bc9d9e14d9a22e2980c3a42 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Allow assignment of a QML Locale object to a C++ QLocale property.Mitch Curtis2014-01-141-1/+4
| | | | | | | | | | | | | | Task-number: QTBUG-36125 Change-Id: I58454db0c47684aed3e95c52a8135fd5fd6bf2f9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup: change signature of Object::insertMember()Lars Knoll2014-01-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Methods returning a Property pointer have to be removed, so that we can move over to store member data requiring only one value for the common case of data properties. This will in the long term reduce memory consumption on 64 bit systems quite a bit. Change-Id: I78de3794ec7b3bc5db13aa57275d3f08fa9d470a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rework array handling for JS objectsLars Knoll2014-01-091-11/+15
| | | | | | | | | | | | | | | | | | Split up ArrayData into two classes, one for regular arrays, one for sparse arrays and cleanly separate the two cases. Only create array data on demand. Change-Id: I9ca8d0b53592174f213ba0f20caf93e77dba690a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Clean up handling of illegal names and enable in new compilerSimon Hausmann2014-01-062-5/+4
| | | | | | | | | | | | | | | | | | | | Access to the identifier hash may not be thread-safe from the loader thread, so use a QSet copy instead (which is cheap because we don't detach). This also enables the checking for illegal types again. Change-Id: I8c3ec1fd0fc01cce3269e206f479a90bdbbc89dd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-061-2/+2
|\| | | | | | | Change-Id: If9a205bea219b9aca95d78b1e556ca9bbff58dd0
| * Doc: Fix broken linksSze Howe Koh2013-12-301-2/+2
| | | | | | | | | | Change-Id: I4c4577edde96978a986606bf30fbb925f871bd42 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* | Move array data into it's own structLars Knoll2014-01-031-8/+8
|/ | | | | | | First step of separating the array data from Object. Change-Id: I5c857397f0ef53cff0807debdb1e405424e1046a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use qCpuHasFeature because the check can be optimized out of existenceThiago Macieira2013-12-101-1/+1
| | | | | | | | | qCpuHasFeature also checks the compiler flags of this particular build. If the feature was enabled by the compiler in this .cpp, then no runtime check is performed and the test becomes an unconditional true. Change-Id: Ibb7d333e59a0f4ed06b7d0056547177fd69658a0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Encapsulate the current context and fix it's usageLars Knoll2013-12-041-3/+3
| | | | | | | | | | | Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove setVTable calls in performance critical areasLars Knoll2013-12-041-1/+1
| | | | | | | | | | Remove all the calls to setVTable that were in performance critical parts of the code. This now brings performance back to the level we had with the vtable inlined in the Managed objects. Change-Id: I76317cc5c53b5b700d1d3883b954407142a4c424 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the vtable pointer from the object to the internal classLars Knoll2013-12-041-2/+2
| | | | | | | | 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>
* Fix qsTr() in .js contextJ-P Nurmi2013-12-041-1/+3
| | | | | | | | | Don't assume a four characters long file name suffix (.qml) Task-number: QTBUG-32850 Change-Id: I522c06b71bf1b38f32f2947a6c06017f83eb50be Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* For x86 builds, try to detect SSE2 availability early and bail outSimon Hausmann2013-11-091-0/+7
| | | | | | | | | | ...instead of potentially just crashing. This is for the rare case of somebody trying to run a QML2 based application on a Pentium 3 from before 2001 or older. Change-Id: Ia5606fe28ef5579654ec939c86830af70dbb84d7 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Simplify & speed up function callingLars Knoll2013-11-092-106/+106
| | | | | | | | | Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor marking GC'ed objectsLars Knoll2013-11-051-3/+3
| | | | | | | | | | | Don't use recursive function calls anymore. Instead, push marked objects onto the JS stack, and then pop them off when their children are being marked. Should reduce stack memory usage, and improves performance by ~5%. Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix various compiler warnings in order to remove warn_off in the near futureErik Verbruggen2013-11-042-10/+10
| | | | | Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-293-16/+14
| | | | | | | | | | | | | | We don't want to check for exceptions after every single line on our runtime methods. A better way to handle this is to add the check in all methods that have direct side effects (as e.g. writing to a property of the JS stack). We also need to return whereever we throw an exception. To simplify the code, ExecutionContext::throwXxx methods now return a ReturnedValue (always undefined) for convenience. Change-Id: Ide6c804f819c731a3f14c6c43121d08029c9fb90 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Protect a few constructors against self destructionLars Knoll2013-10-111-0/+4
| | | | | | | | This gets most of qqmlecmascript to pass with aggressive and exact garbage collection. Change-Id: I93ecbfe55f62af68227cdf3b1ec2bd066f1cbdef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Smaller cleanupsLars Knoll2013-10-111-13/+25
| | | | | Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove usage of String pointers where not requiredLars Knoll2013-10-111-6/+12
| | | | | Change-Id: Ia533308a1641fab263d8faa8316455e8ade1c859 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct usages of Managed pointersLars Knoll2013-10-111-3/+3
| | | | | Change-Id: I32f61b7919797eef51a8705695787175b76244c4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't print garbage or crash when using console.logJan Arve Saether2013-10-031-8/+17
| | | | | | | | | | | | | | | | | The problem was that the ctor of QMessageLogger did not make a deep copy of the source or the function. Since the QByteArray returned from toUtf8() was only guaranteed to live within the statement it was used, the pointers that QMessageLogger held would point to released memory as soon as the QByteArray got destructed. This could only be reproduced if the logging framework tried to print the source file or the source function. In my case, I had set this environment variable to provoke this: $env:QT_MESSAGE_PATTERN="%{file}(%{line}):%{message}" Change-Id: I4ea4cf309c6c6420cef5bab0108a6cb2b2f9e841 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change exception handling APISimon Hausmann2013-10-021-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the exception handling API in the engine slightly, encapsulating any use of direct throw statements and catch blocks with concrete types. In the future we need to be able to change the way these are implemented, in order to ensure that the correct stack unwinding code is triggered for throw and re-throw. This patch separates the C++ exception object thrown from the V4 exception (that includes value, throwing context pointer) and stores the latter inside the engine. In order for that to compile, ExecutionEngine::StackTrace and StackFrame had to move into the QV4 namespace directly. In addition the syntax for catching exceptions changes from try { ... } catch (QV4::Exception &ex) { ex.accept(context); QV4::ScopedValue exceptionValue(scope, ex.value()); } to try { ... } catch (...) { QV4::ScopedValue exception(scope, context->catchException()); } Context::catchException() checks if there's a "current" exception in the engine, and if not assumes that we caught an unrelated exception and consequently re-throws. partiallyUnwind() is also gone and replaced with rethrowException(), in order to encapsulate the re-throw. Lastly, in the future nesting try/catch blocks isn't going to be possible due to limitations in the common C++ ABI with regards to foreign exceptions. Change-Id: Ic81c75b057a2147e3176d8e0b4d326c14278b47d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix ObjectIterator API to be GC safeLars Knoll2013-10-021-4/+3
| | | | | Change-Id: I3a9c48d53d8dbadcb9b32c00fcef1f89447c4b8c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-6/+6
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove most uses of Value from qml/qmlLars Knoll2013-09-302-30/+32
| | | | | Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix API for Object::define*PropertyLars Knoll2013-09-284-8/+8
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove Value::fromString()Lars Knoll2013-09-283-16/+16
| | | | | | | | replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct QV4::Value usageLars Knoll2013-09-282-6/+7
| | | | | | | | Remove Value::fromString(String *), and make Encode safe against encoding raw Managed * pointers. Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make API of QV4::JsonObject GC cleanLars Knoll2013-09-281-9/+13
| | | | | Change-Id: Ie7f2d63402c9486b30caf5866af8c747026c091d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-285-32/+32
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix CallContext to not hold arguments on the C stack anymoreLars Knoll2013-09-281-172/+172
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>