Timo Jyrinki has proposed merging 
lp:~timo-jyrinki/kubuntu-packaging/qtdeclarative-opensource-src_reenable_qmlcache
 into lp:~kubuntu-packagers/kubuntu-packaging/qtdeclarative-opensource-src.

Commit message:
* debian/patches/QML-Compilation-unit-caching-and-JIT-changes.patch:
  - [regression] Re-enable the opt-in QML cache patch (LP: #1418060)

Requested reviews:
  Kubuntu Packagers (kubuntu-packagers)
Related bugs:
  Bug #1418060 in qtdeclarative-opensource-src (Ubuntu): "QML compilation cache 
patch needs adaptation for Qt 5.4"
  
https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1418060

For more details, see:
https://code.launchpad.net/~timo-jyrinki/kubuntu-packaging/qtdeclarative-opensource-src_reenable_qmlcache/+merge/250876
-- 
Your team Kubuntu Packagers is requested to review the proposed merge of 
lp:~timo-jyrinki/kubuntu-packaging/qtdeclarative-opensource-src_reenable_qmlcache
 into lp:~kubuntu-packagers/kubuntu-packaging/qtdeclarative-opensource-src.
=== modified file 'debian/changelog'
--- debian/changelog	2015-02-16 12:07:42 +0000
+++ debian/changelog	2015-02-25 06:58:46 +0000
@@ -1,3 +1,10 @@
+qtdeclarative-opensource-src (5.4.0-4ubuntu2) vivid; urgency=medium
+
+  * debian/patches/QML-Compilation-unit-caching-and-JIT-changes.patch:
+    - [regression] Re-enable the opt-in QML cache patch (LP: #1418060)
+
+ -- Timo Jyrinki <[email protected]>  Tue, 24 Feb 2015 14:01:39 +0000
+
 qtdeclarative-opensource-src (5.4.0-4ubuntu1) vivid; urgency=medium
 
   * New upstream release.

=== modified file 'debian/patches/QML-Compilation-unit-caching-and-JIT-changes.patch'
--- debian/patches/QML-Compilation-unit-caching-and-JIT-changes.patch	2015-02-10 12:14:13 +0000
+++ debian/patches/QML-Compilation-unit-caching-and-JIT-changes.patch	2015-02-25 06:58:46 +0000
@@ -1,7 +1,7 @@
-Index: qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/ARMv7Assembler.h
+Index: qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/ARMv7Assembler.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/3rdparty/masm/assembler/ARMv7Assembler.h
-+++ qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/ARMv7Assembler.h
+--- qtdeclarative-opensource-src.5.4.0.orig/src/3rdparty/masm/assembler/ARMv7Assembler.h
++++ qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/ARMv7Assembler.h
 @@ -445,6 +445,12 @@ public:
          ConditionInvalid
      } Condition;
@@ -23,10 +23,10 @@
  
          unsigned debugOffset() { return m_buffer.debugOffset(); }
  
-Index: qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
+Index: qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
-+++ qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
+--- qtdeclarative-opensource-src.5.4.0.orig/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
++++ qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/AbstractMacroAssembler.h
 @@ -486,6 +486,11 @@ public:
              return Call(jump.m_label, Linkable);
          }
@@ -52,10 +52,10 @@
  protected:
      AbstractMacroAssembler()
          : m_randomSource(cryptographicallyRandomNumber())
-Index: qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/AssemblerBuffer.h
+Index: qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/AssemblerBuffer.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/3rdparty/masm/assembler/AssemblerBuffer.h
-+++ qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/AssemblerBuffer.h
+--- qtdeclarative-opensource-src.5.4.0.orig/src/3rdparty/masm/assembler/AssemblerBuffer.h
++++ qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/AssemblerBuffer.h
 @@ -86,6 +86,14 @@ namespace JSC {
                  grow();
          }
@@ -71,10 +71,10 @@
          bool isAligned(int alignment) const
          {
              return !(m_index & (alignment - 1));
-Index: qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/LinkBuffer.h
+Index: qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/LinkBuffer.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/3rdparty/masm/assembler/LinkBuffer.h
-+++ qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/LinkBuffer.h
+--- qtdeclarative-opensource-src.5.4.0.orig/src/3rdparty/masm/assembler/LinkBuffer.h
++++ qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/LinkBuffer.h
 @@ -109,11 +109,13 @@ public:
      
      // These methods are used to link or set values at code generation time.
@@ -90,10 +90,10 @@
      }
      
      void link(Jump jump, CodeLocationLabel label)
-Index: qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/X86Assembler.h
+Index: qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/X86Assembler.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/3rdparty/masm/assembler/X86Assembler.h
-+++ qtdeclarative-opensource-src-5.3.2/src/3rdparty/masm/assembler/X86Assembler.h
+--- qtdeclarative-opensource-src.5.4.0.orig/src/3rdparty/masm/assembler/X86Assembler.h
++++ qtdeclarative-opensource-src.5.4.0/src/3rdparty/masm/assembler/X86Assembler.h
 @@ -101,6 +101,11 @@ public:
          ConditionNC = ConditionAE,
      } Condition;
@@ -114,10 +114,10 @@
  
          PassRefPtr<ExecutableMemoryHandle> executableCopy(JSGlobalData& globalData, void* ownerUID, JITCompilationEffort effort)
          {
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/compiler.pri
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/compiler.pri
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/compiler.pri
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/compiler.pri
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/compiler.pri
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/compiler.pri
 @@ -28,10 +28,10 @@ HEADERS += \
      $$PWD/qv4isel_moth_p.h \
      $$PWD/qv4instr_moth_p.h
@@ -130,14 +130,14 @@
  
 +DEFINES += V4_UNIT_CACHE
  }
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qqmlirbuilder.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qqmlirbuilder.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qqmlirbuilder.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qqmlirbuilder.cpp
-@@ -1512,7 +1512,12 @@ bool IRBuilder::isStatementNodeScript(QQ
- QV4::CompiledData::QmlUnit *QmlUnitGenerator::generate(Document &output)
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qqmlirbuilder.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qqmlirbuilder.cpp
+@@ -1502,7 +1502,12 @@ bool IRBuilder::isStatementNodeScript(QQ
+ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output)
  {
-     QV4::CompiledData::CompilationUnit *compilationUnit = output.javaScriptCompilationUnit;
+     QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit = output.javaScriptCompilationUnit;
 -    QV4::CompiledData::Unit *jsUnit = compilationUnit->createUnitData(&output);
 +    QV4::CompiledData::Unit *jsUnit;
 +    if (!compilationUnit->data)
@@ -148,19 +148,63 @@
      const uint unitSize = jsUnit->unitSize;
  
      const int importSize = sizeof(QV4::CompiledData::Import) * output.imports.count();
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qqmltypecompiler.cpp
+@@ -1527,7 +1532,6 @@ QV4::CompiledData::Unit *QmlUnitGenerato
+     memcpy(data, jsUnit, unitSize);
+     if (jsUnit != compilationUnit->data)
+         free(jsUnit);
+-    jsUnit = 0;
+ 
+     QV4::CompiledData::Unit *qmlUnit = reinterpret_cast<QV4::CompiledData::Unit *>(data);
+     qmlUnit->unitSize = totalSize;
+@@ -1538,8 +1542,22 @@ QV4::CompiledData::Unit *QmlUnitGenerato
+     qmlUnit->offsetToObjects = unitSize + importSize;
+     qmlUnit->nObjects = output.objects.count();
+     qmlUnit->indexOfRootObject = output.indexOfRootObject;
++
++#ifdef V4_UNIT_CACHE
++    if (compilationUnit->isRestored) {
++        qmlUnit->offsetToStringTable = jsUnit->offsetToStringTable;
++        qmlUnit->stringTableSize = jsUnit->stringTableSize;
++    } else {
++        qmlUnit->offsetToStringTable = totalSize - output.jsGenerator.stringTable.sizeOfTableAndData();
++        qmlUnit->stringTableSize = output.jsGenerator.stringTable.stringCount();
++    }
++#else
+     qmlUnit->offsetToStringTable = totalSize - output.jsGenerator.stringTable.sizeOfTableAndData();
+     qmlUnit->stringTableSize = output.jsGenerator.stringTable.stringCount();
++#endif
++
++    // Release
++    jsUnit = 0;
+ 
+     // write imports
+     char *importPtr = data + qmlUnit->offsetToImports;
+@@ -1631,7 +1649,12 @@ QV4::CompiledData::Unit *QmlUnitGenerato
+         }
+     }
+ 
++#ifdef V4_UNIT_CACHE
++    if (!compilationUnit->isRestored)
++        output.jsGenerator.stringTable.serialize(qmlUnit);
++#else
+     output.jsGenerator.stringTable.serialize(qmlUnit);
++#endif
+ 
+     return qmlUnit;
+ }
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qqmltypecompiler.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qqmltypecompiler.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qqmltypecompiler.cpp
-@@ -226,6 +226,7 @@ bool QQmlTypeCompiler::compile()
-         QV4::ExecutionEngine *v4 = engine->v4engine();
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qqmltypecompiler.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qqmltypecompiler.cpp
+@@ -219,6 +219,7 @@ bool QQmlTypeCompiler::compile()
          QScopedPointer<QV4::EvalInstructionSelection> isel(v4->iselFactory->create(engine, v4->executableAllocator, &document->jsModule, &document->jsGenerator));
          isel->setUseFastLookups(false);
+         isel->setUseTypeInference(true);
 +        isel->setEngine(engine);
          document->javaScriptCompilationUnit = isel->compile(/*generated unit data*/false);
      }
  
-@@ -435,6 +436,7 @@ QQmlPropertyCacheCreator::QQmlPropertyCa
+@@ -419,6 +420,7 @@ QQmlPropertyCacheCreator::QQmlPropertyCa
      , qmlObjects(*typeCompiler->qmlObjects())
      , imports(typeCompiler->imports())
      , resolvedTypes(typeCompiler->resolvedTypes())
@@ -168,11 +212,11 @@
  {
  }
  
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qqmltypecompiler_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qqmltypecompiler_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qqmltypecompiler_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qqmltypecompiler_p.h
-@@ -149,6 +149,7 @@ protected:
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qqmltypecompiler_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qqmltypecompiler_p.h
+@@ -140,6 +140,7 @@ protected:
      QHash<int, QQmlCompiledData::TypeReference*> *resolvedTypes;
      QVector<QByteArray> vmeMetaObjects;
      QVector<QQmlPropertyCache*> propertyCaches;
@@ -180,11 +224,11 @@
  };
  
  // "Converts" signal expressions to full-fleged function declarations with
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4compileddata_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4compileddata_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qv4compileddata_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4compileddata_p.h
-@@ -607,6 +607,9 @@ struct Q_QML_PRIVATE_EXPORT CompilationU
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qv4compileddata_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4compileddata_p.h
+@@ -594,6 +594,9 @@ struct Q_QML_PRIVATE_EXPORT CompilationU
      QV4::InternalClass **runtimeClasses;
      QVector<QV4::Function *> runtimeFunctions;
  
@@ -194,39 +238,40 @@
      QV4::Function *linkToEngine(QV4::ExecutionEngine *engine);
      void unlink();
  
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4isel_moth_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_moth_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qv4isel_moth_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4isel_moth_p.h
-@@ -72,6 +72,7 @@ public:
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qv4isel_moth_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_moth_p.h
+@@ -64,9 +64,11 @@ public:
      ~InstructionSelection();
  
      virtual void run(int functionIndex);
 +    virtual QV4::JIT::InstructionSelection* impl() { return NULL; };;
  
  protected:
-     virtual QV4::CompiledData::CompilationUnit *backendCompileStep();
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4isel_p.cpp
+     virtual QQmlRefPointer<CompiledData::CompilationUnit> backendCompileStep();
++    virtual QV4::CompiledData::CompilationUnit* mutableCompilationUnit();
+ 
+     virtual void visitJump(IR::Jump *);
+     virtual void visitCJump(IR::CJump *);
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_p.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qv4isel_p.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4isel_p.cpp
-@@ -1,8 +1,14 @@
--/****************************************************************************
-+/***************************************************************************
- **
- ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qv4isel_p.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_p.cpp
+@@ -3,6 +3,12 @@
+ ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
  ** Contact: http://www.qt-project.org/legal
  **
-+** Copyright (C) 2014 Nomovok Ltd. All rights reserved.
++** Copyright (C) 2015 Nomovok Ltd. All rights reserved.
 +** Contact: [email protected]
 +**
-+** Copyright (C) 2014 Canonical Limited and/or its subsidiary(-ies).
++** Copyright (C) 2015 Canonical Limited and/or its subsidiary(-ies).
 +** Contact: [email protected]
 +**
  ** This file is part of the QtQml module of the Qt Toolkit.
  **
- ** $QT_BEGIN_LICENSE:LGPL$
-@@ -49,6 +55,54 @@
+ ** $QT_BEGIN_LICENSE:LGPL21$
+@@ -41,6 +47,54 @@
  
  #include <QString>
  
@@ -281,7 +326,7 @@
  namespace {
  Q_GLOBAL_STATIC_WITH_ARGS(QTextStream, qout, (stderr, QIODevice::WriteOnly));
  #define qout *qout()
-@@ -57,6 +111,14 @@ Q_GLOBAL_STATIC_WITH_ARGS(QTextStream, q
+@@ -49,6 +103,14 @@ Q_GLOBAL_STATIC_WITH_ARGS(QTextStream, q
  using namespace QV4;
  using namespace QV4::IR;
  
@@ -295,8 +340,8 @@
 +
  EvalInstructionSelection::EvalInstructionSelection(QV4::ExecutableAllocator *execAllocator, Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator)
      : useFastLookups(true)
-     , executableAllocator(execAllocator)
-@@ -71,6 +133,9 @@ EvalInstructionSelection::EvalInstructio
+     , useTypeInference(true)
+@@ -64,6 +126,9 @@ EvalInstructionSelection::EvalInstructio
      Q_ASSERT(execAllocator);
  #endif
      Q_ASSERT(module);
@@ -306,45 +351,45 @@
  }
  
  EvalInstructionSelection::~EvalInstructionSelection()
-@@ -79,17 +144,306 @@ EvalInstructionSelection::~EvalInstructi
+@@ -72,15 +137,307 @@ EvalInstructionSelection::~EvalInstructi
  EvalISelFactory::~EvalISelFactory()
  {}
  
--QV4::CompiledData::CompilationUnit *EvalInstructionSelection::compile(bool generateUnitData)
-+QV4::CompiledData::CompilationUnit *EvalInstructionSelection::runAll(bool generateUnitData)
+-QQmlRefPointer<CompiledData::CompilationUnit> EvalInstructionSelection::compile(bool generateUnitData)
++QQmlRefPointer<QV4::CompiledData::CompilationUnit> EvalInstructionSelection::runAll(bool generateUnitData)
  {
 -    for (int i = 0; i < irModule->functions.size(); ++i)
 -        run(i);
-+    QV4::CompiledData::CompilationUnit *unit;
-+
 +    for (int i = 0; i < irModule->functions.size(); ++i) {
 +        run(i); // Performs the actual compilation
 +    }
 +
-+    unit = backendCompileStep();
++    QQmlRefPointer<QV4::CompiledData::CompilationUnit> result = backendCompileStep();
 +
 +#ifdef V4_UNIT_CACHE
-+    unit->isRestored = false;
++    result->isRestored = false;
 +#endif
  
--    QV4::CompiledData::CompilationUnit *unit = backendCompileStep();
+-    QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = backendCompileStep();
      if (generateUnitData)
-         unit->data = jsGenerator->generateUnit();
-+
-     return unit;
- }
- 
-+QV4::CompiledData::CompilationUnit *EvalInstructionSelection::compile(bool generateUnitData)
++        result->data = jsGenerator->generateUnit();
++
++    return result;
++}
++
++QQmlRefPointer<QV4::CompiledData::CompilationUnit> EvalInstructionSelection::compile(bool generateUnitData)
 +{
 +#ifndef V4_UNIT_CACHE
 +    return runAll(generateUnitData);
 +#else
++    QQmlRefPointer<QV4::CompiledData::CompilationUnit> result(nullptr);
++
 +    // Check if running JIT mode and if cache is enabled
-+    if (!do_cache || !this->impl())
++    if (!do_cache || !this->impl()) {
 +        return runAll(generateUnitData);
++    }
 +
 +    QV4::CompiledData::CompilationUnit *unit;
-+
 +    bool loaded = false;
 +    bool do_save = true;
 +
@@ -433,10 +478,9 @@
 +    // This code has been inspired and influenced by Nomovok's QMLC compiler available at
 +    // https://github.com/qmlc/qmlc. All original Copyrights are maintained for the
 +    // basic code snippets.
-+
 +    if (loaded) {
 +        // Retrieve unit skeleton from isel implementation
-+        unit = backendCompileStep();
++        unit = mutableCompilationUnit();
 +        QV4::JIT::CompilationUnit *tmpUnit = (QV4::JIT::CompilationUnit *) unit;
 +        tmpUnit->codeRefs.resize(irModule->functions.size());
 +
@@ -496,7 +540,7 @@
 +
 +            QV4::IR::Function nullFunction(0, 0, QLatin1String(""));
 +
-+            QV4::JIT::Assembler* as = new QV4::JIT::Assembler(this->impl(), &nullFunction, executableAllocator, 6);
++            QV4::JIT::Assembler* as = new QV4::JIT::Assembler(this->impl(), &nullFunction, executableAllocator);
 +
 +            QList<QV4::JIT::Assembler::CallToLink>& callsToLink = as->callsToLink();
 +            for (int i = 0; i < linkCalls.size(); i++) {
@@ -531,18 +575,22 @@
 +        if (size > 0)
 +            readData((char *)dataPtr, size, stream);
 +
++        result = backendCompileStep();
++        unit = result.data();
++
 +        unit->data = nullptr;
 +        if (irModule->functions.size() > 0)
 +            unit->data = finalUnit;
-+
 +        unit->isRestored = true;
 +    } else {
 +        // Not loading from cache, run all instructions
-+        unit = runAll(false);
++        result = runAll(false);
++        unit = result.data();
 +    }
 +
 +    if ((unit->data == nullptr) && (do_save || generateUnitData))
-+        unit->data = jsGenerator->generateUnit();
+         unit->data = jsGenerator->generateUnit();
+-    return unit;
 +
 +    // Save compilation unit
 +    QV4::JIT::CompilationUnit *jitUnit = (QV4::JIT::CompilationUnit *) unit;
@@ -610,18 +658,17 @@
 +            cacheFile.close();
 +        }
 +    }
-+    return unit;
++
++    return result;
 +#endif
-+}
-+
+ }
+ 
  void IRDecoder::visitMove(IR::Move *s)
- {
-     if (IR::Name *n = s->target->asName()) {
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4isel_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/compiler/qv4isel_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/compiler/qv4isel_p.h
-@@ -56,6 +56,10 @@ class QQmlEnginePrivate;
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qv4isel_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_p.h
+@@ -48,6 +48,10 @@ class QQmlEnginePrivate;
  
  namespace QV4 {
  
@@ -632,15 +679,15 @@
  class ExecutableAllocator;
  struct Function;
  
-@@ -65,6 +69,7 @@ public:
+@@ -57,6 +61,7 @@ public:
      EvalInstructionSelection(QV4::ExecutableAllocator *execAllocator, IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator);
      virtual ~EvalInstructionSelection() = 0;
  
-+    QV4::CompiledData::CompilationUnit *runAll(bool generateUnitData);
-     QV4::CompiledData::CompilationUnit *compile(bool generateUnitData = true);
++    QQmlRefPointer<QV4::CompiledData::CompilationUnit> runAll(bool generateUnitData);
+     QQmlRefPointer<QV4::CompiledData::CompilationUnit> compile(bool generateUnitData = true);
  
      void setUseFastLookups(bool b) { useFastLookups = b; }
-@@ -78,9 +83,11 @@ public:
+@@ -71,10 +76,13 @@ public:
      int registerRegExp(IR::RegExp *regexp) { return jsGenerator->registerRegExp(regexp); }
      int registerJSClass(int count, IR::ExprList *args) { return jsGenerator->registerJSClass(count, args); }
      QV4::Compiler::JSUnitGenerator *jsUnitGenerator() const { return jsGenerator; }
@@ -649,10 +696,12 @@
  protected:
      virtual void run(int functionIndex) = 0;
 +    virtual QV4::JIT::InstructionSelection* impl() = 0;
-     virtual QV4::CompiledData::CompilationUnit *backendCompileStep() = 0;
+     virtual QQmlRefPointer<QV4::CompiledData::CompilationUnit> backendCompileStep() = 0;
++    virtual QV4::CompiledData::CompilationUnit* mutableCompilationUnit() = 0;
  
      bool useFastLookups;
-@@ -88,6 +95,7 @@ protected:
+     bool useTypeInference;
+@@ -82,6 +90,7 @@ protected:
      QV4::Compiler::JSUnitGenerator *jsGenerator;
      QScopedPointer<QV4::Compiler::JSUnitGenerator> ownJSGenerator;
      IR::Module *irModule;
@@ -660,11 +709,11 @@
  };
  
  class Q_QML_PRIVATE_EXPORT EvalISelFactory
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4assembler.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4assembler.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jit/qv4assembler.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4assembler.cpp
-@@ -77,7 +77,10 @@ void CompilationUnit::linkBackendToEngin
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jit/qv4assembler.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4assembler.cpp
+@@ -69,7 +69,10 @@ void CompilationUnit::linkBackendToEngin
  
          QV4::Function *runtimeFunction = new QV4::Function(engine, this, compiledFunction,
                                                             (ReturnedValue (*)(QV4::ExecutionContext *, const uchar *)) codeRefs[i].code().executableAddress());
@@ -676,11 +725,11 @@
      }
  }
  
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4assembler_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4assembler_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jit/qv4assembler_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4assembler_p.h
-@@ -70,6 +70,16 @@ namespace JIT {
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jit/qv4assembler_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4assembler_p.h
+@@ -63,6 +63,16 @@ namespace JIT {
  
  class InstructionSelection;
  
@@ -697,7 +746,7 @@
  struct CompilationUnit : public QV4::CompiledData::CompilationUnit
  {
      virtual ~CompilationUnit();
-@@ -82,6 +92,8 @@ struct CompilationUnit : public QV4::Com
+@@ -75,6 +85,8 @@ struct CompilationUnit : public QV4::Com
  
      QVector<JSC::MacroAssemblerCodeRef> codeRefs;
      QList<QVector<QV4::Primitive> > constantValues;
@@ -706,7 +755,7 @@
  };
  
  struct RelativeCall {
-@@ -1151,7 +1163,12 @@ public:
+@@ -1064,7 +1076,12 @@ public:
              move(TrustedImm64(u.i), ReturnValueRegister);
              move64ToDouble(ReturnValueRegister, target);
  #else
@@ -720,7 +769,7 @@
  #endif
              return target;
          }
-@@ -1241,6 +1258,12 @@ public:
+@@ -1152,6 +1169,12 @@ public:
      Label exceptionReturnLabel;
      IR::BasicBlock * catchBlock;
      QVector<Jump> exceptionPropagationJumps;
@@ -731,12 +780,12 @@
 +    QList<CallToLink>& callsToLink() { return _callsToLink; }
 +
  private:
-     const StackLayout _stackLayout;
+     QScopedPointer<const StackLayout> _stackLayout;
      ConstantTable _constTable;
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4cachedlinkdata_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4cachedlinkdata_p.h
 ===================================================================
 --- /dev/null
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4cachedlinkdata_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4cachedlinkdata_p.h
 @@ -0,0 +1,188 @@
 +/***************************************************************************
 +**
@@ -926,11 +975,11 @@
 +QT_END_NAMESPACE
 +
 +#endif
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4isel_masm.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4isel_masm.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jit/qv4isel_masm.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4isel_masm.cpp
-@@ -51,6 +51,7 @@
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jit/qv4isel_masm.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4isel_masm.cpp
+@@ -43,6 +43,7 @@
  #include "qv4assembler_p.h"
  #include "qv4unop_p.h"
  #include "qv4binop_p.h"
@@ -938,7 +987,7 @@
  
  #include <QtCore/QBuffer>
  
-@@ -147,9 +148,13 @@ JSC::MacroAssemblerCodeRef Assembler::li
+@@ -139,9 +140,13 @@ JSC::MacroAssemblerCodeRef Assembler::li
      JSC::LinkBuffer linkBuffer(dummy, this, 0);
  
      QHash<void*, const char*> functions;
@@ -953,7 +1002,7 @@
      }
  
      foreach (const DataLabelPatch &p, _dataLabelPatches)
-@@ -367,6 +372,25 @@ void InstructionSelection::run(int funct
+@@ -277,6 +282,25 @@ void InstructionSelection::run(int funct
      JSC::MacroAssemblerCodeRef codeRef =_as->link(&dummySize);
      compilationUnit->codeRefs[functionIndex] = codeRef;
  
@@ -979,42 +1028,57 @@
      qSwap(_function, function);
      delete _as;
      _as = oldAssembler;
-@@ -1828,5 +1852,4 @@ void InstructionSelection::visitCJumpEqu
+@@ -300,6 +324,11 @@ QQmlRefPointer<QV4::CompiledData::Compil
+     return result;
+ }
+ 
++QV4::CompiledData::CompilationUnit* InstructionSelection::mutableCompilationUnit()
++{
++    return compilationUnit.data();
++}
++
+ void InstructionSelection::callBuiltinInvalid(IR::Name *func, IR::ExprList *args, IR::Expr *result)
+ {
+     prepareCallData(args, 0);
+@@ -1800,5 +1829,4 @@ void InstructionSelection::visitCJumpEqu
                                  _block, trueBlock, falseBlock);
  }
  
 -
  #endif // ENABLE(ASSEMBLER)
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4isel_masm_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4isel_masm_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jit/qv4isel_masm_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jit/qv4isel_masm_p.h
-@@ -73,6 +73,8 @@ public:
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jit/qv4isel_masm_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jit/qv4isel_masm_p.h
+@@ -65,8 +65,11 @@ public:
      virtual void run(int functionIndex);
  
      const void *addConstantTable(QVector<QV4::Primitive> *values);
 +
 +    virtual InstructionSelection* impl() { return this; };
  protected:
-     virtual QV4::CompiledData::CompilationUnit *backendCompileStep();
+     virtual QQmlRefPointer<QV4::CompiledData::CompilationUnit> backendCompileStep();
++    virtual QV4::CompiledData::CompilationUnit* mutableCompilationUnit();
  
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jsruntime/qv4functionobject.cpp
+     virtual void callBuiltinInvalid(IR::Name *func, IR::ExprList *args, IR::Expr *result);
+     virtual void callBuiltinTypeofMember(IR::Expr *base, const QString &name, IR::Expr *result);
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jsruntime/qv4functionobject.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jsruntime/qv4functionobject.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jsruntime/qv4functionobject.cpp
-@@ -234,6 +234,7 @@ ReturnedValue FunctionCtor::construct(Ma
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jsruntime/qv4functionobject.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jsruntime/qv4functionobject.cpp
+@@ -226,6 +226,7 @@ ReturnedValue FunctionCtor::construct(Ma
  
      QV4::Compiler::JSUnitGenerator jsGenerator(&module);
      QScopedPointer<EvalInstructionSelection> isel(v4->iselFactory->create(QQmlEnginePrivate::get(v4), v4->executableAllocator, &module, &jsGenerator));
 +    isel->setEngine(QQmlEnginePrivate::get(v4));
-     QV4::CompiledData::CompilationUnit *compilationUnit = isel->compile();
+     QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit = isel->compile();
      QV4::Function *vmf = compilationUnit->linkToEngine(v4);
  
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jsruntime/qv4qobjectwrapper.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jsruntime/qv4qobjectwrapper.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jsruntime/qv4qobjectwrapper.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jsruntime/qv4qobjectwrapper.cpp
-@@ -628,6 +628,7 @@ ReturnedValue QObjectWrapper::getPropert
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jsruntime/qv4qobjectwrapper.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jsruntime/qv4qobjectwrapper.cpp
+@@ -629,6 +629,7 @@ ReturnedValue QObjectWrapper::getPropert
      QQmlPropertyCache *cache = ddata->propertyCache;
      Q_ASSERT(cache);
      QQmlPropertyData *property = cache->property(propertyIndex);
@@ -1022,19 +1086,19 @@
      Q_ASSERT(property); // We resolved this property earlier, so it better exist!
      return getProperty(object, ctx, property, captureRequired);
  }
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/jsruntime/qv4script.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/jsruntime/qv4script.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/jsruntime/qv4script.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/jsruntime/qv4script.cpp
-@@ -272,6 +272,7 @@ void Script::parse()
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/jsruntime/qv4script.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/jsruntime/qv4script.cpp
+@@ -259,6 +259,7 @@ void Script::parse()
          QScopedPointer<EvalInstructionSelection> isel(v4->iselFactory->create(QQmlEnginePrivate::get(v4), v4->executableAllocator, &module, &jsGenerator));
          if (inheritContext)
              isel->setUseFastLookups(false);
 +        isel->setEngine(QQmlEnginePrivate::get(v4));
-         QV4::CompiledData::CompilationUnit *compilationUnit = isel->compile();
+         QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit = isel->compile();
          vmFunction = compilationUnit->linkToEngine(v4);
-         ScopedValue holder(valueScope, new (v4->memoryManager) CompilationUnitHolder(v4, compilationUnit));
-@@ -394,6 +395,7 @@ QV4::CompiledData::CompilationUnit *Scri
+         ScopedObject holder(valueScope, v4->memoryManager->alloc<CompilationUnitHolder>(v4, compilationUnit));
+@@ -360,6 +361,7 @@ QQmlRefPointer<QV4::CompiledData::Compil
  
      QScopedPointer<EvalInstructionSelection> isel(engine->iselFactory->create(QQmlEnginePrivate::get(engine), engine->executableAllocator, module, unitGenerator));
      isel->setUseFastLookups(false);
@@ -1042,11 +1106,11 @@
      return isel->compile(/*generate unit data*/false);
  }
  
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/qml/qqmlengine.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/qml/qqmlengine.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/qml/qqmlengine.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/qml/qqmlengine.cpp
-@@ -561,7 +561,8 @@ QQmlEnginePrivate::QQmlEnginePrivate(QQm
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/qml/qqmlengine.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/qml/qqmlengine.cpp
+@@ -559,7 +559,8 @@ QQmlEnginePrivate::QQmlEnginePrivate(QQm
    activeObjectCreator(0),
    networkAccessManager(0), networkAccessManagerFactory(0), urlInterceptor(0),
    scarceResourcesRefCount(0), typeLoader(e), importDatabase(e), uniqueId(1),
@@ -1056,12 +1120,12 @@
  {
      useNewCompiler = true;
  }
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/qml/qqmlengine_p.h
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/qml/qqmlengine_p.h
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/qml/qqmlengine_p.h
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/qml/qqmlengine_p.h
-@@ -270,6 +270,8 @@ public:
- 
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/qml/qqmlengine_p.h
++++ qtdeclarative-opensource-src.5.4.0/src/qml/qml/qqmlengine_p.h
+@@ -263,6 +263,8 @@ public:
+     mutable QMutex networkAccessManagerMutex;
      mutable QMutex mutex;
  
 +    int qmlCacheValid;
@@ -1069,11 +1133,11 @@
  private:
      // Locker locks the QQmlEnginePrivate data structures for read and write, if necessary.
      // Currently, locking is only necessary if the threaded loader is running concurrently.  If it is
-Index: qtdeclarative-opensource-src-5.3.2/src/qml/qml/qqmljavascriptexpression.cpp
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/qml/qqmljavascriptexpression.cpp
 ===================================================================
---- qtdeclarative-opensource-src-5.3.2.orig/src/qml/qml/qqmljavascriptexpression.cpp
-+++ qtdeclarative-opensource-src-5.3.2/src/qml/qml/qqmljavascriptexpression.cpp
-@@ -335,6 +335,7 @@ QV4::ReturnedValue QQmlJavaScriptExpress
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/qml/qqmljavascriptexpression.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/qml/qqmljavascriptexpression.cpp
+@@ -327,6 +327,7 @@ QV4::ReturnedValue QQmlJavaScriptExpress
  
      QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, qmlScope));
      QV4::Script script(v4, qmlScopeObject, code, filename, line);
@@ -1081,3 +1145,19 @@
      QV4::ScopedValue result(scope);
      script.parse();
      if (!v4->hasException)
+Index: qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_moth.cpp
+===================================================================
+--- qtdeclarative-opensource-src.5.4.0.orig/src/qml/compiler/qv4isel_moth.cpp
++++ qtdeclarative-opensource-src.5.4.0/src/qml/compiler/qv4isel_moth.cpp
+@@ -457,6 +457,11 @@ QQmlRefPointer<QV4::CompiledData::Compil
+     return result;
+ }
+ 
++QV4::CompiledData::CompilationUnit* InstructionSelection::mutableCompilationUnit()
++{
++    return compilationUnit.data();
++}
++
+ void InstructionSelection::callValue(IR::Expr *value, IR::ExprList *args, IR::Expr *result)
+ {
+     Instruction::CallValue call;

=== modified file 'debian/patches/series'
--- debian/patches/series	2015-02-10 12:14:13 +0000
+++ debian/patches/series	2015-02-25 06:58:46 +0000
@@ -4,4 +4,4 @@
 ppc64el.patch
 Support-RFC2822Date-date-format-similar-to-V8.patch
 Fix-regression-where-QQuickScreenAttached-overwrites.patch
-#QML-Compilation-unit-caching-and-JIT-changes.patch
+QML-Compilation-unit-caching-and-JIT-changes.patch

-- 
kubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/kubuntu-devel

Reply via email to