From df66e9264debda2ec6838e69e620a54847c71b0a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Apr 2017 21:06:54 -0700 Subject: Silence GCC 7 warnings about implicit fallthrough in Qt code This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen --- src/particles/qquickimageparticle.cpp | 7 +++++++ src/qml/compiler/qv4ssa.cpp | 2 ++ src/qml/jit/qv4isel_masm.cpp | 1 + src/qml/jit/qv4regalloc.cpp | 2 ++ src/qml/jsruntime/qv4runtime.cpp | 2 ++ src/qml/jsruntime/qv4value.cpp | 3 +++ src/quick/items/qquicktextinput.cpp | 1 + src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 2 +- src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp | 1 + src/quick/scenegraph/util/qsgshadersourcebuilder.cpp | 4 +++- 10 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index ccfebddb0e..1919e2ff20 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -1323,6 +1323,7 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node) getState(m_material)->animSheetSize = QSizeF(image.size()); if (m_spriteEngine) m_spriteEngine->setCount(m_count); + Q_FALLTHROUGH(); case Tabled: if (!m_material) m_material = TabledMaterial::createMaterial(); @@ -1355,12 +1356,15 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node) getState(m_material)->colorTable = QSGPlainTexture::fromImage(colortable); fillUniformArrayFromImage(getState(m_material)->sizeTable, sizetable, UNIFORM_ARRAY_SIZE); fillUniformArrayFromImage(getState(m_material)->opacityTable, opacitytable, UNIFORM_ARRAY_SIZE); + Q_FALLTHROUGH(); case Deformable: if (!m_material) m_material = DeformableMaterial::createMaterial(); + Q_FALLTHROUGH(); case Colored: if (!m_material) m_material = ColoredMaterial::createMaterial(); + Q_FALLTHROUGH(); default://Also Simple if (!m_material) m_material = SimpleMaterial::createMaterial(); @@ -1530,6 +1534,7 @@ void QQuickImageParticle::prepareNextFrame(QSGNode **node) if (m_spriteEngine) m_spriteEngine->updateSprites(timeStamp);//fires signals if anim changed spritesUpdate(time); + Q_FALLTHROUGH(); case Tabled: case Deformable: case Colored: @@ -1691,6 +1696,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx) writeTo->animWidth = getState(m_material)->animSheetSize.width(); writeTo->animHeight = getState(m_material)->animSheetSize.height(); } + Q_FALLTHROUGH(); case Tabled: case Deformable: //Initial Rotation @@ -1737,6 +1743,7 @@ void QQuickImageParticle::initialize(int gIdx, int pIdx) getShadowDatum(datum)->autoRotate = autoRotate; } } + Q_FALLTHROUGH(); case Colored: //Color initialization // Particle color diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index cc542e94e7..62e2833089 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2345,6 +2345,7 @@ private: case OpIncrement: case OpDecrement: Q_ASSERT(!"Inplace operators should have been removed!"); + Q_UNREACHABLE(); default: Q_UNIMPLEMENTED(); Q_UNREACHABLE(); @@ -2645,6 +2646,7 @@ private: case OpMul: if (!targetTemp || !knownOk.contains(*targetTemp)) return false; + Q_FALLTHROUGH(); case OpBitAnd: case OpBitOr: case OpBitXor: diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp index 7797f8c8db..4afcd1517f 100644 --- a/src/qml/jit/qv4isel_masm.cpp +++ b/src/qml/jit/qv4isel_masm.cpp @@ -994,6 +994,7 @@ void InstructionSelection::convertTypeToBool(IR::Expr *source, IR: generateRuntimeCall(_as, JITTargetPlatform::ReturnValueRegister, toBoolean, PointerToValue(source)); _as->storeBool(JITTargetPlatform::ReturnValueRegister, target); + Q_FALLTHROUGH(); case IR::VarType: default: Pointer addr = _as->loadAddress(JITTargetPlatform::ScratchRegister, source); diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp index 8eafaaaa8a..d418b050c4 100644 --- a/src/qml/jit/qv4regalloc.cpp +++ b/src/qml/jit/qv4regalloc.cpp @@ -125,6 +125,7 @@ protected: *out << ri->prettyName(); break; } + Q_FALLTHROUGH(); } default: IRPrinterWithPositions::visitTemp(e); @@ -662,6 +663,7 @@ protected: // IRDecoder addUses(rightSource->asTemp(), Use::MustHaveRegister); break; } + Q_FALLTHROUGH(); #endif case OpBitAnd: case OpBitOr: diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 43e99cf768..42bf24d7f3 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -472,6 +472,7 @@ Heap::String *RuntimeHelpers::convertToString(ExecutionEngine *engine, const Val switch (value.type()) { case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); + Q_UNREACHABLE(); case Value::Undefined_Type: return engine->id_undefined()->d(); case Value::Null_Type: @@ -504,6 +505,7 @@ static Heap::String *convert_to_string_add(ExecutionEngine *engine, const Value switch (value.type()) { case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); + Q_UNREACHABLE(); case Value::Undefined_Type: return engine->id_undefined()->d(); case Value::Null_Type: diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index e34ac9c764..f41442df7a 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -113,6 +113,7 @@ double Value::toNumberImpl() const case QV4::Value::Managed_Type: #ifdef V4_BOOTSTRAP Q_UNIMPLEMENTED(); + Q_FALLTHROUGH(); #else if (String *s = stringValue()) return RuntimeHelpers::stringToNumber(s->toQString()); @@ -140,6 +141,7 @@ QString Value::toQStringNoThrow() const switch (type()) { case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); + Q_UNREACHABLE(); case Value::Undefined_Type: return QStringLiteral("undefined"); case Value::Null_Type: @@ -193,6 +195,7 @@ QString Value::toQString() const switch (type()) { case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); + Q_UNREACHABLE(); case Value::Undefined_Type: return QStringLiteral("undefined"); case Value::Null_Type: diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 1edff3ff83..f4a88a1c45 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -3885,6 +3885,7 @@ void QQuickTextInputPrivate::parseInputMask(const QString &maskFields) break; case '\\': escape = true; + Q_FALLTHROUGH(); default: s = true; break; diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index d4324bc489..14f8514289 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -338,7 +338,7 @@ void Updater::visitNode(Node *n) case QSGNode::RenderNodeType: if (m_added) n->renderNodeElement()->root = m_roots.last(); - // Fall through to visit children. + Q_FALLTHROUGH(); // to visit children default: SHADOWNODE_TRAVERSE(n) visitNode(child); break; diff --git a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp index 48ab1aa52f..2b70139b37 100644 --- a/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp +++ b/src/quick/scenegraph/coreapi/qsgshaderrewriter.cpp @@ -133,6 +133,7 @@ Tokenizer::Token Tokenizer::next() pos += 3; return Token_Void; } + Q_FALLTHROUGH(); } case ';': return Token_SemiColon; diff --git a/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp b/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp index d8f92919cb..e134a5d4d3 100644 --- a/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp +++ b/src/quick/scenegraph/util/qsgshadersourcebuilder.cpp @@ -122,6 +122,7 @@ Tokenizer::Token Tokenizer::next() case '*': if (*pos == '/') return Token_MultiLineCommentEnd; + Q_FALLTHROUGH(); case '\n': return Token_NewLine; @@ -129,6 +130,7 @@ Tokenizer::Token Tokenizer::next() case '\r': if (*pos == '\n') return Token_NewLine; + Q_FALLTHROUGH(); case '#': { if (*pos == 'v' && pos[1] == 'e' && pos[2] == 'r' && pos[3] == 's' @@ -177,7 +179,7 @@ Tokenizer::Token Tokenizer::next() pos += 3; return Token_Void; } - // Fall-thru + Q_FALLTHROUGH(); } default: // Identifier... -- cgit v1.2.3 From 85eaae8b4c7e3cf0cf7eb69e3ba0affb820ac08e Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Mon, 3 Apr 2017 15:46:29 +0900 Subject: Fix build without features.qml-interpreter Change-Id: I5f9c00541c27377e8310d32bf045c2860eeffcb4 Reviewed-by: Oswald Buddenhagen --- src/plugins/qmltooling/qmltooling.pro | 29 ++++++++++++++++------------- src/qml/jsruntime/qv4engine.cpp | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro index 8123e2999e..27c51b53c8 100644 --- a/src/plugins/qmltooling/qmltooling.pro +++ b/src/plugins/qmltooling/qmltooling.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs -QT_FOR_CONFIG += qml +QT_FOR_CONFIG += qml-private # Utilities SUBDIRS += \ @@ -10,25 +10,28 @@ SUBDIRS += \ qmldbg_native \ qmldbg_server +qmldbg_native.depends = packetprotocol +qmldbg_server.depends = packetprotocol + qtConfig(qml-network) { SUBDIRS += \ qmldbg_local \ qmldbg_tcp } -# Services -SUBDIRS += \ - qmldbg_debugger \ - qmldbg_profiler \ - qmldbg_messages \ - qmldbg_nativedebugger +qtConfig(qml-interpreter) { + # Services + SUBDIRS += \ + qmldbg_debugger \ + qmldbg_profiler \ + qmldbg_messages \ + qmldbg_nativedebugger -qmldbg_server.depends = packetprotocol -qmldbg_native.depends = packetprotocol -qmldbg_debugger.depends = packetprotocol -qmldbg_profiler.depends = packetprotocol -qmldbg_messages.depends = packetprotocol -qmldbg_nativedebugger.depends = packetprotocol + qmldbg_debugger.depends = packetprotocol + qmldbg_profiler.depends = packetprotocol + qmldbg_messages.depends = packetprotocol + qmldbg_nativedebugger.depends = packetprotocol +} qtHaveModule(quick) { SUBDIRS += \ diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index b5d4e6909b..0b61c6e7e6 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -182,7 +182,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) "solutions for your platform."); } #else - factory = new JIT::ISelFactory; + factory = new JIT::ISelFactory<>; #endif } iselFactory.reset(factory); -- cgit v1.2.3 From 3d05a10e40d4349b01e292dbc297036f8de38049 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 21 Apr 2017 11:57:22 +0200 Subject: Fix GC corruption on macOS and possibly some other OSes Marking mmap'ed memory as unneeded, leads to it being zeroed out on both Linux and Windows. Unfortunately that behavior is not defined by POSIX, so BSD based OSes (and possible others as well) do not do this. We do however rely on getting zeroed out memory whenever we allocate a new Chunk for the garbage collector. To work around this, zero out memory we deallocate on those platforms. Task-number: QTBUG-59278 Task-number: QTBUG-59977 Change-Id: Idde812db8537b63b9e9df7de41620ce0df09b6de Reviewed-by: Simon Hausmann Reviewed-by: Robin Burchell --- src/qml/memory/qv4mm.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 27adfcb517..88912a6678 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -161,6 +161,13 @@ struct MemorySegment { size_t pageSize = WTF::pageSize(); size = (size + pageSize - 1) & ~(pageSize - 1); +#if !defined(Q_OS_LINUX) && !defined(Q_OS_WIN) + // Linux and Windows zero out pages that have been decommitted and get committed again. + // unfortunately that's not true on other OSes (e.g. BSD based ones), so zero out the + // memory before decommit, so that we can be sure that all chunks we allocate will be + // zero initialized. + memset(chunk, 0, size); +#endif pageReservation.decommit(chunk, size); } -- cgit v1.2.3 From 4397eca4e35b7818f5b251722bf07f53692c9379 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 21 Apr 2017 17:16:20 +0200 Subject: Doc: remove reference to no longer existing properties qquickmultipointtoucharea.cpp:170: warning: Can't link to 'horizontalDiameter' qquickmultipointtoucharea.cpp:170: warning: Can't link to 'verticalDiameter' Change-Id: Ib1cf7c634457f1557631d0e6ffdc942917746e04 Reviewed-by: Martin Smith --- src/quick/items/qquickmultipointtoucharea.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp index 62119effb2..1882976e0c 100644 --- a/src/quick/items/qquickmultipointtoucharea.cpp +++ b/src/quick/items/qquickmultipointtoucharea.cpp @@ -176,8 +176,6 @@ void QQuickTouchPoint::setVelocity(const QVector2D &velocity) It is deprecated because a touch point is more correctly modeled as an ellipse, whereas this rectangle represents the outer bounds of the ellipse after \l rotation. - - \sa horizontalDiameter, verticalDiameter */ void QQuickTouchPoint::setArea(const QRectF &area) { -- cgit v1.2.3 From 93bc4113f06dce4c942374d765bef20054cd1f94 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 21 Apr 2017 16:45:56 +0200 Subject: QQuickCanvas: Fix requestAnimationFrame documentation The type here is an int, not a long. QML doesn't have a long type at all, too. Change-Id: I7aea92819f5e2afadddd7b79289a304875d4297f Reviewed-by: Shawn Rutledge --- src/quick/items/context2d/qquickcanvasitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index dab35f2a54..bda3250c16 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -889,7 +889,7 @@ void QQuickCanvasItem::getContext(QQmlV4Function *args) } /*! - \qmlmethod long QtQuick::Canvas::requestAnimationFrame(callback) + \qmlmethod int QtQuick::Canvas::requestAnimationFrame(callback) This function schedules callback to be invoked before composing the Qt Quick scene. @@ -919,7 +919,7 @@ void QQuickCanvasItem::requestAnimationFrame(QQmlV4Function *args) } /*! - \qmlmethod QtQuick::Canvas::cancelRequestAnimationFrame(long handle) + \qmlmethod QtQuick::Canvas::cancelRequestAnimationFrame(int handle) This function will cancel the animation callback referenced by \a handle. */ -- cgit v1.2.3