Merge remote-tracking branch 'origin/stable' into dev
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 24 Jan 2014 15:37:45 +0000 (16:37 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Fri, 24 Jan 2014 17:27:41 +0000 (18:27 +0100)
Conflicts:
src/imports/dialogs/qquickmessagedialog.cpp
src/imports/dialogs/qquickmessagedialog_p.h
src/qml/debugger/qqmlprofilerservice_p.h
src/qml/jsruntime/qv4regexpobject.cpp
tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro

Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d

21 files changed:
1  2 
src/qml/compiler/qv4isel_masm.cpp
src/qml/compiler/qv4regalloc.cpp
src/qml/debugger/qqmlprofilerservice_p.h
src/qml/jsapi/qjsvalue.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4mm.cpp
src/qml/jsruntime/qv4regexpobject.cpp
src/qml/jsruntime/qv4regexpobject_p.h
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlinstruction_p.h
src/qml/qml/qqmlmetatype.cpp
src/qml/qml/qqmlmetatype_p.h
src/quick/items/qquickmultipointtoucharea.cpp
src/quick/items/qquicktext.cpp
src/quick/items/qquickwindow.cpp
src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
src/quick/scenegraph/util/qsgatlastexture.cpp
src/quick/scenegraph/util/qsgtexture.cpp
tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
tests/auto/quick/qquicktext/tst_qquicktext.cpp

Simple merge
Simple merge
@@@ -55,8 -55,7 +55,9 @@@
  
  #include <private/qqmldebugservice_p.h>
  #include <private/qqmlboundsignal_p.h>
 +// this contains QUnifiedTimer
 +#include <private/qabstractanimation_p.h>
+ #include <private/qv4function_p.h>
  
  #include <QtCore/qelapsedtimer.h>
  #include <QtCore/qmetaobject.h>
@@@ -401,8 -254,22 +402,20 @@@ struct QQmlBindingProfiler 
  struct QQmlHandlingSignalProfiler {
      QQmlHandlingSignalProfiler(QQmlBoundSignalExpression *expression)
      {
-         Q_QML_PROFILE(startHandlingSignal(expression->sourceFile(), expression->lineNumber(),
-                                           expression->columnNumber()));
+         if (QQmlProfilerService::enabled) {
 -            QQmlProfilerService *service = QQmlProfilerService::instance;
 -            service->startRange(QQmlProfilerService::HandlingSignal);
+             if (expression->sourceFile().isEmpty()) {
+                 QV4::Function *function = expression->function();
+                 if (function) {
 -                    service->rangeLocation(QQmlProfilerService::HandlingSignal,
++                    Q_QML_PROFILE(startHandlingSignal(
+                             function->sourceFile(), function->compiledFunction->location.line,
 -                            function->compiledFunction->location.column);
++                            function->compiledFunction->location.column));
+                 }
+             } else {
 -                service->rangeLocation(QQmlProfilerService::HandlingSignal,
++                Q_QML_PROFILE(startHandlingSignal(
+                         expression->sourceFile(), expression->lineNumber(),
 -                        expression->columnNumber());
++                        expression->columnNumber()));
+             }
+         }
      }
  
      ~QQmlHandlingSignalProfiler()
Simple merge
Simple merge
Simple merge
@@@ -236,7 -237,16 +236,16 @@@ DEFINE_OBJECT_VTABLE(RegExpCtor)
  RegExpCtor::RegExpCtor(ExecutionContext *scope)
      : FunctionObject(scope, QStringLiteral("RegExp"))
  {
 -    setVTable(&static_vtbl);
 +    setVTable(staticVTable());
+     clearLastMatch();
+ }
+ void RegExpCtor::clearLastMatch()
+ {
+     lastMatch = Primitive::nullValue();
+     lastInput = engine()->newIdentifier(QString());
+     lastMatchStart = 0;
+     lastMatchEnd = 0;
  }
  
  ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData)
@@@ -347,11 -390,10 +390,10 @@@ ReturnedValue RegExpPrototype::method_e
      for (int i = 0; i < len; ++i) {
          int start = matchOffsets[i * 2];
          int end = matchOffsets[i * 2 + 1];
 -        array->arrayData[i].value = (start != -1 && end != -1) ? ctx->engine->newString(s.mid(start, end - start))->asReturnedValue() : Encode::undefined();
 -        array->arrayDataLen = i + 1;
 +        v = (start != -1 && end != -1) ? ctx->engine->newString(s.mid(start, end - start))->asReturnedValue() : Encode::undefined();
 +        array->arrayData->put(i, v);
      }
      array->setArrayLengthUnchecked(len);
      array->memberData[Index_ArrayIndex].value = Primitive::fromInt32(result);
      array->memberData[Index_ArrayInput].value = arg.asReturnedValue();
  
@@@ -395,4 -442,46 +442,46 @@@ ReturnedValue RegExpPrototype::method_c
      return Encode::undefined();
  }
  
 -    ScopedValue result(scope, lastMatch ? lastMatch->getIndexed(lastMatch->arrayLength() - 1) : Encode::undefined());
+ template <int index>
+ ReturnedValue RegExpPrototype::method_get_lastMatch_n(CallContext *ctx)
+ {
+     Scope scope(ctx);
+     ScopedArrayObject lastMatch(scope, static_cast<RegExpCtor*>(ctx->engine->regExpCtor.objectValue())->lastMatch);
+     ScopedValue result(scope, lastMatch ? lastMatch->getIndexed(index) : Encode::undefined());
+     if (result->isUndefined())
+         return ctx->engine->newString(QString())->asReturnedValue();
+     return result.asReturnedValue();
+ }
+ ReturnedValue RegExpPrototype::method_get_lastParen(CallContext *ctx)
+ {
+     Scope scope(ctx);
+     ScopedArrayObject lastMatch(scope, static_cast<RegExpCtor*>(ctx->engine->regExpCtor.objectValue())->lastMatch);
++    ScopedValue result(scope, lastMatch ? lastMatch->getIndexed(lastMatch->getLength() - 1) : Encode::undefined());
+     if (result->isUndefined())
+         return ctx->engine->newString(QString())->asReturnedValue();
+     return result.asReturnedValue();
+ }
+ ReturnedValue RegExpPrototype::method_get_input(CallContext *ctx)
+ {
+     return static_cast<RegExpCtor*>(ctx->engine->regExpCtor.objectValue())->lastInput.asReturnedValue();
+ }
+ ReturnedValue RegExpPrototype::method_get_leftContext(CallContext *ctx)
+ {
+     Scope scope(ctx);
+     Scoped<RegExpCtor> regExpCtor(scope, ctx->engine->regExpCtor);
+     QString lastInput = regExpCtor->lastInput->toQString();
+     return ctx->engine->newString(lastInput.left(regExpCtor->lastMatchStart))->asReturnedValue();
+ }
+ ReturnedValue RegExpPrototype::method_get_rightContext(CallContext *ctx)
+ {
+     Scope scope(ctx);
+     Scoped<RegExpCtor> regExpCtor(scope, ctx->engine->regExpCtor);
+     QString lastInput = regExpCtor->lastInput->toQString();
+     return ctx->engine->newString(lastInput.mid(regExpCtor->lastMatchEnd))->asReturnedValue();
+ }
  QT_END_NAMESPACE
@@@ -104,11 -103,18 +104,18 @@@ protected
  
  struct RegExpCtor: FunctionObject
  {
 -    Q_MANAGED
 +    V4_OBJECT
      RegExpCtor(ExecutionContext *scope);
  
+     SafeValue lastMatch;
+     SafeString lastInput;
+     int lastMatchStart;
+     int lastMatchEnd;
+     void clearLastMatch();
      static ReturnedValue construct(Managed *m, CallData *callData);
      static ReturnedValue call(Managed *that, CallData *callData);
+     static void markObjects(Managed *that, ExecutionEngine *e);
  };
  
  struct RegExpPrototype: RegExpObject
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -16,7 -16,4 +16,8 @@@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE
  OTHER_FILES += \
      data/pixmapCacheTest.qml \
      data/controlFromJS.qml \
-     data/TestImage_2x2.png
 +    data/test.qml \
 +    data/exit.qml \
 +    data/scenegraphTest.qml \
++    data/TestImage_2x2.png \
+     data/signalSourceLocation.qml