diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-29 14:31:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | edee5c3dc0d922ec3b6a44d66193e9a57b8a979e (patch) | |
tree | 5e40caa777c01a7999d736ead63ae239d1eb5b98 /src/imports/localstorage | |
parent | 3ad8b0f0e8193bb7b62ffee6b33588ef6b51459c (diff) |
Move prototype pointer into QV4::InternalClass
The prototype is actually the same for most objects. By
moving it into the internal class, we can save 8 bytes
per object, as well as allowing for some future
optimizations.
Also fix a bug in the implementation of the Error
prototype objects.
Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports/localstorage')
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 6fc7d1db7f..7c7303a7b8 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -99,7 +99,7 @@ public: : Object(QV8Engine::getV4(e)), type(Database), inTransaction(false), readonly(false), forwardOnly(false) { vtbl = &static_vtbl; - prototype = QV8Engine::getV4(e)->objectPrototype; + setPrototype(QV8Engine::getV4(e)->objectPrototype); } ~QQmlSqlDatabaseWrapper() { @@ -287,7 +287,7 @@ static Value qmlsqldatabase_executeSql(SimpleCallContext *ctx) } if (query.exec()) { QQmlSqlDatabaseWrapper *rows = new (ctx->engine->memoryManager) QQmlSqlDatabaseWrapper(engine); - rows->prototype = databaseData(engine)->rowsProto.value().asObject(); + rows->setPrototype(databaseData(engine)->rowsProto.value().asObject()); rows->type = QQmlSqlDatabaseWrapper::Rows; rows->database = db; rows->sqlQuery = query; @@ -330,7 +330,7 @@ static Value qmlsqldatabase_changeVersion(SimpleCallContext *ctx) V4THROW_SQL(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(r->version)); QQmlSqlDatabaseWrapper *w = new (ctx->engine->memoryManager) QQmlSqlDatabaseWrapper(engine); - w->prototype = databaseData(engine)->queryProto.value().asObject(); + w->setPrototype(databaseData(engine)->queryProto.value().asObject()); w->type = QQmlSqlDatabaseWrapper::Query; w->database = db; w->version = r->version; @@ -386,7 +386,7 @@ static Value qmlsqldatabase_transaction_shared(SimpleCallContext *ctx, bool read QSqlDatabase db = r->database; QQmlSqlDatabaseWrapper *w = new (ctx->engine->memoryManager) QQmlSqlDatabaseWrapper(engine); - w->prototype = databaseData(engine)->queryProto.value().asObject(); + w->setPrototype(databaseData(engine)->queryProto.value().asObject()); w->type = QQmlSqlDatabaseWrapper::Query; w->database = db; w->version = r->version; @@ -673,7 +673,7 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args) } QQmlSqlDatabaseWrapper *db = new (ctx->engine->memoryManager) QQmlSqlDatabaseWrapper(engine); - db->prototype = databaseData(engine)->databaseProto.value().asObject(); + db->setPrototype(databaseData(engine)->databaseProto.value().asObject()); db->database = database; db->version = version; |