args->arrayPut(0, context->d()->callData->args, context->d()->callData->argc);
args->d()->fullyCreated = true;
} else {
- args->setHasAccessorProperty();
Q_ASSERT(CalleePropertyIndex == args->internalClass()->find(context->d()->engine->id_callee));
args->memberData()->data[CalleePropertyIndex] = context->d()->function->asReturnedValue();
}
#include "qv4functionobject_p.h"
#include "qv4mm_p.h"
#include "qv4runtime_p.h"
+#include "qv4argumentsobject_p.h"
using namespace QV4;
uint oldSize = obj->getLength();
- if (other && other->isSparse()) {
+ if (!other || ArgumentsObject::isNonStrictArgumentsObject(otherObj)) {
+ ScopedValue v(scope);
+ for (uint i = 0; i < n; ++i)
+ obj->arraySet(oldSize + i, (v = otherObj->getIndexed(i)));
+ } else if (other && other->isSparse()) {
Heap::SparseArrayData *os = static_cast<Heap::SparseArrayData *>(other->d());
- if (otherObj->hasAccessorProperty() && other->hasAttributes()) {
+ if (other->hasAttributes()) {
ScopedValue v(scope);
for (const SparseArrayNode *it = os->sparse->begin();
it != os->sparse->end(); it = it->nextNode()) {
#include "qv4sparsearray_p.h"
#include "qv4objectproto_p.h"
#include "qv4scopedvalue_p.h"
+#include "qv4argumentsobject_p.h"
#include "qv4runtime_p.h"
using namespace QV4;
ScopedValue value(scope);
- if (instance->hasAccessorProperty() || (instance->arrayType() >= Heap::ArrayData::Sparse) || instance->protoHasArray()) {
+ if (ArgumentsObject::isNonStrictArgumentsObject(instance) ||
+ (instance->arrayType() >= Heap::ArrayData::Sparse) || instance->protoHasArray()) {
// lets be safe and slow
for (uint i = fromIndex; i < len; ++i) {
bool exists;
ScopedCallData callData(scope, len);
if (len) {
- if (arr->arrayType() != Heap::ArrayData::Simple || arr->protoHasArray() || arr->hasAccessorProperty()) {
+ if (arr->arrayType() != Heap::ArrayData::Simple || arr->protoHasArray()) {
for (quint32 i = 0; i < len; ++i)
callData->args[i] = arr->getIndexed(i);
} else {
ensureMemberIndex(internalClass()->size);
if (attributes.isAccessor()) {
- setHasAccessorProperty();
Property *pp = propertyAt(idx);
pp->value = p->value;
pp->set = p->set;
cattrs->setWritable(false);
if (!succeeded)
goto reject;
- if (attrs.isAccessor())
- setHasAccessorProperty();
return true;
}
} else {
setArrayAttributes(index, cattrs);
}
- if (cattrs.isAccessor())
- setHasAccessorProperty();
return true;
reject:
if (engine->currentContext()->strictMode)
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);
}
} 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);
inline ExecutionEngine *engine() const { return internalClass()->engine; }
- inline bool hasAccessorProperty() const { return d()->hasAccessorProperty; }
- inline void setHasAccessorProperty() { d()->hasAccessorProperty = true; }
-
bool isExtensible() const { return d()->extensible; }
void setExtensible(bool b) { d()->extensible = b; }
{
// ### Clean up
arrayCreate();
- if (attributes.isAccessor()) {
- setHasAccessorProperty();
- initSparseArray();
- } else if (index > 0x1000 && index > 2*d()->arrayData->alloc) {
+ if (attributes.isAccessor() || (index > 0x1000 && index > 2*d()->arrayData->alloc)) {
initSparseArray();
} else {
arrayData()->vtable()->reallocate(this, index + 1, false);
uchar _needsActivation : 1; // used by FunctionObject
uchar _strictMode : 1; // used by FunctionObject
uchar _bindingKeyFlag : 1;
- uchar hasAccessorProperty : 1;
+ uchar _hasAccessorProperty : 1;
uchar _unused : 1;
mutable uchar subtype;
uchar _unused2;