| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
QString::QString(const char* ) is deprecated static QString::fromXXX
function should be used instead.
Reviewed-by: Gabriel de Dietrich
|
| |
|
|
|
|
|
|
|
|
|
| |
These functions are currently being used by QDeclarative. Needed for
tst_qdeclarativeecmascript.
The semantics are stricter than what the documentation suggests. When
calling qScriptDisconnect(), the connection must have been be made
with qScriptConnect().
Reviewed-by: Olivier
|
| |
|
|
|
|
|
|
|
|
| |
Cache the current global object handle. That value should not change
often, but it is used in several places (for example function call).
The main optimization consists on avoiding calling
v8::Object::GetPrototype inside QSEP::globalObject.
Reviewed-by: Kent Hansen
|
| |
|
|
|
|
| |
Avoid calling QSEP::globalObject twice in QSEP::setGlobalObject method.
Reviewed-by: TrustMe
|
| |
|
|
|
|
|
| |
This was indeed a bug in V8 which has now been reported.
We use the workaround for now, even though it badly
hurts performance (it can be improved by caching the
"length" string in the engine, though).
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The mapping is needed in callbacks that do not allow to pass user data.
The way it is implemented is a bit expensive (it have to be thread
safe), but I hope it is temporary solution until the v8 bug is not
fixed.
http://code.google.com/p/v8/issues/detail?id=1205
|
| |
|
|
| |
Reviewed-by: Olivier
|
| |
|
|
|
|
|
|
| |
And make parts of tst_QScriptExtQObject::wrapOptions() pass
as well as other XFAIL related to hasOwnProperty() not being
implemented for QObject.
Reviewed-by: Jedrzej Nowacki
|
| |
|
|
| |
Fixes tst_QScriptExtQObject::callQtInvokable6
|
| |
|
|
|
| |
Implement the way to get child object.
But we still do not remove them.
|
| |
|
|
|
|
|
|
|
| |
There are five different kinds of QScriptContext(Private)
implementations, for different purposes. This commit adds inline
functions to identify them according the invariants that each one has,
with the intetion of making things more readable.
Reviewed-by: Olivier Goffart
|
| |
|
|
| |
Reviewed-by: Olivier
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit a9eac675b1b44ce0db50614c831ae991725dabdf.
It break some garbage collection tests.
Also moving deallocateAdditionalResources is not a good idea, since
We remove the internal pointers of stuff that still could be garbage
collected.
|
| |
|
|
|
|
| |
The v8 template for QMetaObject lacked a NamedPropertyEnumerator.
Reviewed-by: Olivier Goffart
|
| |
|
|
|
|
|
|
| |
We keep the values of the metamethod we created already.
deallocateAdditionalResources is moved up because it needs to be
called before the Isolate is exited (as it will result on some object
being destroyed, hence out metaMethod hash to be cleaned)
|
| | |
|
| |
|
|
| |
Fixes tst_QScriptExtQObject::enumerate
|
| |
|
|
| |
Better naming, and less indirections
|
| |
|
|
|
|
| |
Passing a string variant to QMetaProperty::write if the property
is an integer would not change the property.
But QtScript expect that a conversion is made anyway ("ciao"->0)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts 31483b3f73567944aefecac35bff97e8092d320a. While it was
correct in the sense that we were really leaking, the plugins, in
practice for now we want to keep them this way.
Olivier pointed out some facts
- It's hard to make QPluginLoader actually support the feature 'unload
plugins during termination';
- Some plugins do not support being unloaded at all, and current
QtScript support them;
- InvalidValue() implementation should be different and will avoid
this issue.
For reference, the issue with QPluginLoader is at
http://bugreports.qt.nokia.com/browse/QTBUG-17458
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When intercepting getter calls for objects made by a QScriptClass, if
there isn't an existing "toString", we return our default
implementation: a function that returns name().
Since we are intercepting before the prototype() can "say" something,
we need to check if it has its own "toString", if so, we don't give
the default one.
We don't want to use Object default toString implementation, that's
why we get the "own property" of the prototype. This also excludes
other possible cases where user sets the toString of the prototype of
a prototype, but this seems to be a rare case. We can support later if
needed.
Reviewed-by: Olivier Goffart
|
| |
|
|
|
|
| |
and construct.
And now, EvaluateScope works with embedded calls.
|
| |
|
|
|
| |
This is how it worked before, and cannot be changed without breaking
binary compatibility
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue was caused by our InvalidValue() (created with
QScriptValue()) leaking some references. In my system this was caused
by two things acting together
- Plugins were not being unloaded properly, so their destructors
were not called;
- Kross::EcmaPlugin when instantiated, created some QScriptValues in
its Private object.
This commit changes availableExtensions() to unload the plugins
loaded, since we only want to get the keys. This avoids the issue for
our tests.
However the problem remains, if we add a simple QScriptValue member to
our test plugins, it will still break, because for importExtension, we
rely on the plugins being destroyed when application terminates, but
they are not, so InvalidValue() leaks again.
I've created a bug to investigate the issue with not destroying
plugins during termination:
http://bugreports.qt.nokia.com/browse/QTBUG-17458
|
| | |
|
| |
|
|
| |
There is a thread that is timing out and will ask for the callback.
|
| |
|
|
|
|
| |
This patch fix a regression in equals, strictlyEquals and lessThan.
These functions internally call QSEP::evaluate which clear exceptions as
a side effect.
|
| |
|
|
|
|
|
|
|
| |
Callbacks scriptLoad and scriptUnload were fully implemented.
There is a behavior change, in V8 port unload event is triggered only
if a script is garbage collected. It means that load / unload may
be asymmetric and that all agents are disconnected from engine
before all scripts are unloaded.
|
| |
|
|
|
|
|
|
|
| |
Fix the tests and implementation to conform with ECMA-262, property
"prototype" of the function and "constructor" of the prototype object
associated with the function.
This makes more tests pass since V8 did the right thing in situations
that we were expecting the wrong.
|
| |
|
|
|
|
|
|
|
|
|
| |
setGlobalObject will actually set the prototype of the global object
The reason we do that is that if we set an interceptor, all the properteis
will be intercepted.
But we have to work around the fact that for v8, the real global
object is the prototype of the global object. So we use the prototype
of the global object everywhere.
|
| |
|
|
|
|
|
|
|
| |
It was really difficult to find correct includes dependency in *.cpp
files because of all forward declarations. This patch creates a
container file (for *_impl_p.h) files that can be included instead.
In the same time I was able to get rid of implementation details from
private headers.
|
| |
|
|
| |
This agent doesn't do anything but at least it pass ownership tests.
|
| |
|
|
|
| |
Problem of v8 linking is solved now. These is not the perfect solution
but it works. CI gate probably would be operational after that patch.
|
| | |
|
| |
|
|
|
|
|
|
| |
The class has been there since 4.6 (http://labs.trolltech.com/blogs/2009/11/23/qtscript-in-46/),
but we don't see a reason to hide it any longer.
Task-number: QTBUG-13229
Reviewed-by: Olivier Goffart
|
| |
|
|
|
|
|
|
|
| |
QScriptEngine::installTranslatorFunctions() now installs
wrapper functions for qsTrId and QT_TRID_NOOP (similar to
the existing ones for tr() and translate()).
Task-number: QTBUG-8454
Reviewed-by: Jedrzej Nowacki
|
| |
|
|
|
|
| |
They are useless and cause warnings in the code.
Reviewed-by: Kent Hansen
|
| |
|
|
| |
Reviewed-by: Kent Hansen
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recompile all the function is necessary to ger the debug opcode that
notifies us when the position changes.
The change in CollectorHeapIterator.h is nessesary to get it work as
Debugger::recompileAllJSFunctions uses LiveObjectIterator,
LiveObjectIterator initialied m_cell to -1 and to ++(*this) in its
constructor. But as m_cell is of type size_t (unsigned) then the
< comparison will always fail as it is an unsigned comparison.
This was already fixed upstream in r54672
Reviewed-by: Jedrzej Nowacki
|
| |
|
|
|
|
|
|
|
|
| |
Use JavaScriptCore's conversion functions rather than our own
(incomplete) implementation.
Specifically, this means daylight saving time is finally
handled correctly on Windows.
Task-number: QTBUG-9770
Reviewed-by: Olivier Goffart
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new internal JS object type,
QScriptStaticScopeObject, that enables the JS compiler to make
more aggressive optimizations of scoped property access.
QScriptStaticScopeObject registers all its properties in a
symbol table that the JS compiler has access to. If the compiler
finds the property in the symbol table, it will generate the
fast index-based op_{get,put}_scoped_var bytecodes, rather than
the dynamic (slow) op_resolve and friends.
If the compiler _doesn't_ find the property in the symbol table,
it infers that it's safe to skip the scope object when later
resolving the property, which will also improve performance
(see op_resolve_skip bytecode).
QScriptStaticScopeObject is only safe to use when all relevant
properties are known at JS compile time; that is, when a
function that has the static scope object in its scope chain is
compiled.
It's up to the user of the class (e.g. QtDeclarative) to ensure
that this constraint is not violated.
The API for constructing QScriptStaticScopeObject instances is
not public; it lives in QScriptDeclarativeClass for now, an
internal class exported for the purpose of QML. The instance is
returned as a QScriptValue and can be manipulated like any
other JS object (e.g. by QScriptValue::setProperty()).
The other part of this commit utilizes QScriptStaticScopeObject
in QtDeclarative in the two major places where it's currently
possible:
1) QML disallows adding properties to the Global Object.
Furthermore, it's not possible for QML IDs and properties to
"shadow" global variables. Hence, a QScriptStaticScopeObject
can be used to hold all the standard ECMA properties, and this
scope object can come _before_ the QML component in the scope
chain. This enables binding expressions and scripts to have
optimized (direct) access to e.g. Math.sin.
2) Imported scripts can have their properties (resulting from
variable declarations ("var" statements) and function
declarations) added to a static scope object. This enables
functions in the script to have optimized (direct) access to
the script's own properties, as well as to global properties
such as Math.
With this change, it's no longer possible to delete properties
of the Global Object, nor delete properties of an imported
script. It's a compromise we make in order to make the
optimization safe.
Task-number: QTBUG-8576
Reviewed-by: Aaron Kennedy
Reviewed-by: Olivier Goffart
Reviewed-by: Jedrzej Nowacki
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For arrays, the conversion would crash if the array was cyclic.
Introduce a set that keeps track of which objects are being
converted, and return an empty list when a cycle is detected.
For other types of objects, the object was previously attempted
to be converted to a primitive, which typically meant you would
get the string representation ("[object Object]"), since most
(practically all) objects can be converted to a string -- not
useful at all.
Change the conversion so it converts the object to a QVariantMap
instead. This was already done for slots that took a QVariantMap
as argument, but only one level deep. Make the conversion recursive,
using the same mechanism as for arrays to detect cycles.
This change also means that you get a meaningful
JS object => QVariant => JS object roundtrip.
It also aligns the behavior with the Qt WebKit bridge.
Update the documentation to describe the new behavior.
The 4.7 changelog will also be updated under "important behavioral
changes".
This change exposed an issue with one of the QML autotests: A JS
object was assigned to a QVariant property, which caused it to be
converted to a string (rather than a QVariantMap) -- just shows
that the previous behavior was unintuitive). Later, this variant
property is compared to another object, the intention being to
compare the _properties_ of the two objects; but because the variant
property contained a string, this would cause the other operand
(object) to be converted to a string as well ("[object Object]"),
causing a meaningless test pass.
Change the test to deserialize both objects using JSON.stringify,
and compare the resulting strings, so that actual
JS object => QVariant(Map) => JS object roundtrip is tested (the
intention).
Task-number: QTBUG-3511
Reviewed-by: Olivier Goffart
|
| |
|
|
|
|
|
|
|
|
| |
Some functions were marked with Q_DECL_IMPORT where they should just be
Q_CORE_EXPORT. The reason is that this macro is expanded to nothing in
case of static builds whereas Q_DECL_IMPORT isn't (it is a dllimport).
That leads the linker to try to import it and it shouldn't.
Task-number: QTBUG-10791
Reviewed-by: gabi
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when possible
JSC::NativeFunctionWrapper is a typedef to either JSC::PrototypeFunction or
JSC::JSFunction depending if we are running JIT or not.
When using JIT, JSC::JSFunction is faster, as it allow JIT to do the native
call dirrectly. The difference is that in that case, the JS stack is not
fully set up so we have to be carefull.
Unfortunately, it is not possible to make FunctionWrapper inherit from
JSC::NativeFunctionWrapper, because JSFunction is slightly bigger, and we
cannot fit in a Cell
Reviewed-by: Kent Hansen
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (71 commits)
Autotest: increase wait time to 3s on Windows to bypass 2s-granularity limitation
Autotest: update to the new values for the locale
do not expand variables in read()'s file name
remove ability to use break() a block outside any loop
don't add -unix to the qmake command line
Increase the timeout for the QNAM getter test to 30 seconds
Remove unstable hosts from the list
qdoc: Output TOC for more class ref pages.
Other fixes to the remote network stresstester
Fix SSL connection problem.
Make sure we don't try URLs that aren't HTTP or HTTPS
Fix menu bar visibility.
Add SSL remote host tests
Split the remote and the local tests in two, in preparation for SSL tests
Add tests for remote hosts
Change the way we calculate the average transfer rates.
Finish renaming
Move these tests to tests/manual.
Add a QNetworkAccessManager stresstest
Add a non-blocking native function too
...
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
qsTr() uses QFileInfo::baseName() to determine the translation
context from a URL.
The problem is that creating a QFileInfo object (and thus a
file engine object), as well as processing the URL to determine
the base name part, is very expensive.
By caching the last translation URL and context, qsTr() becomes
5x faster.
Only the most recent URL is cached, because a script's text will
be translated all at once (as the script is evaluated), so for
scripts with multiple translated strings only the first qsTr()
call will cause a cache miss.
The performance could be improved even further by getting rid of
the QFileInfo dependency altogether; created QTBUG-9939 for that
since it's a more risky change.
Task-number: QTBUG-6908
Reviewed-by: Olivier Goffart
|