summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation with winscwSimon Hausmann2009-09-101-1/+1
| | | | | | | | 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
* Fix the bactkrace in the QScript DebuggerOlivier Goffart2009-09-091-0/+5
| | | | | | | | | | | | | | | | | | This patch remove the 'fake' context that appears in the debugger backtrace when there is a break point in the global context. This problem never appeared in the tests because the QScriptContext::backtrace has always at least two items in the backtrace as it needs the native 'bt' function to be called. Changed QScriptEnginePrivate::contextForFrame to skip the fake frame (instead of QScriptContext::parentContext). So we never have a QScriptContext pointing to that frame. The changes in QScriptContextInfo are for retreiving the right filename information for the global context when the global context is on top. Reviewed-by: Kent Hansen
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* improve memory management scheme of QScriptString(Private)Kent Hansen2009-09-021-2/+21
| | | | | | | | Get rid of QPointer. Use linked list of privates (like was recently done for QScriptValue). Allocate the private on the stack when we can. Reviewed-by: Olivier Goffart
* doc: Fixed several qdoc errors.Martin Smith2009-09-021-10/+9
| | | | That's the last of them... for now.
* Optimize QScriptClassOlivier Goffart2009-09-021-3/+1
| | | | | | | Do not convert JSC::Identifier to QString to convert it later to JSC::Identivier again Reviewed-by: Kent Hansen
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Make it possible for autotests to check if JIT is enabled or notKent Hansen2009-08-281-0/+11
| | | | | | Currently there are some differences in behavior and availability of information between the interpreter and the JIT. This is now documented as expected failures in the relevant autotests.
* QScriptEngine: Remove one superflous stackframe for native call made by JITOlivier Goffart2009-08-281-1/+7
| | | | | | | JIT does create stackframe while the interperer doesn't. So we would end up with one superflous stackframe Reviewed-by: Kent Hansen
* fix compiler warnings on WindowsKent Hansen2009-08-271-2/+2
| | | | "*/ outside of comment"
* Another memoryleak in QScriptEngineOlivier Goffart2009-08-251-5/+5
| | | | | | | | QScriptValuePrivate released by garbage collector later in ~QScriptEnginePrivate (when destroying the agents) would be added to the freelist and not be released Reviewed-by: Kent Hansen
* Memory leak in QScriptEngineAgent.Olivier Goffart2009-08-251-3/+0
| | | | | | | The documentation of the agent constructor specify that the agant is owned by the engine. Even if the agent is not set to the engine Reviewed-by: Kent Hansen
* Fix memory leak in QScriptEngine::newQObjectOlivier Goffart2009-08-251-8/+6
| | | | | | | Do not reset the delegate and the prototype when reusing existing wrapper. Reviewed-by: Kent Hansen
* make some internal qtscript functions inlineKent Hansen2009-08-241-64/+0
| | | | Make it faster.
* 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.