aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup calls to Object::setPrototype()Lars Knoll2013-09-021-2/+0
| | | | | | | | Rather use the correct internalClass directly when constructing the objects. Change-Id: I8e916f1ce8f83d291c08ca6332fe85b1f57b90b5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move prototype pointer into QV4::InternalClassLars Knoll2013-09-021-2/+2
| | | | | | | | | | | | | The prototype is actually the same for most objects. By moving it into the internal class, we can save 8 bytes per object, as well as allowing for some future optimizations. Also fix a bug in the implementation of the Error prototype objects. Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* change calling convention for JS function callsLars Knoll2013-09-021-4/+4
| | | | | | | | | | | | This allows faster pass through of the data if we have nested calls. Also make sure we always reserve at least QV4::Global::ReservedArgumentCount Values on the stack to avoid stack corruption. Change-Id: I42976460f1ef11a333d4adda70fba8daac66acf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix crashes when running tst_qqmlecmascript::importScripts with aggressive gcSimon Hausmann2013-09-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | In the case of imported JavaScript files, it may happen that we parse the JS once and then re-use it across different places where it is imported. That means we parse and compile the JS once, keep the QV4::Script around and call it as a function closure with different qml global objects (contexts), depending on where it is imported from. In this situation it is possible that the QV4::Script's run() is called once, a new function object is created, we call it to return the JS library to "eval" itself into the qml scope and afterwards it may happen that the function object is garbage collected. It is at this point possible that the compilation unit's refcount therefore also drops to zero, and thus subsequent calls to QV4::Script::run() that create new QQmlBinding objects will access a dangling compilationUnit pointer. This patch fixes that by making QV4::Script - which is holding a QV4::Function pointer - also have a persistent, which maintainers a refcount on the compilation unit. If the script dies, the persistent will get collected and the last deref will delete the unit. A script can however outlive the engine, but PersistentValue has the mechanism built in to free itself on engine destruction, which will also deref the unit accordingly. Change-Id: I0a7f4e64497bde423ffa55c705af55cdb7d29cf2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge branch 'wip/v4' of ssh://codereview.qt-project.org/qt/qtdeclarative ↵Simon Hausmann2013-08-201-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into dev Conflicts: src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4codegen_p.h src/qml/compiler/qv4isel_moth.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4runtime_p.h src/qml/jsruntime/qv4script.cpp sync.profile Change-Id: I1d785e2134bffac9553a1c16eed12816cbd1ad2c
| * Refcount the compilation unit and remove refcount from runtime functionSimon Hausmann2013-08-161-0/+2
| | | | | | | | | | Change-Id: Iaa2f96a6814f1b39589ffcfe3c84e3c229e25f1f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove QV4::DiagnosticMessageLars Knoll2013-08-201-13/+1
|/ | | | | | | | | | QQmlError provides the same functionality, so let's rather use that where required. Remove the dependency of codegen onto the ExecutionContext that was only required for error handling. Change-Id: Ib0b61c0e138f89ff989c32996c93c339e4b62223 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the llvm isel backendLars Knoll2013-08-082-172/+1
| | | | | | | This code never worked. Change-Id: I0fd7421ae983f3ad43e84e5d7579cdbb610ab2b2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Initial support for debugging in the v4 interpreterSimon Hausmann2013-07-261-14/+0
| | | | | | | | | This adds breakpoint support to the Debugger, a helper function in the engine for enabling debugging (which will switch from JIT to the interpreter) and a DebuggingAgent interface, for use by v4 clients. Change-Id: I78e17a6cbe7196b0dfe4ee157fc028532131caa3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fix FDE generation on Intel 32-bitSimon Hausmann2013-07-231-4/+7
| | | | | | | | | | Make the generated FDE program reflect that ESI and EDI are callee saved registers. For some reason the program we've had in qv4unwindhelper_p-dw.h for 32-bit was already correct, but the generator was broken (and even mixed up the registers). Change-Id: Id8132580d20636c8ea17f8460d161547227c95fc Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-07-221-13/+10
|\ | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/quick/items/context2d/qquickcontext2d.cpp tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro Change-Id: I36a4fd28b3156839aecd70039a3ba566bf19a0bc
| * qmlscene: ensure that the window & component get destructedJ-P Nurmi2013-07-041-13/+10
| | | | | | | | | | | | Task-number: QTBUG-32207 Change-Id: Ic7c45228cbdc049d3dfdb3482296d0e8c89a930c Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Add --noinstantiate to qmlplugindumpAlan Alpert2013-06-131-38/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | This flag allows you to run qmlplugindump on plugins which cannot safely create objects, such as plugins with unusual requirements or missing essential dependencies. Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com> (cherry picked from commit 0462193b6fb97fbe7ccde496c33d82d4d5fce8c0) Change-Id: I0d1ff7f94e00a8aab94c0aff012d78db5193400f Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Move QV4::Exception into a separate compilation unit with header fileSimon Hausmann2013-07-121-0/+1
| | | | | | | | | | | | | | | | This is in preparation for some platform specific code regarding throwing exceptions, as well as a general cleanup :) Change-Id: I23fb4f12fd09423a1f2cb225145780925002677b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Disable the JIT on Windows/AMD64 as well as on iOSSimon Hausmann2013-06-261-1/+6
| | | | | | | | | | Change-Id: I7402981caa2f73fd0712975e657488a4065f403f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-246-52/+81
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-123-2/+6
| |\| | | | | | | | | | Change-Id: I045587eac266e9b6296d9cd9e3c73031fe18bbd1
| | * Make qtdeclarative compile with QT_NO_NETWORKPROXYTasuku Suzuki2013-06-111-0/+2
| | | | | | | | | | | | | | | Change-Id: Ie7bf1e1d15da323f901f2c6b851a7b1e8ae0d832 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| | * Make qtdeclarative compile with -no-guiTasuku Suzuki2013-06-101-1/+1
| | | | | | | | | | | | | | | Change-Id: I0c5a55c8f6b78450b2bce693bb55e12f8a224172 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| | * qmlscene: if top-level is a QQuickWindow, set incubation controllerShawn Rutledge2013-06-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The necessity for this is documented in the QQuickWindow::incubationController() accessor. Bug 31203 is about writing a custom main() with a QQmlApplicationEngine, not about qmlscene, but the same workaround is necessary for both. Hopefully soon we find a way to make it unnecessary, but for now it is. This fix also doesn't take care of the QtObject { Window { } } use case. Task-number: QTBUG-31203 Change-Id: Ic9a5e4a23ac918593138dc9cab3de6cd36453eaf Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * | Add --noinstantiate to qmlplugindumpAlan Alpert2013-05-291-38/+44
| |/ | | | | | | | | | | | | | | | | | | This flag allows you to run qmlplugindump on plugins which cannot safely create objects, such as plugins with unusual requirements or missing essential dependencies. Change-Id: Ifcc542b8dec5358fc8a76d78a2a272c9cbf5d78a Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
| * qmlscene: Set window flags correctly.Friedemann Kleint2013-05-231-1/+3
| | | | | | | | | | | | | | Task-number: QTBUG-31258 Change-Id: I13dfc17c75075de155505d20c57400753de0a71d Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * qmlscene: don't call show() on the window if it's already showingShawn Rutledge2013-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | That way Component.onCompleted() can optionally do showMaximized() without being overridden. Task-number: QTBUG-31260 Change-Id: I6f5c3025efd3b38809be85da4172241695168a6c Reviewed-by: Nikita Krupenko <krnekit@gmail.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * Tools: unnecessary to make qmlplugindump a bundleLiang Qi2013-05-201-9/+7
| | | | | | | | | | | | | | | | Embed Info.plist in qmlplugindump executable in a special way. Change-Id: I7eb73d0f832ab53d352c1fd2275f77e853269c2c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
| * qmlplugindump: Add explanation why it needs to be an app bundleKai Koehne2013-05-081-0/+7
| | | | | | | | | | | | | | | | | | Since this is popping up quite regularly, add an explanation why we need qmlplugindump to be an application bundle. Change-Id: Iacf5ad0742aa9fb601c3be046f268764df062e81 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * adjust to new "configure -nomake tools" semanticsOswald Buddenhagen2013-05-081-0/+11
| | | | | | | | | | Change-Id: I34ea6a8ea5f6f2641bf5deaf2a7136e5ed51a8ba Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
| * qmlplugindump: add an explicit -relocatable switchFawzi Mohamed2013-04-241-2/+7
| | | | | | | | | | | | | | this will enable us to switch the default to nonrelocatable Change-Id: Ic4bff6466ee2fb6d4d1dd89829034ad239422a7e Reviewed-by: Kai Koehne <kai.koehne@digia.com>
| * Doc: Fix module name formatSze Howe Koh2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtGui -> Qt GUI QtMultimedia -> Qt Multimedia QtScript -> Qt Script QtSensors -> Qt Sensors QtSvg -> Qt SVG QtWebkit -> Qt WebKit Also fix a broken link to "Qt WebKit QML Types" Change-Id: Ica6081024d3957a3ca2ef3d870f623506c69d877 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * qmlplugindump: always output exportMetaObjectRevisionsFawzi Mohamed2013-04-151-6/+2
| | | | | | | | | | | | | | | | | | | | Some people were confused about exportMetaObjectRevisions, and the "all 0" as default was not expected. Make it explicit so we might change the default in the future. Change-Id: I1f208ba54e2b9aa1a5d46fb9971572467b69ab56 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Remove the context argument from Managed::callLars Knoll2013-06-221-5/+5
| | | | | | | | | | Change-Id: I0895f9a94af47c8aab1dc93579921737e9516f7d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove context parameter from Manged::put.Lars Knoll2013-06-221-5/+3
| | | | | | | | | | Change-Id: Ib99e726ffbb20463d45a8444b4fbdfe32cd6dbef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Make it possible to evaluate JS with the v4 tool the QML waySimon Hausmann2013-06-171-0/+7
| | | | | | | | | | Change-Id: I2a40e82612c2da1b52a37cbff2507951e4ac0349 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix file and line number reporting of QML/JS errorsSimon Hausmann2013-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | * Replace QUrl with QString in V4 for the source location (we don't need URL parsing) * Replace line number and file in QV4::Exception with the information we retrieve from the stack trace of the exception. Fixes about five tst_qqmlecmascript tests that relied on correct file/line number information Change-Id: I2a3daa72be6c5587fd965211ea8f6fb77142e7ee Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add support for line numbers in stack traces (Linux/Mac OS X only at this point)Simon Hausmann2013-05-271-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for debug annotations on statement boundaries to the IR, to get accurate line/column information * Use binary search to retrieve the function and line number for a given program counter * Save the stack trace in the exception class and print it in v4 * Fix initial line number in QV4::Script to start a 1, just like the initial column in QQmlJS::Lexer also starts at 1 The native stack frame tracing is currently only implemented on Linux and Mac OS X. The implementation for Windows using StackWalk64 is still missing. Change-Id: I771fe44816397e29c69952772a772bf0d985236f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Various fixesLars Knoll2013-05-221-5/+4
| | | | | | | | | | | | | | | | Fix a regression in Script::run, and compilation for v4 and an auto test. Change-Id: I4026eebec0e02f4af03ca49ba714916ad90b34e7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add flag to the engine to enable/disable RegExp JITting.Erik Verbruggen2013-05-081-1/+6
| | | | | | | | | | Change-Id: I4b632e6f8ab7cf20576f94764ed506de8be63efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanups to QV4::LookupLars Knoll2013-04-201-19/+19
| | | | | | | | | | | | | | | | | | Better naming for the methods, deinline some code, add a generic path for setters and prepare for moving parts of it into the Managed's vtable. Change-Id: Ide8d32181fdabdf34c910db20b28fb8f87167570 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix compilation with built-in v4vm JS engineSimon Hausmann2013-04-155-14/+17
| | | | | | | | | | Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'master' of ↵Simon Hausmann2013-04-154-0/+792
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | ssh://codereview.qt-project.org:29418/playground/v4vm into v4 This is the initial merge of the v4vm JS engine, designed specifically for QML. The engine is tested on Linux and Mac OS X, works on x86, x86-64 and ARM. Change-Id: I826b72cfa3d3575007b70d78604080582db568db Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Store the global object as an Object pointer in the engineLars Knoll2013-04-081-1/+1
| | | | | | | | | | Change-Id: Ia8b010a9d9c9dd3aacb1b08ce34a42236fa73195 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Check if "use strict" has no escaped chars.Erik Verbruggen2013-03-181-1/+1
| | | | | | | | | | Change-Id: I7dc172eba02d454467ead1e18a1a59e98890dd54 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Rename qmljs_runtime to qv4runtimeLars Knoll2013-03-141-1/+1
| | | | | | | | | | Change-Id: I46ba9b2621be72116d94bee249ad5b798e951c88 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Rename qmljs_environment.* to qv4context.*Lars Knoll2013-03-141-1/+1
| | | | | | | | | | Change-Id: I6fe62b501803422f78b47a87c55e4278820725aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * "Fix" llvm build.Erik Verbruggen2013-03-071-0/+5
| | | | | | | | | | | | | | In a way that it the compiler doesn't complain anymore. Change-Id: I877b1a051b2ffcbd63a04cf219733b2b21cb9128 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Cleanup put and properly implement it for stringsLars Knoll2013-03-071-2/+2
| | | | | | | | | | Change-Id: I10dda09c8a087bc7ef34c0315c698e08c35ec28d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * First part of moving get/put etc. into the Managed vtbl.Lars Knoll2013-03-071-1/+1
| | | | | | | | | | Change-Id: I6fe14b02205901dbffa25c6c1b4883fb99586417 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Get rid of 'Value ExecutionEngine::exception' memberSimon Hausmann2013-03-061-5/+4
| | | | | | | | | | | | | | | | | | Instead the JS exception value is now part of the C++ Exception object. This also allows getting rid of some run-time functions. Change-Id: I43ff773cacd5e925ba96601f3633ccf3b62273be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Move function execution into a little ExecutionEngine::run helper functionSimon Hausmann2013-03-051-13/+5
| | | | | | | | | | | | | | This will allow for re-use from the v8 wrapper API. Change-Id: I2330432dad43d7fd7af6147e96a0cbbb340cd917 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Cleanup: Get rid of manual unwind stackSimon Hausmann2013-03-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of doing the ExecutionContext unwinding at the time of throw, do it at the time of catch, conveniently through an accept() method of the Exception object. That allows us to get rid of the separate handler registration stack. The only tricky part are that some execution contexts are allocated on the stack. When exceptions are thrown through that, we have to catch, unwinding up until that point (or rather the parent of the stack allocated context that's going to be deleted) and then simply rethrow. This patch also gets rid of the __builtin_delete_exception_handler. The next patch will rename the remainder to what it really does now. Change-Id: I00bb113b3a2fe24f7054c03fdfb8fed5cc1258b1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Implement JavaScript exceptions using C++ exceptionsSimon Hausmann2013-03-031-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of registering catch handlers with setjmp and throwing JS exceptions with longjmp, they are now thrown and caught as C++ exceptions. This allows for tight interoperability between C++ and JS in the future and allows for clear semantics with regards to cleaning up memory in the engine when throwing exceptions. (destructors are guaranteed to be called, unlike with setjmp/longjmp). The recent unwind table additions allow for the exceptions to be thrown through JIT generated code. Catching the exception is done by re-using the existing IR semantics where the beginning of a try block is marked by registering an exception handler. Execution after the registration continues conditionally, based on the return value of builtin_create_exception_handler. A return value of is 0 the try block(s) are executed. If an exception is thrown during that time, execution resumes at the point where builtin_create_exception_handler returns, but with a return value of 1. If an exception is thrown within the catch handler, the execution resumes again at the same point, but the inCatch IR variable will guide execution straight to the finally block(s), which calls delete_exception_handler. In the JIT as well as the interpreter this is implemented by entering a C++ code section that contains a C++ try {} catch {} block, in which the calling function is called again and continues right at the next instruction (or the interpreter loop is recursively entered). An exception will throw us out of that scope and back into the try {} catch {} wrapper, which can call again into the calling function. The IR guarantees that delete_exception_handler is always called, regardless of how the try or catch blocks are terminated. That is where in the JIT and interpreter we return from the nested function call and return back into the original stack frame, effectively unregistering the catch handler. Further cleanups with regards to the naming and the exception handler stack will come in subsequent patches, this is merely the minimal patch set to change to the new mechanism. This patch set breaks ARM until ARM exception handler tables are implemented. The interpreter changes are based on a patchset from Erik from https://codereview.qt-project.org/#change,45750 Change-Id: I543f2bd37b2186f7e48ffcab177d57b5ce932a0c Reviewed-by: Lars Knoll <lars.knoll@digia.com>