From 8c68dcd2aa98f12d4e5c731dbc04a49c05917ed8 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Tue, 22 May 2012 09:52:57 +1000 Subject: [PATCH] Remove exceptions support from QtQml 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 Reviewed-by: Martin Jones --- src/qml/qml.pro | 2 +- src/qml/qml/v8/qv8sequencewrapper_p_p.h | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/qml/qml.pro b/src/qml/qml.pro index 283732a..acafb9f 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -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 diff --git a/src/qml/qml/v8/qv8sequencewrapper_p_p.h b/src/qml/qml/v8/qv8sequencewrapper_p_p.h index 4745b7e..cf20aa3 100644 --- a/src/qml/qml/v8/qv8sequencewrapper_p_p.h +++ b/src/qml/qml/v8/qv8sequencewrapper_p_p.h @@ -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); \ } \ -- 2.7.4