diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-09 13:13:04 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-12 11:04:19 +0100 |
commit | 3840beb6c61023542a689c7f125a7b521d3b2551 (patch) | |
tree | b787c7383fd6ea631d81f6952f4687804e4c4e48 /src/qml/jsruntime/qv4object.cpp | |
parent | 462496c2bbf9a35ce13762af8830cb2f87b0c27e (diff) |
Get rid of hasAccessorProperty in Heap::Base
This shouldn't affect performance as we can just as well
check for cases where we need to take the slow path
differently.
Change-Id: I4b9f69c39e9e64b437820ca3a6ea43e8877f2cf3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index cc7171de72..d30c113c32 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -210,7 +210,6 @@ void Object::insertMember(String *s, const Property *p, PropertyAttributes attri ensureMemberIndex(internalClass()->size); if (attributes.isAccessor()) { - setHasAccessorProperty(); Property *pp = propertyAt(idx); pp->value = p->value; pp->set = p->set; @@ -882,8 +881,6 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, String *name, const cattrs->setWritable(false); if (!succeeded) goto reject; - if (attrs.isAccessor()) - setHasAccessorProperty(); return true; } @@ -1047,8 +1044,6 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, uint index, String * } else { setArrayAttributes(index, cattrs); } - if (cattrs.isAccessor()) - setHasAccessorProperty(); return true; reject: if (engine->currentContext()->strictMode) @@ -1070,7 +1065,8 @@ void Object::copyArrayData(Object *other) Q_ASSERT(isArrayObject()); Scope scope(engine()); - if (other->protoHasArray() || other->hasAccessorProperty()) { + if (other->protoHasArray() || ArgumentsObject::isNonStrictArgumentsObject(other) || + (other->arrayType() == Heap::ArrayData::Sparse && other->arrayData()->attrs)) { uint len = other->getLength(); Q_ASSERT(len); @@ -1080,14 +1076,6 @@ void Object::copyArrayData(Object *other) } } else if (!other->arrayData()) { ; - } else if (other->hasAccessorProperty() && other->d()->arrayData->attrs && other->d()->arrayData->isSparse()){ - // do it the slow way - ScopedValue v(scope); - Heap::ArrayData *osa = other->d()->arrayData; - for (const SparseArrayNode *it = osa->sparse->begin(); it != osa->sparse->end(); it = it->nextNode()) { - v = other->getValue(reinterpret_cast<Property *>(osa->arrayData + it->value), osa->attrs[it->value]); - arraySet(it->key(), v); - } } else { Q_ASSERT(!arrayData() && other->arrayData()); ArrayData::realloc(this, other->d()->arrayData->type, other->d()->arrayData->alloc, false); |