summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* pass engine pointer to QScriptValuePrivateKent Hansen2009-08-241-2/+1
| | | | Just a little cleanup.
* handle memory management of QScriptValuePrivate in engine if possibleKent Hansen2009-08-241-2/+23
| | | | | | | | | 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 obsolete license headers.Jason McDonald2009-08-211-1/+1
| | | | Reviewed-by: Trust Me
* compile again after mergeHarald Fernengel2009-08-211-17/+1
|
* implement registered script values as a doubly linked listKent Hansen2009-08-201-11/+27
| | | | It's faster.
* use a list to keep track of registered script valuesKent Hansen2009-08-201-26/+16
| | | | Get rid of the hash.
* store the engine's d-pointer in QScriptValuePrivateKent Hansen2009-08-201-5/+3
| | | | | 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.
* provide line number information for innermost call frameKent Hansen2009-08-201-0/+1
| | | | | For the innermost frame, we don't have a returnPC, so use the line number that was last passed to the engine agent.
* make QScriptEngine::objectById() workKent Hansen2009-08-201-7/+2
| | | | | It needs to work even when there is no public QScriptValue that holds a reference to the object.
* Do not pass JSValue per const referenceOlivier Goffart2009-08-191-2/+2
| | | | It is a POD with the size of a pointer
* CleanupsOlivier Goffart2009-08-191-17/+1
| | | | | Remove useless variable. Use QBoolBlocker instread of custom QScript::InEval.
* Fix QScriptValue::objectId().Jedrzej Nowacki2009-08-191-3/+2
| | | | | | | QScriptValue id were made persistent. It depands on JSC:JSValue JSCell pointer not on QScriptValuePrivate attr. Reviewed-by: Kent Hansen
* make QScriptEngine::isEvaluating() work for top-level evaluationKent Hansen2009-08-191-2/+20
| | | | | | Since QScriptEngine::evaluate() doesn't create a new stack frame anymore, we need to use a dedicated variable to keep track of whether the engine is currently evaluating or not.
* Internal API clean up.Jedrzej Nowacki2009-08-191-1/+0
| | | | | | Static method QScriptValue::initFromJSCValue was removed. Reviewed-by: Kent Hansen
* Clean up.Jedrzej Nowacki2009-08-191-6/+9
| | | | | | | | | 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
* adopt same ownership relationship of scriptengine agents as in old back-endKent Hansen2009-08-181-7/+27
| | | | The engine owns its agents, and also knows when they are deleted.
* Clean up.Jedrzej Nowacki2009-08-181-39/+29
| | | | | | | Get rid of conversion functions QScript::qtStringFromJSCUString and QScript::qtStringToJSCUString. Code was moved to cast operators. Reviewed-by: Kent Hansen
* remove unnecessary ifdefsKent Hansen2009-08-171-10/+7
|
* use originalGlobalObject() instead of lexicalGlobalObject() where possibleKent Hansen2009-08-141-2/+2
| | | | | No need to look up the global object via the scope chain since we have a direct pointer to it already.
* Fix compilation on WindowsSimon Hausmann2009-08-141-0/+1
| | | | | | In WebKit/JSC config.h needs to be included first in .cpp files, to among other things make sure that min/max are not defined as macros through windows.h.
* Fix compilation with MSVCSimon Hausmann2009-08-141-10/+10
| | | | | Use the JSC_HOST_CALL annotation for the declaration as well as for the definition of the JSC callback functions.
* Lazily construct the QScriptActivationObjectOlivier Goffart2009-08-131-12/+42
| | | | | | | | | | | We can store flags on the ReturnValueRegister entry in the stackframe header (as native function don't use that) Then when requesting an activation object we can lookup the flags to know if we should create it. This reduce a lot the cost of a native call. Reviewed-by: Kent Hansen
* Make simple function getters inlineOlivier Goffart2009-08-121-14/+0
|
* Set 'this' on the javascript stack for native functionOlivier Goffart2009-08-121-0/+4
| | | | | | | When called from the interpreter, we do not need to create a stack frame, but we need anyway to put the newly created this on the stack. This fixes crash in the test qscriptjstestsuite
* Cantralize the place when we construct the default 'this' object that JSC ↵Olivier Goffart2009-08-121-1/+10
| | | | | | | | doesn't construct. Removes code duplication. This also indirrectly fixes the QMetaObjectWrapperObject where this was missing
* Refactor the way the JS stack are created for native functionOlivier Goffart2009-08-121-37/+63
| | | | | | | | | | The original JavaScriptCore doesn't create stack frame or scope for native function. JSC has been patched to support that. This commit revert our patches to JSC, and implement create the stack frame from QScript Reviewed-by: Kent Hansen
* Move JSC::Debugger's events calls from JSC::evaluate() toJedrzej Nowacki2009-08-121-1/+31
| | | | | | | QSCriptEngine::evaluate() Fix broken behavior after bad integration with 538153994cacc4613aef1eb8ef77e501be7f5a88 commit
* Crash fix.Jedrzej Nowacki2009-08-121-1/+2
| | | | | | Fix GetSetAgent() in tst_qscriptengine. Reviewed-by: TrustMe
* Implement connection between JSC::Debugger and QScriptEngineAgent.Jedrzej Nowacki2009-08-111-8/+9
| | | | | | | | | | | Complete reimplementation of QScriptEngineAgentPrivate. New QScriptEngineAgentPrivate implementation makes conversion from different JSC::Debuger types and events to corresponding QScriptEngineAgent. contextPush and contextPop events are created in QScriptEngine each time contextPush or contextPop is ordered from public API
* get rid of dynamic castsKent Hansen2009-08-101-4/+9
|
* cleanup (hide the use of reinterpret_cast)Kent Hansen2009-08-101-1/+10
| | | | | Introduce a frameForContext() function so we don't have to cast all over the place.
* finish implementation of QScriptEngine::importExtension()Kent Hansen2009-08-101-24/+25
| | | | | Added the properties to the activation object: __extension__, __setupPackage__ and __postInit__.
* 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
* port commit 47c9e7b1b3551ff6dbe71590461a45ae398a9501 from qt/masterKent Hansen2009-08-061-8/+11
|
* make QScriptEngine::newQMetaObject() workKent Hansen2009-08-051-1/+1
|
* don't store QScriptEngine pointer in native function wrappersKent Hansen2009-08-051-3/+3
| | | | | We can infer it from the JSC environment when the function is actually called.
* remove unused codeOlivier Goffart2009-08-041-5/+0
|
* clear abort flag when we start a new evaluateKent Hansen2009-08-041-0/+1
| | | | | Otherwise evaluate() would _always_ return the value previously passed to abortEvaluation(), once a script had been aborted.
* move Global Object to its own fileKent Hansen2009-08-041-132/+1
|
* adapt to commit 014c4c63066fd3920594e6a58b02f314b5c88cdfKent Hansen2009-08-041-6/+7
|
* Do not crash if using popContext() while the current context have not been ↵Olivier Goffart2009-08-041-0/+5
| | | | | | pushed Reviewed-by: Kent Hansen
* Implement QScriptEngine::abortEvaluation()Tor Arne Vestbø2009-08-031-3/+15
| | | | | | We store the abort-state in the TimeoutChecker, since that's where we'll mostly access it, but the abort result is stored in the QScriptEngine's d-pointer.
* Implement QScriptEngine::setProcessEventsInterval()Tor Arne Vestbø2009-08-031-5/+35
| | | | | We're using a wrapper around TimeoutChecker, where we re-implement didTimeout() to call processEvents().
* Remove QScriptContextPrivate, QScriptContext is now a JSC::CallFrameOlivier Goffart2009-07-311-16/+2
| | | | | | | | | | | | | | There will not be instances of QScriptContext anymore. Pointer to QScriptContext are just pointer to JSC::CallFrame This simplifies the code as we do not need to manage the memory for the QScriptContext anymore. It is compatible because it is not possible to create QScriptContext. They were all created by QScriptEngine. QScriptContext constructor is private. Aknoweldged-by: Kent
* Move the declaration on some function into qscriptengine_p.hOlivier Goffart2009-07-311-1/+1
|
* Small Refactoring of QScriptOlivier Goffart2009-07-311-0/+20
| | | | | | | | | - Create a scope (activation object) for the native constructor in QScriptClass - put the isCalledasConstructor in the activation object (so i can clean up the QScriptContext - Remove the code duplication in all native functions. Aknoweldged-by: Kent
* QScriptValueIterator: fix missing non-enumerable valuesTor Arne Vestbø2009-07-311-6/+6
| | | | | | | | | | Added an extra argument to JSObject::getPropertyNames() that specifies if the non-enumerable properties (those with the DontEnum attribute set) should be included or not. Tried looking at using a unsigned as an attribute-inclusion or exclusion filter, but the semantics of either the calling or the callee code would be very strange so I opted out.
* attempt to return something sensible in uncaughtExceptionBacktrace()Kent Hansen2009-07-301-4/+10
| | | | | | | | JSC doesn't provide a way to get the backtrace after the exception has happened (you can only get it at the point it's thrown, by installing a debugger). As a least effort, we try to use the uncaught exception to provide a 1-line backtrace (the filename and linenumber of the innermost call where the exception happened).
* Implement QScriptEngine::pushContext end popContextOlivier Goffart2009-07-301-3/+25
| | | | Reviewed-by: Kent Hansen
* Fix license headersOlivier Goffart2009-07-291-4/+34
|