| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
to the LGPL only.
To do this I ran replace-licenses.zsh $QTDIR/src/script release
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
|
|
|
|
| |
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
|
|
|
|
|
|
|
|
|
| |
QScriptDeclarativeClass is a private, but exported, class used by the
declarativeui module. It is very similar to QScriptClass, but slightly
faster and provides a couple of "backdoor" extension mechanisms used
by declarative.
Reviewed-by: Warwick Allison
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Makes QScriptValue::toNumber() ~50% faster.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Makes QScriptContext::engine() 80% faster.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
| |
Makes QScriptContext::parentContext() 50% faster.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
| |
Makes QScriptEngine::currentContext() 25% faster.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Make allocation faster.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Simon Hausmann
|
|
|
|
|
|
|
| |
The currentFrame pointer is used e.g. by QScriptValue::toString(). It needs to
be in sync, otherwise we will crash.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
| |
Avoid copy and paste.
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Do not convert JSC::Identifier to QString to convert it later to
JSC::Identivier again
Reviewed-by: Kent Hansen
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Make it faster.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
It's faster.
|
|
|
|
| |
Get rid of the hash.
|
|
|
|
|
| |
For the innermost frame, we don't have a returnPC, so use the line
number that was last passed to the engine agent.
|
|
|
|
| |
It is a POD with the size of a pointer
|
|
|
|
|
|
|
| |
QScriptValue id were made persistent. It depands
on JSC:JSValue JSCell pointer not on QScriptValuePrivate attr.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The engine owns its agents, and also knows when they are deleted.
|
|
|
|
|
|
|
| |
Get rid of conversion functions QScript::qtStringFromJSCUString and
QScript::qtStringToJSCUString. Code was moved to cast operators.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Introduce a frameForContext() function so we don't have to cast
all over the place.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
| |
The 'this' value was not correctly set when evaluating
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
JSC requires that the global object is actually a
JSGlobalObject instance, whereas QScriptEngine::setGlobalObject()
allows any object to be set as the global object. The way we
solve this is by proxying from an internal global object to the
custom (user-set) object.
We need to take care that the internal global object is never
actually exposed through our API; a brilliantly named helper
function, toUsableValue(), makes that happen.
Evaluating "var a = 10" with a custom global object doesn't work
yet; the variable always ends up in the internal Global Object.
For variable assignments, JSC appears to bypass the normal
JSObject::put() and instead use
JSGlobalObject::copyGlobals{From,To}(), which means I can't
intercept and proxy the assignments.
This commit enough to get the Context2D example working. There's
another bug with iteration of the built-in Global Object's
properties (non-enumerable properties are always skipped by the
JSC C++ API, whereas with QScriptValueIterator they should not
be), but that's a totally separate issue.
|
|
|
|
|
|
|
|
|
|
|
| |
Install custom ClientData on JSGlobalData instance instead.
Also some cleanups to avoid globalObject et al being accessed
directly.
Killed the proxying scheme employed in setGlobalObject() since it
didn't work; if you stored the original Global Object and replaced
it with another object, then added properties to the new object,
they would show up in the old object, too (because the old object
would always proxy to whatever the current Global Object was).
|