summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalue_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Inline QtScript exception helper functionsKent Hansen2009-10-231-2/+2
| | | | | | Makes QScriptValue::toNumber() ~50% faster. Reviewed-by: Olivier Goffart
* Avoid calls to public QScriptValue::engine() functionKent Hansen2009-10-231-0/+7
| | | | | | | | | | 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
* Inline internal property lookup functionKent Hansen2009-10-231-2/+4
| | | | | | | | | 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 the qsreal type instead of double when working with QtScript numbersKent Hansen2009-10-221-2/+2
| | | | | | | | 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
* Fix "Warning: #381-D: extra ";" ignored" reported by RVCTJanne Anttila2009-10-081-1/+1
| | | | Reviewed-by: TrustMe
* Inline QScriptValuePrivate operator new and deleteKent Hansen2009-10-071-2/+2
| | | | Make allocation faster.
* Fix compilation with winscwSimon Hausmann2009-09-101-3/+3
| | | | | | | | Winscw gets very confused when the name of an enum value is the same as the name of an entire namespace, JSC in this case. Renaming the enum value to JavaScriptCore fixes this. Rubber-stamped-by: Kent
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* don't crash when attempting to access properties of a JS Object that ↵Kent Hansen2009-08-261-0/+6
| | | | | | | | | | | belonged to a deleted script engine When the engine is deleted, the JSValue is invalidated, but the QScriptValue's type will still be QScriptValuePrivate::JSC. Use a new helper function, isObject(), that checks both that the value is of type JSC _and_ that it is valid, before calling JSValue::isObject() (JSValue::isObject() assumes that the value is valid).
* fix performance issue with QScriptValue::propertyFlags()Kent Hansen2009-08-261-0/+2
| | | | | | | Calling QScriptEngine::toStringHandle() is dead slow, so don't call it; use JSC::Identifier directly. This is the same issue as was fixed for setProperty() in commit a8574172dd5e6bc11cf6f69b6fad5a063549e88d.
* fix performance issue with QScriptValue::setProperty()Kent Hansen2009-08-241-0/+2
| | | | | Calling QScriptEngine::toStringHandle() is dead slow, so don't call it; use JSC::Identifier() directly instead.
* add an internal QScriptValue ctor to initialize from d-pointerKent Hansen2009-08-241-3/+1
| | | | | Avoid having to create a dummy QScriptValue (which will have its d_ptr set to 0).
* make some internal qtscript functions inlineKent Hansen2009-08-241-9/+21
| | | | Make it faster.
* compile fix with namespaced Qthjk2009-08-241-2/+2
|
* pass engine pointer to QScriptValuePrivateKent Hansen2009-08-241-1/+1
| | | | Just a little cleanup.
* handle memory management of QScriptValuePrivate in engine if possibleKent Hansen2009-08-241-0/+3
| | | | | | | | | Avoid calling malloc() and free() so often. The premise is that QScriptValue is usually a short-lived type, and only a few QScriptValues exist at a time, so if we cache privates in the engine, QScriptValues will be much faster to create and destroy. Reviewed-by: Olivier Goffart
* fix memory leakKent Hansen2009-08-241-1/+0
| | | | | | Introduced in commit 38e0c07a78fb585e23c4ff8947be737a28b2257c Reviewed-by: Olivier Goffart
* Fix obsolete license headers.Jason McDonald2009-08-211-1/+1
| | | | Reviewed-by: Trust Me
* compile again after mergeHarald Fernengel2009-08-211-1/+1
|
* implement registered script values as a doubly linked listKent Hansen2009-08-201-0/+4
| | | | It's faster.
* use a list to keep track of registered script valuesKent Hansen2009-08-201-46/+3
| | | | Get rid of the hash.
* store the engine's d-pointer in QScriptValuePrivateKent Hansen2009-08-201-28/+27
| | | | | It's the d-pointer that we most frequently want to access, so store it to avoid having to use QScriptEnginePrivate::get() all over the place.
* remove redundant variableKent Hansen2009-08-201-5/+1
|
* invalidate wrapped JSC::JSValue when script engine is deletedKent Hansen2009-08-191-2/+5
| | | | Otherwise we will crash if someone tries to do something with the value.
* Fix QScriptValue::objectId().Jedrzej Nowacki2009-08-191-1/+8
| | | | | | | QScriptValue id were made persistent. It depands on JSC:JSValue JSCell pointer not on QScriptValuePrivate attr. Reviewed-by: Kent Hansen
* Q_DISABLE_COPY were added to QScriptValuePrivate.Jedrzej Nowacki2009-08-191-0/+1
| | | | Reviewed-by: Kent Hansen
* Internal API clean up.Jedrzej Nowacki2009-08-191-4/+0
| | | | | | Static method QScriptValue::initFromJSCValue was removed. Reviewed-by: Kent Hansen
* Clean up.Jedrzej Nowacki2009-08-191-11/+16
| | | | | | | | | Internal API of QScriptValue were cleaned. toPublic() was removed and replaced by standard static Private::get(). All initFromXXX() methods were replaced by overload call of initFrom(). Reviewed-by: Kent Hansen
* Fix potential building problem.Jedrzej Nowacki2009-08-191-7/+2
| | | | | | | | Comparison between pointer and int where removed. According to doc operator-> where created (class QScriptValueAutoRegister suppose to behave as pointer). Reviewed-by: Kent Hansen
* Make simple function getters inlineOlivier Goffart2009-08-121-1/+1
|
* add configure options for (not) building the QtScript moduleKent Hansen2009-08-071-4/+0
| | | | | | | | | | | | | | | | | | -script (default) and -no-script. This means we can get rid of the SCRIPT feature from qfeatures, since it's now handled by the new configure variable. It also allows us to get rid of all the QT_NO_SCRIPT ifdefs from the source files, since qmake isn't going to include those files for compilation when you configure with -no-script. The QtScriptTools module will be disabled if the QtScript module is not built. You'll have to build the old QtScript back-end (will be made available in a separate package), then build the QtScriptTools module yourself. Reviewed-by: Simon Hausmann
* Fix license headersOlivier Goffart2009-07-291-4/+34
|
* Implement QScriptString as a wraper around the JSC::IdentifierOlivier Goffart2009-07-231-1/+2
|
* make QScriptValue::toString() et al work when there's an exceptionKent Hansen2009-07-171-0/+3
| | | | | JSC refuses to call functions when there's an exception that hasn't been dealt with, so save the exception and restore it afterwards.
* Convert the strings or number value to jscvalue when they are used with an ↵Olivier Goffart2009-07-161-1/+1
| | | | | | | engine Also change the stringValue not to be a pointer. This fixes a memory leak.
* Fix autotest checking QScriptValue::objectId method.Jedrzej Nowacki2009-07-091-1/+10
| | | | (QScriptValue::objectId() and QScriptEnigne::objectById)
* Fix engineDelete autotest.Jedrzej Nowacki2009-07-081-2/+54
|
* make more qscriptengine tests runKent Hansen2009-06-241-0/+1
| | | | | Not everything passes but at least nothing asserts anymore, so the test runs to completion.
* make most of the qscriptvalue tests passKent Hansen2009-06-231-0/+2
| | | | call(), construct() etc.
* Import JSC-based Qt Script from Kent's tree.Simon Hausmann2009-06-161-0/+78