diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-07-04 11:57:47 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-04 07:27:00 +0200 |
commit | 8371e37e47967848ec470a4b34f46b1c8591c3c1 (patch) | |
tree | 23550c49f20f41ac4b1bf8e37e7bbc231774b304 /src/declarative/qml/v8/qv8qobjectwrapper.cpp | |
parent | 0fd993ac57dd35a286fb83c97196d3d27d1d3622 (diff) |
Don't exceed SMI bounds
If we use an integer that is greater than the maximum SMI value on
32-bit systems (like ARM), v8 allocates the integer as a HeapNumber
which is unbelievably slower.
Change-Id: I518b5947627631a2621344b656afa0dde002fe82
Reviewed-on: http://codereview.qt.nokia.com/1025
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qv8qobjectwrapper.cpp')
-rw-r--r-- | src/declarative/qml/v8/qv8qobjectwrapper.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp index bf9229b455..7e5bd4ecbd 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp @@ -174,8 +174,8 @@ static v8::Handle<v8::Value> name ## ValueGetter(v8::Local<v8::String>, const v8 \ uint32_t data = info.Data()->Uint32Value(); \ int index = data & 0x7FFF; \ - int notify = (data & 0x7FFF0000) >> 16; \ - if (notify == 0x7FFF) notify = -1; \ + int notify = (data & 0x0FFF0000) >> 16; \ + if (notify == 0x0FFF) notify = -1; \ \ QDeclarativeEnginePrivate *ep = resource->engine->engine()?QDeclarativeEnginePrivate::get(resource->engine->engine()):0; \ if (ep && notify /* 0 means constant */ && ep->captureProperties) { \ @@ -200,8 +200,8 @@ static v8::Handle<v8::Value> name ## ValueGetterDirect(v8::Local<v8::String>, co \ uint32_t data = info.Data()->Uint32Value(); \ int index = data & 0x7FFF; \ - int notify = (data & 0x7FFF0000) >> 16; \ - if (notify == 0x7FFF) notify = -1; \ + int notify = (data & 0x0FFF0000) >> 16; \ + if (notify == 0x0FFF) notify = -1; \ \ QDeclarativeEnginePrivate *ep = resource->engine->engine()?QDeclarativeEnginePrivate::get(resource->engine->engine()):0; \ if (ep && notify /* 0 means constant */ && ep->captureProperties) { \ @@ -801,7 +801,7 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8 for (StringCache::ConstIterator iter = stringCache.begin(); iter != stringCache.end(); ++iter) { Data *property = *iter; if (property->isFunction() || - property->coreIndex >= 0x7FFF || property->notifyIndex >= 0x7FFF || + property->coreIndex >= 0x7FFF || property->notifyIndex >= 0x0FFF || property->coreIndex == 0) continue; @@ -828,8 +828,8 @@ v8::Local<v8::Object> QDeclarativePropertyCache::newQObject(QObject *object, QV8 if (fastgetter) { int notifyIndex = property->notifyIndex; if (property->isConstant()) notifyIndex = 0; - else if (notifyIndex == -1) notifyIndex = 0x7FFF; - uint32_t data = (notifyIndex & 0x7FFF) << 16 | property->coreIndex; + else if (notifyIndex == -1) notifyIndex = 0x0FFF; + uint32_t data = (notifyIndex & 0x0FFF) << 16 | property->coreIndex; QString name = iter.key(); if (name == toString || name == destroy) |