| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
JSC has a define in runtime/Collector.cpp that can be enabled
to force garbage collection on every allocation. This can be
useful when investigating GC-related issues.
When the define is enabled, GC callbacks will happen before the
QScriptEngine(Private) is completely initialized, so we need to
initialize some things earlier (nice cleanup, actually), and
add some guards in the marking callback.
All tests pass with define off and on.
Task-number: QTBUG-17781
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed to ensure that the calls into JSC are safe,
e.g. with regards to reentrancy.
I was not able to construct a testcase, but several of our
autotests crash without this change if
COLLECT_ON_EVERY_ALLOCATION is set to 1 in Collector.cpp
(this forces a garbage collection every time an object is
allocated).
Task-number: QTBUG-17815
Reviewed-by: Olivier Goffart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
JSC assumes that the callee is always valid, since JSC::Arguments
is used for JS frames, which must have a callee.
But we use JSC::Arguments for arguments object of
pushContext()-created contexts, and then there is no callee.
But the callee member can't be null, so now we put a fake callee
there and make sure it doesn't bleed up to the public API.
Alternative solution: Add "if (d->callee)" to
JSC::Arguments::markChildren(), then no other changes would be
needed. But we don't want to patch JSC any more.
Non-solution: Subclass JSC::Arguments and reimplement
markChildren() to temporarily set a dummy callee during marking.
Can't be done, as JSC::Arguments::d is private (again, we don't
want to patch JSC).
Task-number: QTBUG-17788
Reviewed-by: Olivier Goffart
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Don't leak ScopeChainNode's
Rename 'plugins\qmldebugging' (work around qmake issues)
Correct the "module not installed" error handling
Flickable uses the flick velocity to determine whether to retain grab
Make addImportPath() work for windows paths starting with lower case
Report any exceptions occurring in WorkerScript javascript code
MouseArea docs - link to onCanceled() from onReleased()
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Create a sub-scope of the global scope chain, rather than a completely new scope
chain. Leaks are difficult to autotest, but an autotest for
QScriptDeclarativeClass::pushCleanContext() was added to ensure its behavior doesn't
regress. To reproduce the leak (prior to this change) use:
while (true) {
QScriptDeclarativeClass::pushCleanContext(&engine);
engine.popContext();
}
Change-Id: I41ac61ea1664da569eb329c8276f2a0bb6d2f1f7
Task-number: QTBUG-17166
Reviewed-by: Martin Jones
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (21 commits)
Fix compilation of QMutableSetIterator::value() with QT_STRICT_ITERATORS
Fix the compilation error that the previous fix didn't fix
Use the thread-default glib context for the DBus connection in the ICD bearer manager.
Check that _POSIX_THREAD_SAFE_FUNCTIONS is larger than zero.
Use an increasing size for the getpwuid_r buffer.
Make sure we use at least 1024 bytes when calling getpwuid_r.
Fix compilation error: symbol is namespaced.
Don't crash when creating backtrace for built-in JS function (2nd try)
Revert "Improved performance of mapFromGlobal/mapToGlobal on X11"
QtDBus: do not wait for reply for AddMatch and RemoveMatch
Make qdbus show all types, even those that it doesn't know about
Doc: Fix the docs saying what the locale codec is used for
Autotest: simple improvements
Autotest: Use QElapsedTimer for timings
directfb: Pixmap creation always premultiplied the alpha even when it is already premultiplied in the image.
Don't crash when BMP color table is broken
Designer: Fix a crash in the Signal-Slot-Editor.
complain about unmatched quotes/parens
use const ref
move multiple inclusion check for feature files to correct location
...
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 147df10403ba280b3f04c1e3d6c4b1cf386abe5d did not quite
fix the issue; other places need the same checks.
When the JIT is enabled, frames for built-in JS host calls
(such as Array.prototype.forEach) are not fully initialized.
In particular, the CodeBlock register of such frames is not
set (see comment in JITCall.cpp).
We need to check if the codeBlock is actually valid before we
start using it.
This fixes the crash(es) but not the problem of actually getting
the arguments for such frames through the API. There's also a
related problem when a QtScript function (newFunction()) is called
as a callback of a built-in JS host function (QTBUG-17287).
These problems will go away once JavaScriptCore is updated to a
more recent version (4.8 at the earliest), since the
native-vs-script frame handling has been unified.
Task-number: QTBUG-17137
Reviewed-by: Olivier Goffart
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the JIT is enabled, NativeFunctionWrapper (used for
built-in functions such as Array.prototype.forEach) inherits
JSFunction, so we must check whether the function is
actually a JS (script) function before we start accessing
script-specific properties.
Task-number: QTBUG-17137
Reviewed-by: Olivier Goffart
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (151 commits)
expect fail for some PinchArea tests on mac
Allow functions to be passed in as values for grouped properties
Fix lineHeight autotests.
Update Docs, Examples and Demos for new CreateObject overloadable
Adding support for group properties in Component::CreateObject()
Update test, versioning is fixed so expect-fail no longer needed
Test failure fixed - remove XFAIL
photoviewer needs QtQuick 1.1 for Image::cache
disable some pincharea tests on mac temporarily
Fix failing test on mac for Qt.application
Fix test breakage for qdeclarativeworkerscript
Fix typo in error message.
Doc fix for lineHeight.
Add support for line spacing in Text element.
Fixing right-to-left text in Text and TextInput
Fix MaximumLineCount in Text and add tests
Ensure simple objects also get the appropriate property cache
Add test for Loader implicitWidth/implicitHeight
Don't crash when appending a null item
Test for passing functions to createObject() for property bindings
...
|
| |\ |
|
| | |
| | |
| | |
| | | |
Task-number: QTBUG-13451
|
| |\ \
| | |/
| |/|
| | |
| | |
| | | |
Conflicts:
src/declarative/graphicsitems/qdeclarativegridview.cpp
src/declarative/graphicsitems/qdeclarativelistview.cpp
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
armv5 complained that the call to QChar::category() was ambiguous,
because there is a version taking an uint, and a version taking ushort as
argument.
Reviewed-by: Christiaan Janssen
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Reviewed-by: Martin Jones
|
| |_|_|/
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If the engine is destroyed before the program, the program
must be invalidated; otherwise the program destructor will
access a stale engine pointer, which can cause a crash
(it crashes on Symbian, but "only" gives a Valgrind warning
on Linux for our autotests).
We need to keep track of all associated programs, just like
we already do for values and strings. This fix follows the
exact same pattern, but uses a QSet to keep the patch minimal.
No new tests, but the evaluateProgram() test runs successfully
on Symbian now, and there are no more Valgrind warnings.
Task-number: QTBUG-16987
Reviewed-by: Olivier Goffart
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Cherry-picked from http://trac.webkit.org/changeset/56370
The old allocator caused QML to crash in MCL (TB10.1, week 1).
Task-number: QTBUG-14293
Reviewed-by: Simon Hausmann
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit 7db489a0de073a2a56fe32d16f1cbe1bebdfd06d.
The change to CollectorHeapIterator.h is not Symbian-specific and
it introduced test failures on all platforms
(tst_QScriptEngineAgent::positionChange_3()).
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Cherry-picked from http://trac.webkit.org/changeset/56370
The old allocator caused QML to crash in MCL (TB10.1, week 1).
Task-number: QTBUG-14293
Reviewed-by: Simon Hausmann
|
| | |
| | |
| | |
| | | |
Reviewed-by: Trust Me
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
Ported from http://trac.webkit.org/changeset/73126.
This gives a ~70% performance improvement for the
SunSpider and V8 benchmarks.
Task-number: QTBUG-15847
Reviewed-by: Simon Hausmann
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Yet another missing API shim.
When converting the QScriptValue to JSC, a JSCell may be allocated,
which can cause the GC to trigger.
If an identifier (JSC::Identifier) is then garbage collected, the
destructor will try to remove itself from the currentIdentifierTable().
Because the API shim was missing, the identifier table was 0.
It's difficult to create a bulletproof test for this case, but the
attached test is a best effort (it crashes on my machine without the
fix).
Task-number: QTBUG-15144
Reviewed-by: Jedrzej Nowacki
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's possible that a class claims to have a property of a given name
(i.e. queryProperty() returns true), but returns an invalid value
for that property. In that case we should silently convert the value
to undefined, otherwise the value may wreak havoc in JS.
This is a regression from Qt 4.5 (pre-JavaScriptCore-based), which
had this check.
Task-number: QTBUG-15079
Reviewed-by: Jedrzej Nowacki
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an exception occurs, we should ignore the result of
JSC::construct() and return the exception value, even if
the exception is not an object.
This makes the behavior match the documentation: "Calling
construct() can cause an exception to occur in the script
engine; in that case, construct() returns the value that
was thrown".
Task-number: QTBUG-14801
Reviewed-by: Jedrzej Nowacki
|
|
|
|
|
|
|
|
| |
This patch reduce time in which QScriptEngine would abort an script
executing multiple long-running native functions.
Task-number: QTBUG-9433
Reviewed-by: Olivier Goffart
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Backport of Jay's patch from https://bugs.webkit.org/show_bug.cgi?id=34349
with minor modifications.
Even though the original patch was rejected upstream and has been
superseded by the patches for https://bugs.webkit.org/show_bug.cgi?id=43185,
those patches are more involved (affecting all platforms), hence
difficult/risky to backport.
Task-number: QTBUG-13361
Reviewed-by: Simon Hausmann
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
| |
Tasks: QTBUG-13271, QTBUG-13212, QTBUG-12321
Reviewer: David Boddie
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The d-pointer is of type JSVariableObjectData*, but
JSVariableObjectData doesn't have a virtual destructor.
Hence we must cast the d-pointer to our subclass when deleting.
In particular, this will ensure that the destructor of the
symbolTable member is called, which will deallocate the table
storage. (For QScriptActivationObject this did not cause a leak
in practice, because its symbolTable is always empty, and JSC's
hash table uses lazy allocation.)
Task-number: QTBUG-12479
Reviewed-by: Olivier Goffart
|
|
|
|
|
| |
Reviewer: David Boddie
Task number: QTBUG-11938
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
in DeclarativeObjectDelegate::put, else we cannot get a proper
backtrace in the debugger.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
| |
JSC::JSValue::asCell asserts if it is not a cell
Reviewed-by: Jedrzej Nowacki
|
|
|
|
|
|
| |
exceptionThrow
Reviewed-by: Jedrzej Nowacki
|
|
|
|
|
|
|
|
| |
There were still a couple of functions that didn't have them. This
could cause said functions to crash if multiple script engines were
being used.
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
|
|
|
|
|
|
|
|
|
|
|
| |
native context
One shouldn't have to call activationObject() or scopeChain() before
calling popScope(); the scope chain should always have 2 items (activation
and global object) before we start popping anything from the internal chain.
Task-number: QTBUG-11020
Reviewed-by: Olivier Goffart
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (71 commits)
Revert "Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp"
Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp
Fixing the wrong QUrl usage
When on Symbian use smaller files.
correctly position glyphs for complex languages
Removed inneccessary QGlyphLayout::offsets initialization.
Fix mirrored characters for RTL text in Symbian
QNAM: Add a code comment related to the cache
tst_QSystemSemaphore::processes fixed for WinCE
tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE
tst_qsharedmemory: create multiple instances of lackey.exe on WinCE
tst_qsharedmemory: fix deployment of lackey.exe for WinCE
fix compilation of tst_sharedmemory on Windows CE
QtScript: regression with instanceof operator for QMetaObject wrappers
examples/widgets/stylesheet fix mainwindow.ui
QStyleSheetStyle: fix memory leak on base style change
QNAM HTTP: Fixed a bug when getting empty files with pipelining
Fix window transparency on Symbian.
Tweak the 'normalGeometry' of the widget before setting it.
Use QDesktopWidget as a status pane observer on Symbian.
...
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/openvg/qpaintengine_vg.cpp
src/script/bridge/qscriptqobject_p.h
tests/auto/bic/tst_bic.cpp
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Tell JavaScriptCore that QMetaObject wrappers can be used as the
second operand to instanceof; this is done by setting the
ImplementsHasInstance flag.
We don't actually have to implement hasInstance() because the
default implementation does the right thing.
Task-number: QTBUG-8366
Reviewed-by: Olivier Goffart
|