Remove exceptions support from QtQml
authorChris Adams <christopher.adams@nokia.com>
Mon, 21 May 2012 23:52:57 +0000 (09:52 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 25 May 2012 01:21:48 +0000 (03:21 +0200)
Previously, the sequence wrapper handled std::alloc exceptions.
This commit removes that handling, as there are many other ways
to use up all of the available address space memory which aren't
handled (eg, loading lots of large images), and exception support
causes a large overhead.

See a1151929fffc765e128d72d170342020b34dd0b3 for more information.

Change-Id: I68c9d7744e7dcece7b3112352e01ac71ead12f62
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/qml/qml.pro
src/qml/qml/v8/qv8sequencewrapper_p_p.h

index 283732a..acafb9f 100644 (file)
@@ -3,7 +3,7 @@ load(qt_module)
 TARGET     = QtQml
 QPRO_PWD   = $$PWD
 
-CONFIG += module exceptions
+CONFIG += module
 MODULE_PRI += ../../modules/qt_qml.pri
 
 QT = core-private network v8-private
index 4745b7e..cf20aa3 100644 (file)
@@ -333,13 +333,7 @@ static QString convertUrlToString(QV8Engine *, const QUrl &v)
                     /* according to ECMA262r3 we need to insert */ \
                     /* undefined values increasing length to newLength. */ \
                     /* We cannot, so we insert default-values instead. */ \
-                    QT_TRY { \
-                        c.reserve(newCount); \
-                    } QT_CATCH (std::bad_alloc &exception) { \
-                        generateWarning(engine, QString(QLatin1String(exception.what()) \
-                                                + QLatin1String(" during length set"))); \
-                        return; /* failed; don't write back any result. */ \
-                    } \
+                    c.reserve(newCount); \
                     while (newCount > count++) { \
                         c.append(DefaultValue); \
                     } \
@@ -381,13 +375,7 @@ static QString convertUrlToString(QV8Engine *, const QUrl &v)
                 } else { \
                     /* according to ECMA262r3 we need to insert */ \
                     /* the value at the given index, increasing length to index+1. */ \
-                    QT_TRY { \
-                        c.reserve(signedIdx + 1); \
-                    } QT_CATCH (std::bad_alloc &exception) { \
-                        generateWarning(engine, QString(QLatin1String(exception.what()) \
-                                                + QLatin1String(" during indexed set"))); \
-                        return v8::Undefined(); /* failed; don't write back any result. */ \
-                    } \
+                    c.reserve(signedIdx + 1); \
                     while (signedIdx > count++) { \
                         c.append(DefaultValue); \
                     } \