| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This is some other places where Qt native function may expect to have
their own context
|
|
|
|
|
|
|
|
| |
doesn't construct.
Removes code duplication.
This also indirrectly fixes the QMetaObjectWrapperObject where this was missing
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qtscript-jsc-backend
Conflicts:
configure
src/script/qscriptarray_p.h
src/script/qscriptasm.cpp
src/script/qscriptasm_p.h
src/script/qscriptbuffer_p.h
src/script/qscriptclass.cpp
src/script/qscriptclassdata.cpp
src/script/qscriptclassdata_p.h
src/script/qscriptclassinfo_p.h
src/script/qscriptclasspropertyiterator_p.h
src/script/qscriptcompiler.cpp
src/script/qscriptcompiler_p.h
src/script/qscriptcontext_p.cpp
src/script/qscriptcontext_p.h
src/script/qscriptcontextfwd_p.h
src/script/qscriptcontextinfo_p.h
src/script/qscriptecmaarray.cpp
src/script/qscriptecmaarray_p.h
src/script/qscriptecmaboolean.cpp
src/script/qscriptecmaboolean_p.h
src/script/qscriptecmacore.cpp
src/script/qscriptecmacore_p.h
src/script/qscriptecmadate.cpp
src/script/qscriptecmadate_p.h
src/script/qscriptecmaerror.cpp
src/script/qscriptecmaerror_p.h
src/script/qscriptecmafunction.cpp
src/script/qscriptecmafunction_p.h
src/script/qscriptecmaglobal.cpp
src/script/qscriptecmaglobal_p.h
src/script/qscriptecmamath.cpp
src/script/qscriptecmamath_p.h
src/script/qscriptecmanumber.cpp
src/script/qscriptecmanumber_p.h
src/script/qscriptecmaobject.cpp
src/script/qscriptecmaobject_p.h
src/script/qscriptecmaregexp.cpp
src/script/qscriptecmaregexp_p.h
src/script/qscriptecmastring.cpp
src/script/qscriptecmastring_p.h
src/script/qscriptengine.cpp
src/script/qscriptengine_p.cpp
src/script/qscriptengine_p.h
src/script/qscriptengineagent_p.h
src/script/qscriptenginefwd_p.h
src/script/qscriptextenumeration.cpp
src/script/qscriptextenumeration_p.h
src/script/qscriptextqobject.cpp
src/script/qscriptextqobject_p.h
src/script/qscriptextvariant.cpp
src/script/qscriptextvariant_p.h
src/script/qscriptfunction.cpp
src/script/qscriptfunction_p.h
src/script/qscriptgc_p.h
src/script/qscriptglobals_p.h
src/script/qscriptmember_p.h
src/script/qscriptnameid_p.h
src/script/qscriptnodepool_p.h
src/script/qscriptobject_p.h
src/script/qscriptobjectfwd_p.h
src/script/qscriptprettypretty.cpp
src/script/qscriptprettypretty_p.h
src/script/qscriptsyntaxcheckresult_p.h
src/script/qscriptvalue.cpp
src/script/qscriptvalue_p.h
src/script/qscriptvaluefwd_p.h
src/script/qscriptvalueimpl.cpp
src/script/qscriptvalueimpl_p.h
src/script/qscriptvalueimplfwd_p.h
src/script/qscriptvalueiteratorimpl.cpp
src/script/qscriptvalueiteratorimpl_p.h
|
|
|
|
|
|
|
|
|
|
| |
b62ab93d001d2f3238e24faa133720cb877e3023 commit.
Workaround for multiple decorators problem. FunctionWrapper and
NativeConstrWrapper needs access to original result value (from native
function call). Solution was to move part of the NativeConstrWrapper's
functionality (functionExit debugger's event) to
FunctionWrapper::proxyConstruct.
|
|
|
|
|
| |
Look up the property as a normal JS property before falling back
to the dynamic query mechanism. This is the documented behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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
|
| |
|
| |
|
|
|
|
| |
Behave like the old back-end.
|
|
|
|
| |
Follow-up to commit 520378cfedd63544a9689687256d2c89352ee561
|
|
|
|
|
|
|
|
| |
getPropertyNames() now uses a flag to specify which property should be
filtered. This flag should be used by all javascript objects.
This patch fixes the changes introduced by
e520df1f8678bd59adb341fb586f008a7de17fe8
|
| |
|
| |
|
|
|
|
|
| |
We can infer it from the JSC environment when the function is
actually called.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
so native function that would call
engine->evaluate("var b = 'foo');
would not change the global object.
The change in qscriptengine.cpp makes sure that the correct scope is
used for the execution of QScriptEngine::evaluate.
The changes in qscriptfunction.cpp push a new scope for native function
calls. We might want to move that into QScriptContext later
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).
|
|
|
|
|
|
|
|
|
| |
Use the exception from JSC::exec instead of
QScriptEngin::uncaughtException.
A few more tests are passing for qscriptvalue and qscriptqobject.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
| |
Fix tst_QScriptExtQObject::objectDeleted(), the exception generated
in the JSC script engine needs to be stored in uncaughtException of
QScriptEngine.
Reviewed-by: Kent Hansen
|
|
|
|
|
| |
No need to expose the fact that we go via the Global Object
to get an engine pointer.
|
|
|
|
|
|
|
|
| |
For matching the regular expression, the algorithm of JSCore is used
instead of QRegExp, this is done to be consistent with the rest
of ecmascript.
Reviewed-by: Kent Hansen
|
|
|
|
| |
getter
|
| |
|
|
|
|
|
| |
Don't add method names, only signatures.
Respect the SkipMethodsInEnumeration option.
|
| |
|
|
|
|
|
| |
Doesn't actually replace the global object, but rather has the
standard global object act as a proxy to the custom one.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
The argument conversion logic checks for exceptions after
attempting to convert each argument; this requires that there
is initially no exception, otherwise it's going to bail out
even if the conversion itself succeeded.
|
|
|
|
|
| |
Caller is responsible for calling marked() before mark(),
otherwise you might get infinite recursion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With an object created by QScriptEngine::newObject(), it should
be possible to call QScriptValue::setClass() to dynamically
change the behavior of that object. Similarly, it should be
possible to promote plain script objects to QObject (QVariant)
wrappers by calling the overload of QScriptEngine::newQObject()
(newVariant()) that takes a script object as the first argument.
This commit implements this capability.
The premise is the (internal) QScriptObject class, which inherits
JSC::JSObject. It reimplements all the methods for getting/setting
properties etc. Then there's a level of indirection to facilitate
dynamic change of the class: Each QScriptObject can have a
delegate associated with it that will handle operations on the
object. By default there is no delegate, so the object behaves as
a normal JS object, as you expect. However, once a delegate is set
(e.g., when QScriptValue::setScriptClass() is called),
QScriptObject will give the delegate the chance to handle the
object operation.
In addition to a delegate implementation for QScriptClass-based
objects, there are also delegates for QObject and QVariant
wrappers. These replace the QObjectWrapperObject and
QVariantWrapperObject classes.
|
|
|
|
| |
Follow behavior of old back-end. Makes qscriptable test pass.
|
|
|
|
|
| |
Makes sure that new stack frame is set up if the function is
native, and all that.
|