Merge remote-tracking branch 'origin/5.4' into dev
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 9 Dec 2014 14:09:20 +0000 (15:09 +0100)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 9 Dec 2014 14:09:26 +0000 (15:09 +0100)
Conflicts:
src/qml/jsruntime/qv4arraydata.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4globalobject.cpp
src/qml/jsruntime/qv4internalclass.cpp
src/quick/items/qquicktext_p.h
src/quick/items/qquicktextedit_p.h
src/quick/items/qquicktextinput_p.h

Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c

31 files changed:
1  2 
src/particles/qquickparticlesystem.cpp
src/particles/qquickv4particledata.cpp
src/qml/debugger/qqmldebugserver.cpp
src/qml/jit/qv4isel_masm.cpp
src/qml/jsapi/qjsengine.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4debugging.cpp
src/qml/jsruntime/qv4globalobject.cpp
src/qml/jsruntime/qv4internalclass.cpp
src/qml/jsruntime/qv4mm.cpp
src/qml/qml/qqmlengine.cpp
src/qml/types/qqmldelegatemodel.cpp
src/quick/items/qquickanimatedsprite.cpp
src/quick/items/qquickborderimage_p.h
src/quick/items/qquickimagebase_p.h
src/quick/items/qquickitem.cpp
src/quick/items/qquicktext_p.h
src/quick/items/qquicktext_p_p.h
src/quick/items/qquicktextedit.cpp
src/quick/items/qquicktextedit_p.h
src/quick/items/qquicktextinput.cpp
src/quick/items/qquicktextinput_p.h
src/quick/items/qquickview.cpp
src/quick/items/qquickwindow.cpp
src/quick/items/qquickwindow.h
src/quick/scenegraph/qsgadaptationlayer.cpp
src/quick/scenegraph/qsgcontext.cpp
src/quick/scenegraph/qsgwindowsrenderloop.cpp
src/quick/scenegraph/util/qsgsimpletexturenode.cpp
tests/auto/qml/qjsengine/tst_qjsengine.cpp
tests/auto/quick/qquickgridview/tst_qquickgridview.cpp

Simple merge
Simple merge
Simple merge
@@@ -62,80 -73,71 +62,74 @@@ struct ExecutionContext : Base 
          Type_CallContext = 0x5,
          Type_QmlContext = 0x6
      };
-     struct EvalCode
-     {
-         Function *function;
-         EvalCode *next;
-     };
  
 -    struct Data : Managed::Data {
 -        Data(ExecutionEngine *engine, ContextType t)
 -            : Managed::Data(engine->executionContextClass)
 -            , type(t)
 -            , strictMode(false)
 -            , engine(engine)
 -            , parent(engine->currentContext())
 -            , outer(0)
 -            , lookups(0)
 -            , compilationUnit(0)
 -            , lineNumber(-1)
 -        {
 -            engine->current = reinterpret_cast<ExecutionContext *>(this);
 -        }
 -        ContextType type;
 -        bool strictMode;
 -
 -        CallData *callData;
 -
 -        ExecutionEngine *engine;
 -        ExecutionContext *parent;
 -        ExecutionContext *outer;
 -        Lookup *lookups;
 -        CompiledData::CompilationUnit *compilationUnit;
 -
 -        int lineNumber;
 +    inline ExecutionContext(ExecutionEngine *engine, ContextType t);
  
 -    };
 -    V4_MANAGED(Managed)
 -    Q_MANAGED_TYPE(ExecutionContext)
 +    ContextType type;
 +    bool strictMode;
 +
 +    CallData *callData;
  
 -    ExecutionContext(ExecutionEngine *engine, ContextType t)
 -        : Managed(engine->executionContextClass)
 +    ExecutionEngine *engine;
 +    ExecutionContext *parent;
 +    ExecutionContext *outer;
 +    Lookup *lookups;
 +    CompiledData::CompilationUnit *compilationUnit;
-     EvalCode *currentEvalCode;
 +
 +    int lineNumber;
 +
 +};
 +
 +struct CallContext : ExecutionContext {
 +    CallContext(ExecutionEngine *engine, ContextType t = Type_SimpleCallContext)
 +        : ExecutionContext(engine, t)
      {
 -        d()->type = t;
 -        d()->strictMode = false;
 -        d()->engine = engine;
 -        d()->parent = engine->currentContext();
 -        d()->outer = 0;
 -        d()->lookups = 0;
 -        d()->compilationUnit = 0;
 -        d()->lineNumber = -1;
 -        engine->current = this;
 +        function = 0;
 +        locals = 0;
 +        activation = 0;
      }
 +    CallContext(ExecutionEngine *engine, QV4::Object *qml, QV4::FunctionObject *function);
  
 -    HeapObject *newCallContext(FunctionObject *f, CallData *callData);
 -    WithContext *newWithContext(Object *with);
 -    CatchContext *newCatchContext(String *exceptionVarName, const ValueRef exceptionValue);
 -    CallContext *newQmlContext(FunctionObject *f, Object *qml);
 +    FunctionObject *function;
 +    int realArgumentCount;
 +    Value *locals;
 +    Object *activation;
 +};
  
 -    void createMutableBinding(String *name, bool deletable);
 +struct GlobalContext : ExecutionContext {
 +    GlobalContext(ExecutionEngine *engine);
 +    Object *global;
 +};
 +
 +struct CatchContext : ExecutionContext {
 +    CatchContext(ExecutionEngine *engine, QV4::String *exceptionVarName, const ValueRef exceptionValue);
 +    StringValue exceptionVarName;
 +    Value exceptionValue;
 +};
 +
 +struct WithContext : ExecutionContext {
 +    WithContext(ExecutionEngine *engine, QV4::Object *with);
 +    Object *withObject;
 +};
  
 -    ReturnedValue throwError(const QV4::ValueRef value);
 -    ReturnedValue throwError(const QString &message);
 -    ReturnedValue throwSyntaxError(const QString &message);
 -    ReturnedValue throwSyntaxError(const QString &message, const QString &fileName, int lineNumber, int column);
 -    ReturnedValue throwTypeError();
 -    ReturnedValue throwTypeError(const QString &message);
 -    ReturnedValue throwReferenceError(const ValueRef value);
 -    ReturnedValue throwReferenceError(const QString &value, const QString &fileName, int lineNumber, int column);
 -    ReturnedValue throwRangeError(const ValueRef value);
 -    ReturnedValue throwRangeError(const QString &message);
 -    ReturnedValue throwURIError(const ValueRef msg);
 -    ReturnedValue throwUnimplemented(const QString &message);
 +
 +}
 +
 +struct Q_QML_EXPORT ExecutionContext : public Managed
 +{
 +    enum {
 +        IsExecutionContext = true
 +    };
 +
 +    V4_MANAGED(ExecutionContext, Managed)
 +    Q_MANAGED_TYPE(ExecutionContext)
 +
 +    Heap::CallContext *newCallContext(FunctionObject *f, CallData *callData);
 +    Heap::WithContext *newWithContext(Object *with);
 +    Heap::CatchContext *newCatchContext(String *exceptionVarName, const ValueRef exceptionValue);
 +    Heap::CallContext *newQmlContext(FunctionObject *f, Object *qml);
 +
 +    void createMutableBinding(String *name, bool deletable);
  
      void setProperty(String *name, const ValueRef value);
      ReturnedValue getProperty(String *name);
      inline CallContext *asCallContext();
      inline const CallContext *asCallContext() const;
  
 -    static void markObjects(Managed *m, ExecutionEngine *e);
 +    static void markObjects(Heap::Base *m, ExecutionEngine *e);
  };
  
-     , currentEvalCode(0)
 +inline
 +Heap::ExecutionContext::ExecutionContext(ExecutionEngine *engine, ContextType t)
 +    : Heap::Base(engine->executionContextClass)
 +    , type(t)
 +    , strictMode(false)
 +    , engine(engine)
 +    , parent(engine->currentContext()->d())
 +    , outer(0)
 +    , lookups(0)
 +    , compilationUnit(0)
 +    , lineNumber(-1)
 +{
 +    // ### GC
 +    engine->current = reinterpret_cast<QV4::ExecutionContext *>(this);
 +}
 +
 +
  struct CallContext : public ExecutionContext
  {
 -    struct Data : ExecutionContext::Data {
 -        Data(ExecutionEngine *engine, ContextType t = Type_SimpleCallContext)
 -            : ExecutionContext::Data(engine, t)
 -        {
 -            function = 0;
 -            locals = 0;
 -            activation = 0;
 -        }
 -        Data(ExecutionEngine *engine, Object *qml, QV4::FunctionObject *function);
 -
 -        FunctionObject *function;
 -        int realArgumentCount;
 -        Value *locals;
 -        Object *activation;
 -    };
 -    V4_MANAGED(ExecutionContext)
 +    V4_MANAGED(CallContext, ExecutionContext)
  
      // formals are in reverse order
 -    String * const *formals() const;
 +    Identifier * const *formals() const;
      unsigned int formalCount() const;
 -    String * const *variables() const;
 +    Identifier * const *variables() const;
      unsigned int variableCount() const;
  
      inline ReturnedValue argument(int i);
@@@ -213,10 -228,8 +206,9 @@@ inline const CallContext *ExecutionCont
  
  inline void ExecutionEngine::pushContext(CallContext *context)
  {
 -    context->d()->parent = current;
 +    Q_ASSERT(current && current->d() && context && context->d());
 +    context->d()->parent = current->d();
      current = context;
-     current->d()->currentEvalCode = 0;
  }
  
  inline ExecutionContext *ExecutionEngine::popContext()
Simple merge
Simple merge
@@@ -421,25 -412,24 +421,24 @@@ InternalClass *InternalClass::frozen(
  
  void InternalClass::destroy()
  {
-     if (!engine)
-         return;
-     engine = 0;
-     propertyTable.~PropertyHash();
-     nameMap.~SharedInternalClassData<Identifier *>();
-     propertyData.~SharedInternalClassData<PropertyAttributes>();
+     QList<InternalClass *> destroyStack;
+     destroyStack.append(this);
  
-     if (m_sealed)
-         m_sealed->destroy();
-     if (m_frozen)
-         m_frozen->destroy();
-     for (QHash<Transition, InternalClass *>::ConstIterator it = transitions.begin(), end = transitions.end();
-          it != end; ++it)
-         it.value()->destroy();
-     transitions.clear();
+     while (!destroyStack.isEmpty()) {
+         InternalClass *next = destroyStack.takeLast();
+         if (!next->engine)
+             continue;
+         next->engine = 0;
+         next->propertyTable.~PropertyHash();
 -        next->nameMap.~SharedInternalClassData<String *>();
++        next->nameMap.~SharedInternalClassData<Identifier *>();
+         next->propertyData.~SharedInternalClassData<PropertyAttributes>();
+         if (next->m_sealed)
+             destroyStack.append(next->m_sealed);
+         if (next->m_frozen)
+             destroyStack.append(next->m_frozen);
+         destroyStack.append(next->transitions.values());
+         next->transitions.clear();
+     }
  }
  
  struct InternalClassPoolVisitor
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -91,8 -91,9 +91,9 @@@ Q_SIGNALS
  
  protected:
      virtual void load();
 -    virtual void componentComplete();
 +    void componentComplete() Q_DECL_OVERRIDE;
      virtual void pixmapChange();
+     void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE;
      QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent);
  
  private Q_SLOTS:
Simple merge
@@@ -233,18 -233,19 +233,19 @@@ Q_SIGNALS
      void renderTypeChanged();
  
  protected:
 -    void mousePressEvent(QMouseEvent *event);
 -    void mouseReleaseEvent(QMouseEvent *event);
 -    virtual void itemChange(ItemChange change, const ItemChangeData &value);
 -    virtual void geometryChanged(const QRectF &newGeometry,
 -                                 const QRectF &oldGeometry);
 -    virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
 -
 -    void updatePolish();
 -
 -    void hoverEnterEvent(QHoverEvent *event);
 -    void hoverMoveEvent(QHoverEvent *event);
 -    void hoverLeaveEvent(QHoverEvent *event);
 +    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE;
 +    void geometryChanged(const QRectF &newGeometry,
 +                                 const QRectF &oldGeometry) Q_DECL_OVERRIDE;
 +    QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE;
 +
 +    void updatePolish() Q_DECL_OVERRIDE;
 +
 +    void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
 +    void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
 +    void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
+     void invalidateFontCaches();
  
  private Q_SLOTS:
      void q_imagesLoaded();
Simple merge
Simple merge
@@@ -214,8 -220,8 +214,8 @@@ public
      QRectF cursorRectangle() const;
  
  #ifndef QT_NO_IM
 -    QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
 +    QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
-     Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
+     Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
  #endif
  
      qreal contentWidth() const;
@@@ -318,30 -330,32 +318,32 @@@ private Q_SLOTS
  private:
      void markDirtyNodesForRange(int start, int end, int charDelta);
      void updateTotalLines();
+     void invalidateFontCaches();
  
  protected:
 -    virtual void geometryChanged(const QRectF &newGeometry,
 -                                 const QRectF &oldGeometry);
 +    void geometryChanged(const QRectF &newGeometry,
 +                         const QRectF &oldGeometry) Q_DECL_OVERRIDE;
  
 -    bool event(QEvent *);
 -    void keyPressEvent(QKeyEvent *);
 -    void keyReleaseEvent(QKeyEvent *);
 -    void focusInEvent(QFocusEvent *event);
 -    void focusOutEvent(QFocusEvent *event);
 +    bool event(QEvent *) Q_DECL_OVERRIDE;
 +    void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
 +    void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE;
 +    void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
 +    void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
  
 -    void hoverEnterEvent(QHoverEvent *event);
 -    void hoverMoveEvent(QHoverEvent *event);
 -    void hoverLeaveEvent(QHoverEvent *event);
 +    void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
 +    void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
 +    void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
  
      // mouse filter?
 -    void mousePressEvent(QMouseEvent *event);
 -    void mouseReleaseEvent(QMouseEvent *event);
 -    void mouseDoubleClickEvent(QMouseEvent *event);
 -    void mouseMoveEvent(QMouseEvent *event);
 +    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
  #ifndef QT_NO_IM
 -    void inputMethodEvent(QInputMethodEvent *e);
 +    void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE;
  #endif
 -    QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData);
 +    QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE;
+     void updatePolish();
  
      friend class QQuickTextUtil;
      friend class QQuickTextDocument;
Simple merge
@@@ -238,12 -245,12 +238,12 @@@ public
      bool hasAcceptableInput() const;
  
  #ifndef QT_NO_IM
 -    QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
 +    QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
-     Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
+     Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
  #endif
  
 -    QRectF boundingRect() const;
 -    QRectF clipRect() const;
 +    QRectF boundingRect() const Q_DECL_OVERRIDE;
 +    QRectF clipRect() const Q_DECL_OVERRIDE;
  
      bool canPaste() const;
  
@@@ -295,30 -304,38 +295,34 @@@ Q_SIGNALS
      void canPasteChanged();
      void canUndoChanged();
      void canRedoChanged();
 -#ifndef QT_NO_IM
      void inputMethodComposingChanged();
 -#endif
      void effectiveHorizontalAlignmentChanged();
      void contentSizeChanged();
 -#ifndef QT_NO_IM
      void inputMethodHintsChanged();
 -#endif
      void renderTypeChanged();
  
+ private:
+     void invalidateFontCaches();
  protected:
 -    virtual void geometryChanged(const QRectF &newGeometry,
 -                                 const QRectF &oldGeometry);
 -
 -    void mousePressEvent(QMouseEvent *event);
 -    void mouseMoveEvent(QMouseEvent *event);
 -    void mouseReleaseEvent(QMouseEvent *event);
 -    void mouseDoubleClickEvent(QMouseEvent *event);
 -    void keyPressEvent(QKeyEvent* ev);
 +    void geometryChanged(const QRectF &newGeometry,
 +                                 const QRectF &oldGeometry) Q_DECL_OVERRIDE;
 +
 +    void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
 +    void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE;
  #ifndef QT_NO_IM
 -    void inputMethodEvent(QInputMethodEvent *);
 +    void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
  #endif
 -    void mouseUngrabEvent();
 -    bool event(QEvent *e);
 -    void focusOutEvent(QFocusEvent *event);
 -    void focusInEvent(QFocusEvent *event);
 -    void timerEvent(QTimerEvent *event);
 -    QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data);
 +    void mouseUngrabEvent() Q_DECL_OVERRIDE;
 +    bool event(QEvent *e) Q_DECL_OVERRIDE;
 +    void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
 +    void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
 +    void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
 +    QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE;
+     void updatePolish();
  
  public Q_SLOTS:
      void selectAll();
Simple merge
Simple merge
Simple merge
Simple merge