summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Reset timeout-checker before evaluating when processEventsInterval is usedKent Hansen2009-10-011-0/+2
| | | | | | | | | | | | | | | | When the timeout-checker was not reset, it could take a while (e.g. 1-2 seconds) before the next timeout occurred, depending on what the tick counter happened to be after the previous evaluate(). When a processEventsInterval of e.g. 100 milliseconds has been specified, we want the timeout to happen much sooner, thus we need to reset the checker. This will cause the first timeout to happen quickly, and then at steady intervals (processEventsInterval ms) after that. The tst_QScriptEngine::processEventsWhileRunning() test was sporadically failing due to this issue. Reviewed-by: Olivier Goffart
* Fix column number provided to QScriptEngineAgentKent Hansen2009-10-011-64/+3
| | | | | | | | Introduced a helper function in our custom source provider, columnNumberFromOffset(), that maps an absolute offset in the source input to a relative column number. Reviewed-by: Jedrzej Nowacki
* Fix linking on windows, building qt in namespaceJarek Kobus2009-09-301-1/+3
| | | | RevBy: Thiago Macieira <thiago.macieira@trolltech.com>
* QScript: fix the way the js stack is advanced.Olivier Goffart2009-09-291-4/+2
| | | | | | | | | It is possible to call QScriptEngine::pushContext before we start any evaluation. We need to change JSC so it doesn't always start at the beginning of the stack. Also fix QScriptContext::pushContext not to waste space between callframes. Reviewed-by: Kent Hansen
* QScript: Fix strange bugs and crashes.Olivier Goffart2009-09-281-7/+10
| | | | | | | | | | I was assuming that the default return value register was always set to 0 for native calls. But this is not the case. So we must ensure this. Also be consistend in the way the stackframe grow and shrink. This expose another bug in the way the call frame is created in JSC Reviewed-by: Kent Hansen
* Update src/3rdparty/javascriptcore and adapt src/script to the changes.Kent Hansen2009-09-241-37/+99
| | | | Reviewed-by: Simon Hausmann
* make sure the engine's currentFrame is in sync when calling out to public APIKent Hansen2009-09-221-0/+2
| | | | | | | The currentFrame pointer is used e.g. by QScriptValue::toString(). It needs to be in sync, otherwise we will crash. Reviewed-by: Olivier Goffart
* use JSObject::inherits() instead of JSObject::isObject()Kent Hansen2009-09-211-2/+2
| | | | | | The functions are identical, but in recent WebKit trunk isObject() doesn't exist anymore. So this renaming is done to prepare for the import of a more recent JavaScriptCore.
* initialize the this-register of the global contextKent Hansen2009-09-181-0/+1
| | | | | | | | | | | QScriptEnginePrivate::thisForContext() relies on the this-register of the global context to contain an invalid JSValue. The default Register constructor (used to initialize the registers of the global context) only invalidates its value when NDEBUG is not defined (but we define it). Therefore, we must explicitly set the this-register to an invalid value. Reviewed-by: Olivier Goffart
* put the this-register calculation into a functionKent Hansen2009-09-181-2/+8
| | | | | | Avoid copy and paste. Reviewed-by: Olivier Goffart
* 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