diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-11-14 09:54:00 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-27 11:10:04 +0000 |
commit | e6d17c8691bfafa033b82a4d81a9caf4a2fd1b85 (patch) | |
tree | 68a8774562cf291eb4350facfd7feece4dd77443 /src/qml/jsruntime/qv4object.cpp | |
parent | fca89004d75412dd378cc44ad79ed3c1e05c765b (diff) |
Convert setters to use the id in InternalClass
Change-Id: I7f3acf96e998a41d60d33f98b243089b9ee40ff0
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index e7368edad2..b4034fd196 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -528,60 +528,6 @@ bool Object::deleteIndexedProperty(Managed *m, uint index) return static_cast<Object *>(m)->internalDeleteIndexedProperty(index); } -bool Object::setLookup(Managed *m, Lookup *l, const Value &value) -{ - Scope scope(static_cast<Object *>(m)->engine()); - ScopedObject o(scope, static_cast<Object *>(m)); - ScopedString name(scope, scope.engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]); - - InternalClass *c = o->internalClass(); - uint idx = c->find(name); - if (!o->isArrayObject() || idx != Heap::ArrayObject::LengthPropertyIndex) { - if (idx != UINT_MAX && o->internalClass()->propertyData[idx].isData() && o->internalClass()->propertyData[idx].isWritable()) { - l->classList[0] = o->internalClass(); - l->index = idx; - l->setter = idx < o->d()->vtable()->nInlineProperties ? Lookup::setter0Inline : Lookup::setter0; - o->setProperty(idx, value); - return true; - } - - if (idx != UINT_MAX) - return o->putValue(idx, value); - } - - if (!o->put(name, value)) { - l->setter = Lookup::setterFallback; - return false; - } - - if (o->internalClass() == c) - return true; - idx = o->internalClass()->find(name); - if (idx == UINT_MAX) // ### can this even happen? - return false; - l->classList[0] = c; - l->classList[3] = o->internalClass(); - l->index = idx; - if (!o->prototype()) { - l->setter = Lookup::setterInsert0; - return true; - } - o = o->prototype(); - l->classList[1] = o->internalClass(); - if (!o->prototype()) { - l->setter = Lookup::setterInsert1; - return true; - } - o = o->prototype(); - l->classList[2] = o->internalClass(); - if (!o->prototype()) { - l->setter = Lookup::setterInsert2; - return true; - } - l->setter = Lookup::setterGeneric; - return true; -} - void Object::advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *pd, PropertyAttributes *attrs) { Object *o = static_cast<Object *>(m); |