2010-06-25 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jun 2010 19:57:02 +0000 (19:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jun 2010 19:57:02 +0000 (19:57 +0000)
        Reviewed by Simon Hausmann.

        Introduce to QtScript benchmarks.

        The QtScript performance should be tested regularly. The patch introduces
        micro benchmarks for existing API.

        [Qt] Performance of the QtScript API is not tested.
        https://bugs.webkit.org/show_bug.cgi?id=40911

        * WebKit.pro:
2010-06-25  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>

        Reviewed by Simon Hausmann.

        Introduce QtScript benchmarks.

        The QtScript performance should be tested regularly. The patch introduces
        micro benchmarks for existing API.

        [Qt] Performance of the QtScript API is not tested.
        https://bugs.webkit.org/show_bug.cgi?id=40911

        * qt/benchmarks/benchmarks.pri: Copied from JavaScriptCore/qt/tests/tests.pri.
        * qt/benchmarks/benchmarks.pro: Added.
        * qt/benchmarks/qscriptengine/qscriptengine.pro: Added.
        * qt/benchmarks/qscriptengine/tst_qscriptengine.cpp: Added.
        (tst_QScriptEngine::checkSyntax_data):
        (tst_QScriptEngine::checkSyntax):
        (tst_QScriptEngine::constructor):
        (tst_QScriptEngine::evaluateString_data):
        (tst_QScriptEngine::evaluateString):
        (tst_QScriptEngine::evaluateProgram_data):
        (tst_QScriptEngine::evaluateProgram):
        (tst_QScriptEngine::newObject):
        (tst_QScriptEngine::nullValue):
        (tst_QScriptEngine::undefinedValue):
        (tst_QScriptEngine::globalObject):
        (tst_QScriptEngine::toStringHandle):
        * qt/benchmarks/qscriptvalue/qscriptvalue.pro: Added.
        * qt/benchmarks/qscriptvalue/tst_qscriptvalue.cpp: Added.
        (tst_QScriptValue::tst_QScriptValue):
        (tst_QScriptValue::~tst_QScriptValue):
        (tst_QScriptValue::values_data):
        (tst_QScriptValue::ctorBool):
        (tst_QScriptValue::ctorReal):
        (tst_QScriptValue::ctorNumber):
        (tst_QScriptValue::ctorQString):
        (tst_QScriptValue::ctorCString):
        (tst_QScriptValue::ctorSpecial):
        (tst_QScriptValue::ctorQScriptValue):
        (tst_QScriptValue::isValid_data):
        (tst_QScriptValue::isValid):
        (tst_QScriptValue::isBool_data):
        (tst_QScriptValue::isBool):
        (tst_QScriptValue::isNumber_data):
        (tst_QScriptValue::isNumber):
        (tst_QScriptValue::isFunction_data):
        (tst_QScriptValue::isFunction):
        (tst_QScriptValue::isNull_data):
        (tst_QScriptValue::isNull):
        (tst_QScriptValue::isString_data):
        (tst_QScriptValue::isString):
        (tst_QScriptValue::isUndefined_data):
        (tst_QScriptValue::isUndefined):
        (tst_QScriptValue::isObject_data):
        (tst_QScriptValue::isObject):
        (tst_QScriptValue::isError_data):
        (tst_QScriptValue::isError):
        (tst_QScriptValue::toString_data):
        (tst_QScriptValue::toString):
        (tst_QScriptValue::toNumber_data):
        (tst_QScriptValue::toNumber):
        (tst_QScriptValue::toBool_data):
        (tst_QScriptValue::toBool):
        (tst_QScriptValue::toInteger_data):
        (tst_QScriptValue::toInteger):
        (tst_QScriptValue::toInt32_data):
        (tst_QScriptValue::toInt32):
        (tst_QScriptValue::toUInt32_data):
        (tst_QScriptValue::toUInt32):
        (tst_QScriptValue::toUInt16_data):
        (tst_QScriptValue::toUInt16):
        (tst_QScriptValue::toObject_data):
        (tst_QScriptValue::toObject):
        (tst_QScriptValue::equals_data):
        (tst_QScriptValue::equals):
        (tst_QScriptValue::strictlyEquals_data):
        (tst_QScriptValue::strictlyEquals):
        (tst_QScriptValue::instanceOf_data):
        (tst_QScriptValue::instanceOf):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@61882 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
JavaScriptCore/ChangeLog
JavaScriptCore/qt/benchmarks/benchmarks.pri [new file with mode: 0644]
JavaScriptCore/qt/benchmarks/benchmarks.pro [new file with mode: 0644]
JavaScriptCore/qt/benchmarks/qscriptengine/qscriptengine.pro [new file with mode: 0644]
JavaScriptCore/qt/benchmarks/qscriptengine/tst_qscriptengine.cpp [new file with mode: 0644]
JavaScriptCore/qt/benchmarks/qscriptvalue/qscriptvalue.pro [new file with mode: 0644]
JavaScriptCore/qt/benchmarks/qscriptvalue/tst_qscriptvalue.cpp [new file with mode: 0644]
WebKit.pro

index 7de80e4..806db6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-25  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Introduce to QtScript benchmarks.
+
+        The QtScript performance should be tested regularly. The patch introduces
+        micro benchmarks for existing API.
+
+        [Qt] Performance of the QtScript API is not tested.
+        https://bugs.webkit.org/show_bug.cgi?id=40911
+
+        * WebKit.pro:
+
 2010-06-25  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
 
         Reviewed by Kenneth Rohde Christiansen.
index d21008e..99954a5 100644 (file)
@@ -1,3 +1,84 @@
+2010-06-25  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Introduce QtScript benchmarks.
+
+        The QtScript performance should be tested regularly. The patch introduces
+        micro benchmarks for existing API.
+
+        [Qt] Performance of the QtScript API is not tested.
+        https://bugs.webkit.org/show_bug.cgi?id=40911
+
+        * qt/benchmarks/benchmarks.pri: Copied from JavaScriptCore/qt/tests/tests.pri.
+        * qt/benchmarks/benchmarks.pro: Added.
+        * qt/benchmarks/qscriptengine/qscriptengine.pro: Added.
+        * qt/benchmarks/qscriptengine/tst_qscriptengine.cpp: Added.
+        (tst_QScriptEngine::checkSyntax_data):
+        (tst_QScriptEngine::checkSyntax):
+        (tst_QScriptEngine::constructor):
+        (tst_QScriptEngine::evaluateString_data):
+        (tst_QScriptEngine::evaluateString):
+        (tst_QScriptEngine::evaluateProgram_data):
+        (tst_QScriptEngine::evaluateProgram):
+        (tst_QScriptEngine::newObject):
+        (tst_QScriptEngine::nullValue):
+        (tst_QScriptEngine::undefinedValue):
+        (tst_QScriptEngine::globalObject):
+        (tst_QScriptEngine::toStringHandle):
+        * qt/benchmarks/qscriptvalue/qscriptvalue.pro: Added.
+        * qt/benchmarks/qscriptvalue/tst_qscriptvalue.cpp: Added.
+        (tst_QScriptValue::tst_QScriptValue):
+        (tst_QScriptValue::~tst_QScriptValue):
+        (tst_QScriptValue::values_data):
+        (tst_QScriptValue::ctorBool):
+        (tst_QScriptValue::ctorReal):
+        (tst_QScriptValue::ctorNumber):
+        (tst_QScriptValue::ctorQString):
+        (tst_QScriptValue::ctorCString):
+        (tst_QScriptValue::ctorSpecial):
+        (tst_QScriptValue::ctorQScriptValue):
+        (tst_QScriptValue::isValid_data):
+        (tst_QScriptValue::isValid):
+        (tst_QScriptValue::isBool_data):
+        (tst_QScriptValue::isBool):
+        (tst_QScriptValue::isNumber_data):
+        (tst_QScriptValue::isNumber):
+        (tst_QScriptValue::isFunction_data):
+        (tst_QScriptValue::isFunction):
+        (tst_QScriptValue::isNull_data):
+        (tst_QScriptValue::isNull):
+        (tst_QScriptValue::isString_data):
+        (tst_QScriptValue::isString):
+        (tst_QScriptValue::isUndefined_data):
+        (tst_QScriptValue::isUndefined):
+        (tst_QScriptValue::isObject_data):
+        (tst_QScriptValue::isObject):
+        (tst_QScriptValue::isError_data):
+        (tst_QScriptValue::isError):
+        (tst_QScriptValue::toString_data):
+        (tst_QScriptValue::toString):
+        (tst_QScriptValue::toNumber_data):
+        (tst_QScriptValue::toNumber):
+        (tst_QScriptValue::toBool_data):
+        (tst_QScriptValue::toBool):
+        (tst_QScriptValue::toInteger_data):
+        (tst_QScriptValue::toInteger):
+        (tst_QScriptValue::toInt32_data):
+        (tst_QScriptValue::toInt32):
+        (tst_QScriptValue::toUInt32_data):
+        (tst_QScriptValue::toUInt32):
+        (tst_QScriptValue::toUInt16_data):
+        (tst_QScriptValue::toUInt16):
+        (tst_QScriptValue::toObject_data):
+        (tst_QScriptValue::toObject):
+        (tst_QScriptValue::equals_data):
+        (tst_QScriptValue::equals):
+        (tst_QScriptValue::strictlyEquals_data):
+        (tst_QScriptValue::strictlyEquals):
+        (tst_QScriptValue::instanceOf_data):
+        (tst_QScriptValue::instanceOf):
+
 2010-06-25  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Geoffrey Garen.
diff --git a/JavaScriptCore/qt/benchmarks/benchmarks.pri b/JavaScriptCore/qt/benchmarks/benchmarks.pri
new file mode 100644 (file)
index 0000000..5af3383
--- /dev/null
@@ -0,0 +1,19 @@
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+QMAKE_LIBDIR = $$OUTPUT_DIR/lib $$QMAKE_LIBDIR
+mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
+    LIBS += -framework QtScript
+    QMAKE_FRAMEWORKPATH = $$OUTPUT_DIR/lib $$QMAKE_FRAMEWORKPATH
+} else {
+    win32-*|wince* {
+        LIBS += -lQtScript$${QT_MAJOR_VERSION}
+    } else {
+        LIBS += -lQtScript
+    }
+}
+
+CONFIG(release, debug|release) {
+    DEFINES += NDEBUG
+}
+
+INCLUDEPATH += $$PWD/../api
+
diff --git a/JavaScriptCore/qt/benchmarks/benchmarks.pro b/JavaScriptCore/qt/benchmarks/benchmarks.pro
new file mode 100644 (file)
index 0000000..85fa82c
--- /dev/null
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+SUBDIRS =   qscriptengine \
+            qscriptvalue \
+
diff --git a/JavaScriptCore/qt/benchmarks/qscriptengine/qscriptengine.pro b/JavaScriptCore/qt/benchmarks/qscriptengine/qscriptengine.pro
new file mode 100644 (file)
index 0000000..9948ce4
--- /dev/null
@@ -0,0 +1,11 @@
+TEMPLATE = app
+TARGET = tst_bench_qscriptengine
+
+SOURCES += tst_qscriptengine.cpp
+
+QT += testlib
+
+symbian* {
+    TARGET.EPOCHEAPSIZE  = 0x20000 0x2000000 // Min 128kB, Max 32MB
+    TARGET.EPOCSTACKSIZE = 0x14000
+}
diff --git a/JavaScriptCore/qt/benchmarks/qscriptengine/tst_qscriptengine.cpp b/JavaScriptCore/qt/benchmarks/qscriptengine/tst_qscriptengine.cpp
new file mode 100644 (file)
index 0000000..0c447c6
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "qscriptengine.h"
+#include "qscriptvalue.h"
+#include <qtest.h>
+
+class tst_QScriptEngine : public QObject {
+    Q_OBJECT
+
+private slots:
+    void checkSyntax_data();
+    void checkSyntax();
+    void constructor();
+    void evaluateString_data();
+    void evaluateString();
+    void evaluateProgram_data();
+    void evaluateProgram();
+    void newObject();
+    void nullValue();
+    void undefinedValue();
+    void globalObject();
+    void toStringHandle();
+};
+
+void tst_QScriptEngine::checkSyntax_data()
+{
+    evaluateString_data();
+}
+
+void tst_QScriptEngine::checkSyntax()
+{
+    QFETCH(QString, code);
+    QScriptEngine engine;
+    QBENCHMARK {
+        engine.checkSyntax(code);
+    }
+}
+
+void tst_QScriptEngine::constructor()
+{
+    QBENCHMARK {
+        QScriptEngine engine;
+    }
+}
+
+void tst_QScriptEngine::evaluateString_data()
+{
+    QTest::addColumn<QString>("code");
+    QTest::newRow("empty script") << QString::fromLatin1("");
+    QTest::newRow("number literal") << QString::fromLatin1("123");
+    QTest::newRow("string literal") << QString::fromLatin1("'ciao'");
+    QTest::newRow("regexp literal") << QString::fromLatin1("/foo/gim");
+    QTest::newRow("null literal") << QString::fromLatin1("null");
+    QTest::newRow("undefined literal") << QString::fromLatin1("undefined");
+    QTest::newRow("empty object literal") << QString::fromLatin1("{}");
+    QTest::newRow("this") << QString::fromLatin1("this");
+}
+
+void tst_QScriptEngine::evaluateString()
+{
+    QFETCH(QString, code);
+    QScriptEngine engine;
+    QBENCHMARK {
+        engine.evaluate(code);
+    }
+}
+
+void tst_QScriptEngine::evaluateProgram_data()
+{
+    evaluateString_data();
+}
+
+void tst_QScriptEngine::evaluateProgram()
+{
+    QFETCH(QString, code);
+    QScriptEngine engine;
+    QScriptProgram program(code);
+    QBENCHMARK {
+        engine.evaluate(program);
+    }
+}
+
+void tst_QScriptEngine::newObject()
+{
+    QScriptEngine engine;
+    QBENCHMARK {
+        engine.newObject();
+    }
+}
+
+void tst_QScriptEngine::nullValue()
+{
+    QScriptEngine engine;
+    QBENCHMARK {
+        engine.nullValue();
+    }
+}
+
+void tst_QScriptEngine::undefinedValue()
+{
+    QScriptEngine engine;
+    QBENCHMARK {
+        engine.undefinedValue();
+    }
+}
+
+void tst_QScriptEngine::globalObject()
+{
+    QScriptEngine engine;
+    QBENCHMARK {
+        engine.globalObject();
+    }
+}
+
+void tst_QScriptEngine::toStringHandle()
+{
+    QScriptEngine engine;
+    QString str = QString::fromLatin1("foobarbaz");
+    QBENCHMARK {
+        engine.toStringHandle(str);
+    }
+}
+
+QTEST_MAIN(tst_QScriptEngine)
+#include "tst_qscriptengine.moc"
diff --git a/JavaScriptCore/qt/benchmarks/qscriptvalue/qscriptvalue.pro b/JavaScriptCore/qt/benchmarks/qscriptvalue/qscriptvalue.pro
new file mode 100644 (file)
index 0000000..673fe65
--- /dev/null
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_bench_qscriptvalue
+QT += testlib
+
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
+include(../benchmarks.pri)
+
+SOURCES += tst_qscriptvalue.cpp
+
diff --git a/JavaScriptCore/qt/benchmarks/qscriptvalue/tst_qscriptvalue.cpp b/JavaScriptCore/qt/benchmarks/qscriptvalue/tst_qscriptvalue.cpp
new file mode 100644 (file)
index 0000000..7c39b8e
--- /dev/null
@@ -0,0 +1,442 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "qscriptengine.h"
+#include "qscriptstring.h"
+#include "qscriptvalue.h"
+#include <qtest.h>
+
+Q_DECLARE_METATYPE(QScriptValue);
+
+class tst_QScriptValue : public QObject {
+    Q_OBJECT
+
+public:
+    tst_QScriptValue()
+        : m_engine(0)
+    {}
+
+    ~tst_QScriptValue()
+    {
+        if (m_engine)
+            delete m_engine;
+    }
+
+private slots:
+    void values_data();
+
+    void ctorBool();
+    void ctorReal();
+    void ctorNumber();
+    void ctorQString();
+    void ctorCString();
+    void ctorSpecial();
+    void ctorQScriptValue();
+
+    void isValid_data();
+    void isValid();
+    void isBool_data();
+    void isBool();
+    void isNumber_data();
+    void isNumber();
+    void isFunction_data();
+    void isFunction();
+    void isNull_data();
+    void isNull();
+    void isString_data();
+    void isString();
+    void isUndefined_data();
+    void isUndefined();
+    void isObject_data();
+    void isObject();
+    void isError_data();
+    void isError();
+
+    void toString_data();
+    void toString();
+    void toNumber_data();
+    void toNumber();
+    void toBool_data();
+    void toBool();
+    void toInteger_data();
+    void toInteger();
+    void toInt32_data();
+    void toInt32();
+    void toUInt32_data();
+    void toUInt32();
+    void toUInt16_data();
+    void toUInt16();
+    void toObject_data();
+    void toObject();
+
+    void equals_data();
+    void equals();
+    void strictlyEquals_data();
+    void strictlyEquals();
+    void instanceOf_data();
+    void instanceOf();
+
+private:
+    QScriptEngine* m_engine;
+};
+
+void tst_QScriptValue::values_data()
+{
+    if (m_engine)
+        delete m_engine;
+    m_engine = new QScriptEngine;
+
+    QTest::addColumn<QScriptValue>("value");
+
+    QTest::newRow("invalid") << QScriptValue();
+
+    QTest::newRow("cbool") << QScriptValue(true);
+    QTest::newRow("cnumber") << QScriptValue(1234);
+    QTest::newRow("cstring") << QScriptValue("abc");
+    QTest::newRow("cnull") << QScriptValue(QScriptValue::NullValue);
+    QTest::newRow("cundefined") << QScriptValue(QScriptValue::UndefinedValue);
+
+    QTest::newRow("jsbool") << m_engine->evaluate("true");
+    QTest::newRow("jsnumber") << m_engine->evaluate("12345");
+    QTest::newRow("jsstring") << m_engine->evaluate("'go'");
+    QTest::newRow("jsfunction") << m_engine->evaluate("(function {})");
+    QTest::newRow("jsnull") << m_engine->nullValue();
+    QTest::newRow("jsundefined") << m_engine->undefinedValue();
+    QTest::newRow("jsobject") << m_engine->newObject();
+    QTest::newRow("jserror") << m_engine->evaluate("new Error()");
+}
+
+void tst_QScriptValue::ctorBool()
+{
+    QBENCHMARK {
+        QScriptValue(true);
+    }
+}
+
+void tst_QScriptValue::ctorReal()
+{
+    QBENCHMARK {
+        QScriptValue(12.3);
+    }
+}
+
+void tst_QScriptValue::ctorNumber()
+{
+    QBENCHMARK {
+        QScriptValue(123);
+    }
+}
+
+void tst_QScriptValue::ctorQString()
+{
+    QString str = QString::fromLatin1("ciao");
+    QBENCHMARK {
+        QScriptValue(str);
+    }
+}
+
+void tst_QScriptValue::ctorCString()
+{
+    QBENCHMARK {
+        QScriptValue("Pong!");
+    }
+}
+
+void tst_QScriptValue::ctorSpecial()
+{
+    QBENCHMARK {
+        (void)QScriptValue(QScriptValue::NullValue);
+    }
+}
+
+void tst_QScriptValue::ctorQScriptValue()
+{
+    QScriptValue tmp(1234);
+    QBENCHMARK {
+        QScriptValue(tmp);
+    }
+}
+
+void tst_QScriptValue::isValid_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isValid()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isValid();
+    }
+}
+
+void tst_QScriptValue::isBool_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isBool()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isBool();
+    }
+}
+
+void tst_QScriptValue::isNumber_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isNumber()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isNumber();
+    }
+}
+
+void tst_QScriptValue::isFunction_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isFunction()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isFunction();
+    }
+}
+
+void tst_QScriptValue::isNull_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isNull()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isNull();
+    }
+}
+
+void tst_QScriptValue::isString_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isString()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isString();
+    }
+}
+
+void tst_QScriptValue::isUndefined_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isUndefined()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isUndefined();
+    }
+}
+
+void tst_QScriptValue::isObject_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isObject()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isObject();
+    }
+}
+
+void tst_QScriptValue::isError_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::isError()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.isError();
+    }
+}
+
+void tst_QScriptValue::toString_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toString()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toString();
+    }
+}
+
+void tst_QScriptValue::toNumber_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toNumber()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toNumber();
+    }
+}
+
+void tst_QScriptValue::toBool_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toBool()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toBool();
+    }
+}
+
+void tst_QScriptValue::toInteger_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toInteger()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toInteger();
+    }
+}
+
+void tst_QScriptValue::toInt32_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toInt32()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toInt32();
+    }
+}
+
+void tst_QScriptValue::toUInt32_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toUInt32()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toUInt32();
+    }
+}
+
+void tst_QScriptValue::toUInt16_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toUInt16()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toUInt16();
+    }
+}
+
+void tst_QScriptValue::toObject_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::toObject()
+{
+    QFETCH(QScriptValue, value);
+    QBENCHMARK {
+        value.toObject();
+    }
+}
+
+void tst_QScriptValue::equals_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::equals()
+{
+    QFETCH(QScriptValue, value);
+    static QScriptValue previous;
+    QBENCHMARK {
+        value.equals(previous);
+    }
+    previous = value;
+}
+
+void tst_QScriptValue::strictlyEquals_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::strictlyEquals()
+{
+    QFETCH(QScriptValue, value);
+    static QScriptValue previous;
+    QBENCHMARK {
+        value.strictlyEquals(previous);
+    }
+    previous = value;
+}
+
+void tst_QScriptValue::instanceOf_data()
+{
+    values_data();
+}
+
+void tst_QScriptValue::instanceOf()
+{
+    QFETCH(QScriptValue, value);
+    static QScriptValue object = m_engine->newObject();
+    QBENCHMARK {
+        value.instanceOf(object);
+    }
+}
+
+QTEST_MAIN(tst_QScriptValue)
+#include "tst_qscriptvalue.moc"
index 6215e78..d8c1bc5 100644 (file)
@@ -24,7 +24,8 @@ exists($$PWD/WebKitTools/DumpRenderTree/qt/ImageDiff.pro): SUBDIRS += WebKitTool
 build-qtscript {
     SUBDIRS += \
         JavaScriptCore/qt/api/QtScript.pro \
-        JavaScriptCore/qt/tests
+        JavaScriptCore/qt/tests \
+        JavaScriptCore/qt/benchmarks
 }
 
 symbian {