summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptdeclarativeclass_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-2/+2
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Revert "Delete JS-owned QML objects right away in the engine dtor."Peter Kümmel2012-09-251-8/+1
| | | | | | | | | | | This reverts commit ecc432a5b7ae269220f86c6f0b3dd364f8643191 to fix a crash on exit. Task-number: QTBUG-20377 Change-Id: I6606ff194f2c16e06bdbbfca94e55821cf055f75 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Delete JS-owned QML objects right away in the engine dtor.Thomas McGuire2012-09-141-1/+8
| | | | | | | | | | | This prevents memory leaks when the engine is destroyed after exec() has already finished. In most cases this happens during application shutdown, at which point the event loop is never entered again. Task-number: QTBUG-20377 Change-Id: I65564ed3e56314d656d92fd66f11ae67d4eb932b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-3/+3
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Implement property versioning inside the declarative engineAaron Kennedy2011-01-271-0/+1
| | | | Task-number: QTBUG-13451
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11Martin Jones2011-01-191-1/+1
|\
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Small optimization of enum detection in script.Michael Brasser2010-11-121-0/+1
|/ | | | Reviewed-by: Martin Jones
* Use custom static scopes to improve QML/JavaScript performanceKent Hansen2010-06-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new internal JS object type, QScriptStaticScopeObject, that enables the JS compiler to make more aggressive optimizations of scoped property access. QScriptStaticScopeObject registers all its properties in a symbol table that the JS compiler has access to. If the compiler finds the property in the symbol table, it will generate the fast index-based op_{get,put}_scoped_var bytecodes, rather than the dynamic (slow) op_resolve and friends. If the compiler _doesn't_ find the property in the symbol table, it infers that it's safe to skip the scope object when later resolving the property, which will also improve performance (see op_resolve_skip bytecode). QScriptStaticScopeObject is only safe to use when all relevant properties are known at JS compile time; that is, when a function that has the static scope object in its scope chain is compiled. It's up to the user of the class (e.g. QtDeclarative) to ensure that this constraint is not violated. The API for constructing QScriptStaticScopeObject instances is not public; it lives in QScriptDeclarativeClass for now, an internal class exported for the purpose of QML. The instance is returned as a QScriptValue and can be manipulated like any other JS object (e.g. by QScriptValue::setProperty()). The other part of this commit utilizes QScriptStaticScopeObject in QtDeclarative in the two major places where it's currently possible: 1) QML disallows adding properties to the Global Object. Furthermore, it's not possible for QML IDs and properties to "shadow" global variables. Hence, a QScriptStaticScopeObject can be used to hold all the standard ECMA properties, and this scope object can come _before_ the QML component in the scope chain. This enables binding expressions and scripts to have optimized (direct) access to e.g. Math.sin. 2) Imported scripts can have their properties (resulting from variable declarations ("var" statements) and function declarations) added to a static scope object. This enables functions in the script to have optimized (direct) access to the script's own properties, as well as to global properties such as Math. With this change, it's no longer possible to delete properties of the Global Object, nor delete properties of an imported script. It's a compromise we make in order to make the optimization safe. Task-number: QTBUG-8576 Reviewed-by: Aaron Kennedy Reviewed-by: Olivier Goffart Reviewed-by: Jedrzej Nowacki
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7Alan Alpert2010-03-171-1/+2
|\ | | | | | | | | | | | | Conflicts: configure.exe src/declarative/util/qdeclarativelistmodel.cpp tools/qml/qml.pro
| * Update src/3rdparty/javascriptcore and adapt src/script to the changesKent Hansen2010-03-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Update qscriptvalueiterator test to expect length property when iterating arrays and strings. - Use EvalExecutable::create() instead of EvalExecutable constructor. The constructor is private. - Reimplement getOwnPropertyDescriptor() in all custom script objects. - Remove all reimplementations of getPropertyAttributes(). It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used instead). - Remove checkDontDelete argument from deleteProperty() reimplementations. The purpose of this argument was to support deleting properties with attribute Undeletable from C++. But it was quite an invasive patch to JavaScriptCore, and it doesn't seem worth it. If this feature is really crucial it should be re-done upstream. One of the tests needed to be updated so it's not sensitive to the C++ undeletability. - Adapt getOwnPropertyNames() reimplementations to signature change. - Add missing QScriptObject structure flags, otherwise we don't get all virtual calls. - Remove our patch for reporting column numbers in the debugger callbacks. It was just too intrusive. As with the checkDontDelete issue, this should be redone upstream if it's really important. In 4.7, QScriptEngineAgent will always report a column number of 1. Other compilation fixes: - InternalFunction::name() takes an ExecState* argument, not GlobalData* - ScopeChain::globalObject is no longer a function but a member variable - ScopeChainNode constructor takes a GlobalObject argument - Heap::collect() is called collectAllGarbage() - JSValue::strictEqual() takes an ExecState* argument - Debugger::exception() takes a bool hasHandler argument - Debugger no longer reports column number (we decided to drop that patch from JSC) - UString doesn't have operator+=(char*) - Update the autotests to reflect the columnNumber=1 change. - Add helper class to avoid crashing inside JSC. Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of other public API functions that need this guard as well, but I'll add them as they are discovered. - Update mkdist-javascriptcore tag, exclude a few more files. - Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk. Reviewed-by: Simon Hausmann
* | Integrate QML's object ownership with the JS collectorAaron Kennedy2010-03-091-0/+1
|/ | | | | | | QML now behaves in a way similar to QtScript when it comes to QObject ownership. QT-2803
* Compile.Warwick Allison2010-02-031-0/+1
|
* Fix possible crashAaron Kennedy2010-01-151-1/+2
| | | | The QScriptValue does not always have a valid QScriptEngine.
* Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic ↵Aaron Kennedy2010-01-141-1/+1
|\ | | | | | | into kinetic-declarativeui
| * Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt into ↵Warwick Allison2010-01-141-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | kinetic-declarativeui Conflicts: bin/syncqt src/corelib/io/qurl.cpp
| | * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-111-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (71 commits) QNAM HTTP Code: Cache socket state inside ensureConnection() tst_qhttpnetworkconnection: Test also HEAD in some tests tst_qhttpnetworkconnection: Relax condition in getMultipleWithPriorities QNAM HTTP Code: When starting new request, prefer connected sockets. typo fix Added the 'framecapture' WebKit example to the default build. Fix code example fix typo in qreadwritelock's documentation QNAM HTTP: Don't call d_func() so often QNAM HTTP: Fix readBuffer maximum size. QNAM HTTP: Optimize eatWhitespace() QNAM HTTP: Check if socket already tries to connect. network internals: fix build on S60 [syncqt] Make -separate-module work with WebKit's directory structure doc: Corrected explanation of when append() does nothing. doc: Added clarification about allocating space for the 0 terminator. Add a way to access the normalised URL in QUrl. [syncqt] Make it possible to synchronize headers for a separate module [syncqt] Make it possible to override the base directory network internals: start HTTP GET requests right away when called ...
| | | * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me
| | * | Correctly determine QScriptValue::isQObject() for QObjects using theMichael Brasser2010-01-111-0/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | QScriptDeclarativeClass. Task-number: QTBUG-6178 Reviewed-by: Kent Hansen Reviewed-by: Aaron Kennedy
* | | Support calling in QScriptDeclarativeClassAaron Kennedy2010-01-141-0/+4
|/ /
* | CompileAaron Kennedy2010-01-121-1/+1
| |
* | Optimization: Add QScriptDeclarativeClass::ValueAaron Kennedy2010-01-111-1/+30
| | | | | | | | | | | | | | This class is essentially the same as QScriptValue, but it is faster as it doesn't reference objects. Thus, they might be collected if the gc runs. For return values from QScriptDeclarativeClass this isn't a problem, of course.
* | Correctly determine QScriptValue::isQObject() for QObjects using theMichael Brasser2009-12-171-0/+1
|/ | | | | | | | | | | QScriptDeclarativeClass. This allows us to pass QObjects to QML-defined functions which expect a QVariant (and will presumably help in other cases where we expect transparent QObject <-> QVariant conversion in the engine). Task-number: QTBUG-6178 Reviewed-by: Aaron Kennedy
* Fixed the QtScript license information in the source files to referSimon Hausmann2009-11-171-19/+1
| | | | | | | | to the LGPL only. To do this I ran replace-licenses.zsh $QTDIR/src/script release Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Replace LGPL license tags with LGPL-ONLYSimon Hausmann2009-11-171-1/+1
| | | | Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Add QScriptDeclarativeClassAaron Kennedy2009-11-101-0/+129
QScriptDeclarativeClass is a private, but exported, class used by the declarativeui module. It is very similar to QScriptClass, but slightly faster and provides a couple of "backdoor" extension mechanisms used by declarative. Reviewed-by: Warwick Allison