summaryrefslogtreecommitdiffstats
path: root/src/script
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt into ↵Warwick Allison2009-11-043-0/+47
|\ | | | | | | | | | | | | | | kinetic-declarativeui Conflicts: configure.exe src/gui/graphicsview/qgraphicsitem_p.h
| * Merge commit 'origin/4.6' into featureJørgen Lind2009-11-022-0/+31
| |\
| | * Add QScriptString::toArrayIndex() functionKent Hansen2009-10-302-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid hacking a custom toArrayIndex() in the example; instead provide an ECMA-compliant conversion that's as fast as possible (having to convert the QScriptString to a QString and then convert the result to a number is considerably slower than calling JSC's Identifier::toArrayIndex() function directly). Reviewed-by: Olivier Goffart
| * | Fix QT_NO_PROPERTIESJørgen Lind2009-10-291-0/+16
| |/ | | | | | | | | | | | | However, there are some stuff added to qscript that I'm really not sure about. Reviewed-by: tom
* | added missing include for template instantiation (in qDeleteAll)mae2009-10-301-1/+1
| |
* | Merge branch 'kinetic-declarativeui' of ↵Warwick Allison2009-10-304-21/+31
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui Conflicts: src/declarative/qml/qmlcomponentjs.cpp src/declarative/qml/qmlcomponentjs_p.h src/declarative/qml/qmlcomponentjs_p_p.h
| * \ Merge branch '4.6' of ../qt into kinetic-declarativeuiAaron Kennedy2009-10-294-21/+31
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/script/api/qscriptengine.cpp src/script/api/qscriptprogram.cpp src/script/api/qscriptprogram.h src/script/api/qscriptprogram_p.h tests/auto/qscriptengine/tst_qscriptengine.cpp tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp tools/qdoc3/test/qt-inc.qdocconf
| | * Say hello to QScriptProgram :-)Kent Hansen2009-10-287-58/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QScriptProgram encapsulates a Qt Script program (AKA a script). It retains the compiled representation of the script, so that repeated evaluation of the same script becomes faster. An overload of QScriptEngine::evaluate() that takes a QScriptProgram has been added. Reviewed-by: Olivier Goffart
* | | fix headersWarwick Allison2009-10-294-4/+4
|/ /
* | Compile on windowsAaron Kennedy2009-10-261-0/+6
| |
* | Merge branch 'qscriptprogram' of ↵Aaron Kennedy2009-10-267-268/+495
|\ \ | | | | | | | | | | | | | | | | | | | | | git@scm.dev.nokia.troll.no:qt/khansens-qt-script-program into kinetic-declarativeui Manually merged src/declarative/qml/qmlexpression.cpp src/script/api/qscriptengine.cpp src/script/api/qscriptengine.h
| * \ Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into qscriptprogramKent Hansen2009-10-2312-206/+259
| |\ \ | | |/ | | | | | | | | | | | | Conflicts: src/script/api/qscriptengine.cpp tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
| * | Refactor QScriptProgram and related APIKent Hansen2009-10-236-104/+109
| | | | | | | | | | | | | | | | | | | | | Get rid of QScriptEngine::compile(); you pass arguments to the QScriptProgram constructor instead. evaluate() will lazily compile the program the first time it is evaluated, then use the cached, compiled form on subsequent calls.
| * | add getter functions and comparison operators to QScriptProgramKent Hansen2009-10-232-0/+60
| | |
| * | separate the logic shared by evaluate(QString) and evaluate(QScriptProgram)Kent Hansen2009-10-232-68/+60
| | | | | | | | | | | | Introduce helper function evaluateHelper().
| * | delete the executable when the program is destroyedKent Hansen2009-10-231-2/+5
| | |
| * | add compile() and evaluate() functions to public apiKent Hansen2009-10-231-0/+4
| | |
| * | some preliminary work on QScriptProgramKent Hansen2009-10-095-0/+372
| | |
* | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into ↵Michael Brasser2009-10-2510-204/+241
|\ \ \ | | |/ | |/| | | | | | | | | | | | | kinetic-declarativeui Conflicts: tools/qdoc3/cppcodemarker.cpp
| * | Inline QtScript exception helper functionsKent Hansen2009-10-233-18/+18
| | | | | | | | | | | | | | | | | | Makes QScriptValue::toNumber() ~50% faster. Reviewed-by: Olivier Goffart
| * | Avoid calls to public QScriptValue::engine() functionKent Hansen2009-10-233-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to engine() are mostly done for checking that the "source" and "target" engines are the same, but we don't want those checks to slow us down. Use an inline getEngine() function instead. This makes e.g. QScriptValue::call() ~10% faster for a function like "function(a, b) { return a + b; }". Reviewed-by: Olivier Goffart
| * | Speed up QScriptValue creation by avoiding operator= to be calledKent Hansen2009-10-231-32/+18
| | | | | | | | | | | | | | | | | | | | | | | | For non-object values, just return the value immediately; there is no way that the later check (result.isObject()) will be true anyway. This makes qScriptValueFromValue() ~50% faster. Reviewed-by: Olivier Goffart
| * | Bind QScriptValue to engine when the value is created internallyKent Hansen2009-10-231-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | Makes creation+destruction of the QScriptValue a lot faster because it uses the engine's pool of QScriptValuePrivates instead of qMalloc()/qFree(). Reviewed-by: Olivier Goffart
| * | Inline internal property lookup functionKent Hansen2009-10-233-28/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also avoid looking up the object's own properties twice (before we called getOwnPropertySlot() and then getPropertySlot() on the same object). Makes QScriptValue::property() ~20% faster when calling it on an "empty" object. Reviewed-by: Olivier Goffart
| * | Use an inline helper function to check if a QScriptString is validKent Hansen2009-10-233-5/+11
| | | | | | | | | | | | | | | | | | Makes QScriptValue::property() ~10% faster. Reviewed-by: Olivier Goffart
| * | Inline internal QtScript object data() functionsKent Hansen2009-10-232-16/+16
| | | | | | | | | | | | | | | | | | Makes QScriptValue::data() 15% faster. Reviewed-by: Olivier Goffart
| * | Inline internal QtScript object delegate functionsKent Hansen2009-10-234-31/+31
| | | | | | | | | | | | | | | | | | Makes QScriptValue::scriptClass() 20% faster. Reviewed-by: Olivier Goffart
| * | Inline scriptEngineFromExec() functionKent Hansen2009-10-232-15/+21
| | | | | | | | | | | | | | | | | | Makes QScriptContext::engine() 80% faster. Reviewed-by: Olivier Goffart
| * | Inline internal QtScript functions (frameForContext())Kent Hansen2009-10-232-12/+12
| | | | | | | | | | | | | | | | | | Makes QScriptContext::parentContext() 50% faster. Reviewed-by: Olivier Goffart
| * | Inline two internal QtScript functions (contextForFrame() and globalExec())Kent Hansen2009-10-232-17/+17
| | | | | | | | | | | | | | | | | | Makes QScriptEngine::currentContext() 25% faster. Reviewed-by: Olivier Goffart
| * | Use the qsreal type instead of double when working with QtScript numbersKent Hansen2009-10-224-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | The idea is that qsreal can be typedef'ed to float on platforms where it's appropriate. Since the QScriptValue ctor takes a qsreal, we should not convert it to a double internally. Reviewed-by: Olivier Goffart
| * | QtScript: Compatibility with 4.5Olivier Goffart2009-10-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | We must register the same type as they were registered in Qt 4.5 Reported on qt4-preview-feedback mailing list. Reviewed-by: Kent Hansen
* | | During a GC mark the scope chain of QScriptContextsAaron Kennedy2009-10-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that simply being in the scope chain of an existant frame isn't sufficient to be marked. This can lead to a QScriptContext scope chain that contains a JSObject that has been collected. For example, this code: QScriptContext *ctxt = engine->pushContext(); ctxt.pushScope(engine->newObject()); previouslyCreatedFunctionObject.call(); // causes a GC can lead to the object added to the scope chain to have become invalid. This leads to hilarity later on.
* | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into ↵Michael Brasser2009-10-194-3/+19
|\ \ \ | |/ / | | | | | | | | | | | | | | | kinetic-declarativeui Conflicts: tools/qdoc3/cppcodemarker.cpp
| * | Regression fix. Fix the hasUncaughtException() flag in debugger's event.Jedrzej Nowacki2009-10-194-3/+19
| |/ | | | | | | | | | | | | | | | | | | | | The QScriptEngine::hasUncaughtException() flag should be set to true if returning from a JS function was caused by an exception. According to documentation, the flag had to be accessible from the QScriptEngineAgent::functionExit event. New autotest was added. Reviewed-by: Kent Hansen
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into ↵Michael Brasser2009-10-196-27/+38
|\ \ | |/ | | | | | | | | | | | | | | | | kinetic-declarativeui Conflicts: configure.exe src/corelib/animation/qabstractanimation.cpp src/s60installs/qt.iby util/qlalr/cppgenerator.cpp
| * Fix "Warning: #381-D: extra ";" ignored" reported by RVCTJanne Anttila2009-10-081-1/+1
| | | | | | | | Reviewed-by: TrustMe
| * Use JSC::asObject() when we know that the value is an objectKent Hansen2009-10-071-2/+2
| | | | | | | | | | It's faster than calling getObject(), since getObject() will do type checking of the value.
| * Inline QScriptValuePrivate operator new and deleteKent Hansen2009-10-073-18/+18
| | | | | | | | Make allocation faster.
| * Get rid of some superfluous checks in QScriptString::operator==()Kent Hansen2009-10-071-6/+0
| | | | | | | | Reviewed-by: Olivier Goffart
| * implement qHash function for QScriptStringKent Hansen2009-10-073-0/+17
| | | | | | | | Reviewed-by: Olivier Goffart
* | Add toArrayIndex methodAaron Kennedy2009-10-142-0/+8
| |
* | Tweak QScriptDeclarativeClass API to not be so sillyAaron Kennedy2009-10-084-28/+45
| |
* | Merge branch 'kinetic-declarativeui' of ↵Aaron Kennedy2009-10-072-9/+10
|\ \ | |/ | | | | | | | | | | | | git@scm.dev.nokia.troll.no:qt/kinetic into test Conflicts: demos/declarative/samegame/content/samegame.js tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
| * QScriptContext::parentContext: don't skip unessecary framesOlivier Goffart2009-10-061-1/+1
| | | | | | | | | | | | | | | | Calling QScriptValue::call doesn't create a fake frame. We can detect a real fake frame as it does not have a callee. Task-number: QT-2270 Reviewed-by: Kent Hansen
| * implement property getters&setters for setProperty(quint32) overloadKent Hansen2009-10-061-2/+4
| | | | | | | | | | | | It's better that this works rather than asserts. Reviewed-by: Olivier Goffart
| * QtScript: Another crash fix on PowerPCOlivier Goffart2009-10-061-2/+1
| | | | | | | | | | | | | | | | | | | | on 32bit PowerPC, the integer value and the pointer value are not in the same word leading to crash. So blindly casting between them lead to crashes. Use the new Register::withInt instead Reviewed-by: Kent Hansen
| * QScript: do not crash on PowerPCOlivier Goffart2009-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no 'this' register in the global context. The computation of the this register for the global context gives the 'codeBlock' register in the frame header. On Intel processor, a JSValue() is 0x0 when converted to a pointer, but this is not the case on PowerPC (it is 0xfffffff9) so it just crash later when acessing the code block. Solution: special condition for the global context when getting the 'this' object Reviewed-by: Kent Hansen
| * Updated JavaScriptCore from /home/khansen/dev/qtwebkit to ↵Kent Hansen2009-10-051-1/+1
| | | | | | | | | | | | jsc-for-qtscript-4.6-staging-05102009 ( 38c2b17366f24220d9ae0456a7cfe2ac78a9f91c ) Adapt src/script to src/3rdparty/javascriptcore changes
* | Export the active QScriptContext during a callbackAaron Kennedy2009-10-063-2/+59
| | | | | | | | Clearly the API needs work :)