Disambiguate different allocation functions in the memory manager
Some compilers (in this case MingW 5.3) don't manage to properly disambiguate the template overloads, and try to instantiate the wrong template function. Solve this by renaming the one of the template functions. Change-Id: I3574e617fe96c4bd52920a0127a1dfe39cc3d302 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
6c2f6e029e
commit
278b144a35
|
@ -148,7 +148,7 @@ public:
|
|||
|
||||
static Heap::QQmlSqlDatabaseWrapper *create(QV4::ExecutionEngine *engine)
|
||||
{
|
||||
return engine->memoryManager->allocObject<QQmlSqlDatabaseWrapper>();
|
||||
return engine->memoryManager->allocate<QQmlSqlDatabaseWrapper>();
|
||||
}
|
||||
|
||||
~QQmlSqlDatabaseWrapper() {
|
||||
|
|
|
@ -518,7 +518,7 @@ QQuickV4ParticleData::QQuickV4ParticleData(QV4::ExecutionEngine* v4, QQuickParti
|
|||
|
||||
QV4::Scope scope(v4);
|
||||
QV4ParticleDataDeletable *d = particleV4Data(scope.engine);
|
||||
QV4::ScopedObject o(scope, v4->memoryManager->allocObject<QV4ParticleData>(datum, system));
|
||||
QV4::ScopedObject o(scope, v4->memoryManager->allocate<QV4ParticleData>(datum, system));
|
||||
QV4::ScopedObject p(scope, d->proto.value());
|
||||
o->setPrototype(p);
|
||||
m_v4Value = o;
|
||||
|
|
|
@ -69,7 +69,7 @@ ReturnedValue DataViewCtor::callAsConstructor(const FunctionObject *f, const Val
|
|||
if (bo != byteOffset || bl != byteLength || byteOffset + byteLength > bufferLength)
|
||||
return scope.engine->throwRangeError(QStringLiteral("DataView: constructor arguments out of range"));
|
||||
|
||||
Scoped<DataView> a(scope, scope.engine->memoryManager->allocObject<DataView>());
|
||||
Scoped<DataView> a(scope, scope.engine->memoryManager->allocate<DataView>());
|
||||
a->d()->buffer.set(scope.engine, buffer->d());
|
||||
a->d()->byteLength = byteLength;
|
||||
a->d()->byteOffset = byteOffset;
|
||||
|
|
|
@ -258,7 +258,7 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
|
|||
Q_ASSERT(ic->prototype);
|
||||
jsObjects[ArrayProto] = memoryManager->allocObject<ArrayPrototype>(ic);
|
||||
internalClasses[Class_ArrayObject] = ic->changePrototype(arrayPrototype()->d());
|
||||
jsObjects[PropertyListProto] = memoryManager->allocObject<PropertyListPrototype>();
|
||||
jsObjects[PropertyListProto] = memoryManager->allocate<PropertyListPrototype>();
|
||||
|
||||
InternalClass *argsClass = newInternalClass(ArgumentsObject::staticVTable(), objectPrototype());
|
||||
argsClass = argsClass->addMember(id_length(), Attr_NotEnumerable);
|
||||
|
@ -278,9 +278,9 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
|
|||
internalClasses[Class_StringObject] = ic->changePrototype(stringPrototype()->d());
|
||||
Q_ASSERT(internalClasses[EngineBase::Class_StringObject]->find(id_length()) == Heap::StringObject::LengthPropertyIndex);
|
||||
|
||||
jsObjects[NumberProto] = memoryManager->allocObject<NumberPrototype>();
|
||||
jsObjects[BooleanProto] = memoryManager->allocObject<BooleanPrototype>();
|
||||
jsObjects[DateProto] = memoryManager->allocObject<DatePrototype>();
|
||||
jsObjects[NumberProto] = memoryManager->allocate<NumberPrototype>();
|
||||
jsObjects[BooleanProto] = memoryManager->allocate<BooleanPrototype>();
|
||||
jsObjects[DateProto] = memoryManager->allocate<DatePrototype>();
|
||||
|
||||
uint index;
|
||||
ic = newInternalClass(QV4::FunctionPrototype::staticVTable(), objectPrototype());
|
||||
|
@ -350,7 +350,7 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
|
|||
jsObjects[TypeErrorProto] = memoryManager->allocObject<TypeErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()));
|
||||
jsObjects[URIErrorProto] = memoryManager->allocObject<URIErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()));
|
||||
|
||||
jsObjects[VariantProto] = memoryManager->allocObject<VariantPrototype>();
|
||||
jsObjects[VariantProto] = memoryManager->allocate<VariantPrototype>();
|
||||
Q_ASSERT(variantPrototype()->prototype() == objectPrototype()->d());
|
||||
|
||||
#if QT_CONFIG(qml_sequence_object)
|
||||
|
@ -359,21 +359,21 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
|
|||
#endif
|
||||
|
||||
ExecutionContext *global = rootContext();
|
||||
jsObjects[Object_Ctor] = memoryManager->allocObject<ObjectCtor>(global);
|
||||
jsObjects[String_Ctor] = memoryManager->allocObject<StringCtor>(global);
|
||||
jsObjects[Number_Ctor] = memoryManager->allocObject<NumberCtor>(global);
|
||||
jsObjects[Boolean_Ctor] = memoryManager->allocObject<BooleanCtor>(global);
|
||||
jsObjects[Array_Ctor] = memoryManager->allocObject<ArrayCtor>(global);
|
||||
jsObjects[Function_Ctor] = memoryManager->allocObject<FunctionCtor>(global);
|
||||
jsObjects[Date_Ctor] = memoryManager->allocObject<DateCtor>(global);
|
||||
jsObjects[RegExp_Ctor] = memoryManager->allocObject<RegExpCtor>(global);
|
||||
jsObjects[Error_Ctor] = memoryManager->allocObject<ErrorCtor>(global);
|
||||
jsObjects[EvalError_Ctor] = memoryManager->allocObject<EvalErrorCtor>(global);
|
||||
jsObjects[RangeError_Ctor] = memoryManager->allocObject<RangeErrorCtor>(global);
|
||||
jsObjects[ReferenceError_Ctor] = memoryManager->allocObject<ReferenceErrorCtor>(global);
|
||||
jsObjects[SyntaxError_Ctor] = memoryManager->allocObject<SyntaxErrorCtor>(global);
|
||||
jsObjects[TypeError_Ctor] = memoryManager->allocObject<TypeErrorCtor>(global);
|
||||
jsObjects[URIError_Ctor] = memoryManager->allocObject<URIErrorCtor>(global);
|
||||
jsObjects[Object_Ctor] = memoryManager->allocate<ObjectCtor>(global);
|
||||
jsObjects[String_Ctor] = memoryManager->allocate<StringCtor>(global);
|
||||
jsObjects[Number_Ctor] = memoryManager->allocate<NumberCtor>(global);
|
||||
jsObjects[Boolean_Ctor] = memoryManager->allocate<BooleanCtor>(global);
|
||||
jsObjects[Array_Ctor] = memoryManager->allocate<ArrayCtor>(global);
|
||||
jsObjects[Function_Ctor] = memoryManager->allocate<FunctionCtor>(global);
|
||||
jsObjects[Date_Ctor] = memoryManager->allocate<DateCtor>(global);
|
||||
jsObjects[RegExp_Ctor] = memoryManager->allocate<RegExpCtor>(global);
|
||||
jsObjects[Error_Ctor] = memoryManager->allocate<ErrorCtor>(global);
|
||||
jsObjects[EvalError_Ctor] = memoryManager->allocate<EvalErrorCtor>(global);
|
||||
jsObjects[RangeError_Ctor] = memoryManager->allocate<RangeErrorCtor>(global);
|
||||
jsObjects[ReferenceError_Ctor] = memoryManager->allocate<ReferenceErrorCtor>(global);
|
||||
jsObjects[SyntaxError_Ctor] = memoryManager->allocate<SyntaxErrorCtor>(global);
|
||||
jsObjects[TypeError_Ctor] = memoryManager->allocate<TypeErrorCtor>(global);
|
||||
jsObjects[URIError_Ctor] = memoryManager->allocate<URIErrorCtor>(global);
|
||||
|
||||
static_cast<ObjectPrototype *>(objectPrototype())->init(this, objectCtor());
|
||||
static_cast<StringPrototype *>(stringPrototype())->init(this, stringCtor());
|
||||
|
@ -399,19 +399,19 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
|
|||
|
||||
// typed arrays
|
||||
|
||||
jsObjects[ArrayBuffer_Ctor] = memoryManager->allocObject<ArrayBufferCtor>(global);
|
||||
jsObjects[ArrayBufferProto] = memoryManager->allocObject<ArrayBufferPrototype>();
|
||||
jsObjects[ArrayBuffer_Ctor] = memoryManager->allocate<ArrayBufferCtor>(global);
|
||||
jsObjects[ArrayBufferProto] = memoryManager->allocate<ArrayBufferPrototype>();
|
||||
static_cast<ArrayBufferPrototype *>(arrayBufferPrototype())->init(this, arrayBufferCtor());
|
||||
|
||||
jsObjects[DataView_Ctor] = memoryManager->allocObject<DataViewCtor>(global);
|
||||
jsObjects[DataViewProto] = memoryManager->allocObject<DataViewPrototype>();
|
||||
jsObjects[DataView_Ctor] = memoryManager->allocate<DataViewCtor>(global);
|
||||
jsObjects[DataViewProto] = memoryManager->allocate<DataViewPrototype>();
|
||||
static_cast<DataViewPrototype *>(dataViewPrototype())->init(this, dataViewCtor());
|
||||
jsObjects[ValueTypeProto] = (Heap::Base *) nullptr;
|
||||
jsObjects[SignalHandlerProto] = (Heap::Base *) nullptr;
|
||||
|
||||
for (int i = 0; i < Heap::TypedArray::NTypes; ++i) {
|
||||
static_cast<Value &>(typedArrayCtors[i]) = memoryManager->allocObject<TypedArrayCtor>(global, Heap::TypedArray::Type(i));
|
||||
static_cast<Value &>(typedArrayPrototype[i]) = memoryManager->allocObject<TypedArrayPrototype>(Heap::TypedArray::Type(i));
|
||||
static_cast<Value &>(typedArrayCtors[i]) = memoryManager->allocate<TypedArrayCtor>(global, Heap::TypedArray::Type(i));
|
||||
static_cast<Value &>(typedArrayPrototype[i]) = memoryManager->allocate<TypedArrayPrototype>(Heap::TypedArray::Type(i));
|
||||
typedArrayPrototype[i].as<TypedArrayPrototype>()->init(this, static_cast<TypedArrayCtor *>(typedArrayCtors[i].as<Object>()));
|
||||
}
|
||||
|
||||
|
@ -443,15 +443,15 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
|
|||
for (int i = 0; i < Heap::TypedArray::NTypes; ++i)
|
||||
globalObject->defineDefaultProperty((str = typedArrayCtors[i].as<FunctionObject>()->name())->toQString(), typedArrayCtors[i]);
|
||||
ScopedObject o(scope);
|
||||
globalObject->defineDefaultProperty(QStringLiteral("Math"), (o = memoryManager->allocObject<MathObject>()));
|
||||
globalObject->defineDefaultProperty(QStringLiteral("JSON"), (o = memoryManager->allocObject<JsonObject>()));
|
||||
globalObject->defineDefaultProperty(QStringLiteral("Math"), (o = memoryManager->allocate<MathObject>()));
|
||||
globalObject->defineDefaultProperty(QStringLiteral("JSON"), (o = memoryManager->allocate<JsonObject>()));
|
||||
|
||||
globalObject->defineReadonlyProperty(QStringLiteral("undefined"), Primitive::undefinedValue());
|
||||
globalObject->defineReadonlyProperty(QStringLiteral("NaN"), Primitive::fromDouble(std::numeric_limits<double>::quiet_NaN()));
|
||||
globalObject->defineReadonlyProperty(QStringLiteral("Infinity"), Primitive::fromDouble(Q_INFINITY));
|
||||
|
||||
|
||||
jsObjects[Eval_Function] = memoryManager->allocObject<EvalFunction>(global);
|
||||
jsObjects[Eval_Function] = memoryManager->allocate<EvalFunction>(global);
|
||||
globalObject->defineDefaultProperty(QStringLiteral("eval"), *evalFunction());
|
||||
|
||||
// ES6: 20.1.2.12 & 20.1.2.13:
|
||||
|
@ -545,7 +545,7 @@ InternalClass *ExecutionEngine::newInternalClass(const VTable *vtable, Object *p
|
|||
|
||||
Heap::Object *ExecutionEngine::newObject()
|
||||
{
|
||||
return memoryManager->allocObject<Object>();
|
||||
return memoryManager->allocate<Object>();
|
||||
}
|
||||
|
||||
Heap::Object *ExecutionEngine::newObject(InternalClass *internalClass, QV4::Object *prototype)
|
||||
|
@ -567,23 +567,23 @@ Heap::String *ExecutionEngine::newIdentifier(const QString &text)
|
|||
|
||||
Heap::Object *ExecutionEngine::newStringObject(const String *string)
|
||||
{
|
||||
return memoryManager->allocObject<StringObject>(string);
|
||||
return memoryManager->allocate<StringObject>(string);
|
||||
}
|
||||
|
||||
Heap::Object *ExecutionEngine::newNumberObject(double value)
|
||||
{
|
||||
return memoryManager->allocObject<NumberObject>(value);
|
||||
return memoryManager->allocate<NumberObject>(value);
|
||||
}
|
||||
|
||||
Heap::Object *ExecutionEngine::newBooleanObject(bool b)
|
||||
{
|
||||
return memoryManager->allocObject<BooleanObject>(b);
|
||||
return memoryManager->allocate<BooleanObject>(b);
|
||||
}
|
||||
|
||||
Heap::ArrayObject *ExecutionEngine::newArrayObject(int count)
|
||||
{
|
||||
Scope scope(this);
|
||||
ScopedArrayObject object(scope, memoryManager->allocObject<ArrayObject>());
|
||||
ScopedArrayObject object(scope, memoryManager->allocate<ArrayObject>());
|
||||
|
||||
if (count) {
|
||||
if (count < 0x1000)
|
||||
|
@ -596,7 +596,7 @@ Heap::ArrayObject *ExecutionEngine::newArrayObject(int count)
|
|||
Heap::ArrayObject *ExecutionEngine::newArrayObject(const Value *values, int length)
|
||||
{
|
||||
Scope scope(this);
|
||||
ScopedArrayObject a(scope, memoryManager->allocObject<ArrayObject>());
|
||||
ScopedArrayObject a(scope, memoryManager->allocate<ArrayObject>());
|
||||
|
||||
if (length) {
|
||||
size_t size = sizeof(Heap::ArrayData) + (length-1)*sizeof(Value);
|
||||
|
@ -624,7 +624,7 @@ Heap::ArrayObject *ExecutionEngine::newArrayObject(const Value *values, int leng
|
|||
Heap::ArrayObject *ExecutionEngine::newArrayObject(const QStringList &list)
|
||||
{
|
||||
Scope scope(this);
|
||||
ScopedArrayObject object(scope, memoryManager->allocObject<ArrayObject>(list));
|
||||
ScopedArrayObject object(scope, memoryManager->allocate<ArrayObject>(list));
|
||||
return object->d();
|
||||
}
|
||||
|
||||
|
@ -638,31 +638,31 @@ Heap::ArrayObject *ExecutionEngine::newArrayObject(InternalClass *internalClass,
|
|||
|
||||
Heap::ArrayBuffer *ExecutionEngine::newArrayBuffer(const QByteArray &array)
|
||||
{
|
||||
return memoryManager->allocObject<ArrayBuffer>(array);
|
||||
return memoryManager->allocate<ArrayBuffer>(array);
|
||||
}
|
||||
|
||||
Heap::ArrayBuffer *ExecutionEngine::newArrayBuffer(size_t length)
|
||||
{
|
||||
return memoryManager->allocObject<ArrayBuffer>(length);
|
||||
return memoryManager->allocate<ArrayBuffer>(length);
|
||||
}
|
||||
|
||||
|
||||
Heap::DateObject *ExecutionEngine::newDateObject(const Value &value)
|
||||
{
|
||||
return memoryManager->allocObject<DateObject>(value);
|
||||
return memoryManager->allocate<DateObject>(value);
|
||||
}
|
||||
|
||||
Heap::DateObject *ExecutionEngine::newDateObject(const QDateTime &dt)
|
||||
{
|
||||
Scope scope(this);
|
||||
Scoped<DateObject> object(scope, memoryManager->allocObject<DateObject>(dt));
|
||||
Scoped<DateObject> object(scope, memoryManager->allocate<DateObject>(dt));
|
||||
return object->d();
|
||||
}
|
||||
|
||||
Heap::DateObject *ExecutionEngine::newDateObjectFromTime(const QTime &t)
|
||||
{
|
||||
Scope scope(this);
|
||||
Scoped<DateObject> object(scope, memoryManager->allocObject<DateObject>(t));
|
||||
Scoped<DateObject> object(scope, memoryManager->allocate<DateObject>(t));
|
||||
return object->d();
|
||||
}
|
||||
|
||||
|
@ -679,12 +679,12 @@ Heap::RegExpObject *ExecutionEngine::newRegExpObject(const QString &pattern, int
|
|||
|
||||
Heap::RegExpObject *ExecutionEngine::newRegExpObject(RegExp *re)
|
||||
{
|
||||
return memoryManager->allocObject<RegExpObject>(re);
|
||||
return memoryManager->allocate<RegExpObject>(re);
|
||||
}
|
||||
|
||||
Heap::RegExpObject *ExecutionEngine::newRegExpObject(const QRegExp &re)
|
||||
{
|
||||
return memoryManager->allocObject<RegExpObject>(re);
|
||||
return memoryManager->allocate<RegExpObject>(re);
|
||||
}
|
||||
|
||||
Heap::Object *ExecutionEngine::newErrorObject(const Value &value)
|
||||
|
@ -731,13 +731,13 @@ Heap::Object *ExecutionEngine::newURIErrorObject(const Value &message)
|
|||
|
||||
Heap::Object *ExecutionEngine::newVariantObject(const QVariant &v)
|
||||
{
|
||||
return memoryManager->allocObject<VariantObject>(v);
|
||||
return memoryManager->allocate<VariantObject>(v);
|
||||
}
|
||||
|
||||
Heap::Object *ExecutionEngine::newForEachIteratorObject(Object *o)
|
||||
{
|
||||
Scope scope(this);
|
||||
ScopedObject obj(scope, memoryManager->allocObject<ForEachIteratorObject>(o));
|
||||
ScopedObject obj(scope, memoryManager->allocate<ForEachIteratorObject>(o));
|
||||
return obj->d();
|
||||
}
|
||||
|
||||
|
@ -905,8 +905,8 @@ void ExecutionEngine::requireArgumentsAccessors(int n)
|
|||
}
|
||||
ExecutionContext *global = rootContext();
|
||||
for (int i = oldSize; i < nArgumentsAccessors; ++i) {
|
||||
argumentsAccessors[i].value = ScopedValue(scope, memoryManager->allocObject<ArgumentsGetterFunction>(global, i));
|
||||
argumentsAccessors[i].set = ScopedValue(scope, memoryManager->allocObject<ArgumentsSetterFunction>(global, i));
|
||||
argumentsAccessors[i].value = ScopedValue(scope, memoryManager->allocate<ArgumentsGetterFunction>(global, i));
|
||||
argumentsAccessors[i].set = ScopedValue(scope, memoryManager->allocate<ArgumentsSetterFunction>(global, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ ReturnedValue FunctionObject::call(const FunctionObject *, const Value *, const
|
|||
|
||||
Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function)
|
||||
{
|
||||
return scope->engine()->memoryManager->allocObject<ScriptFunction>(scope, function);
|
||||
return scope->engine()->memoryManager->allocate<ScriptFunction>(scope, function);
|
||||
}
|
||||
|
||||
bool FunctionObject::isBinding() const
|
||||
|
|
|
@ -167,7 +167,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
|
|||
static Heap::FunctionObject *createBuiltinFunction(ExecutionContext *scope, String *name,
|
||||
ReturnedValue (*code)(const FunctionObject *, const Value *thisObject, const Value *argv, int argc))
|
||||
{
|
||||
return scope->engine()->memoryManager->allocObject<FunctionObject>(scope, name, code);
|
||||
return scope->engine()->memoryManager->allocate<FunctionObject>(scope, name, code);
|
||||
}
|
||||
|
||||
bool strictMode() const { return d()->function ? d()->function->isStrict() : false; }
|
||||
|
@ -234,7 +234,7 @@ struct BoundFunction: FunctionObject {
|
|||
|
||||
static Heap::BoundFunction *create(ExecutionContext *scope, FunctionObject *target, const Value &boundThis, QV4::MemberData *boundArgs)
|
||||
{
|
||||
return scope->engine()->memoryManager->allocObject<BoundFunction>(scope, target, boundThis, boundArgs);
|
||||
return scope->engine()->memoryManager->allocate<BoundFunction>(scope, target, boundThis, boundArgs);
|
||||
}
|
||||
|
||||
Heap::FunctionObject *target() const { return d()->target; }
|
||||
|
|
|
@ -312,7 +312,7 @@ Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, cons
|
|||
context->isInternal = true;
|
||||
context->isJSContext = true;
|
||||
|
||||
Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QQmlContextWrapper>(context, (QObject*)nullptr));
|
||||
Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocate<QQmlContextWrapper>(context, (QObject*)nullptr));
|
||||
qml->d()->isNullWrapper = true;
|
||||
|
||||
qml->setReadOnly(false);
|
||||
|
@ -330,7 +330,7 @@ Heap::QmlContext *QmlContext::create(ExecutionContext *parent, QQmlContextData *
|
|||
{
|
||||
Scope scope(parent);
|
||||
|
||||
Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QQmlContextWrapper>(context, scopeObject));
|
||||
Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocate<QQmlContextWrapper>(context, scopeObject));
|
||||
Heap::QmlContext *c = scope.engine->memoryManager->alloc<QmlContext>(parent, qml);
|
||||
Q_ASSERT(c->vtable() == staticVTable());
|
||||
return c;
|
||||
|
|
|
@ -248,7 +248,7 @@ ReturnedValue QObjectWrapper::getProperty(ExecutionEngine *engine, QObject *obje
|
|||
return QV4::QObjectMethod::create(global, object, property->coreIndex());
|
||||
} else if (property->isSignalHandler()) {
|
||||
QmlSignalHandler::initProto(engine);
|
||||
return engine->memoryManager->allocObject<QV4::QmlSignalHandler>(object, property->coreIndex())->asReturnedValue();
|
||||
return engine->memoryManager->allocate<QV4::QmlSignalHandler>(object, property->coreIndex())->asReturnedValue();
|
||||
} else {
|
||||
ExecutionContext *global = engine->rootContext();
|
||||
return QV4::QObjectMethod::create(global, object, property->coreIndex());
|
||||
|
@ -687,7 +687,7 @@ ReturnedValue QObjectWrapper::create(ExecutionEngine *engine, QObject *object)
|
|||
return result;
|
||||
}
|
||||
}
|
||||
return (engine->memoryManager->allocObject<QV4::QObjectWrapper>(object))->asReturnedValue();
|
||||
return (engine->memoryManager->allocate<QV4::QObjectWrapper>(object))->asReturnedValue();
|
||||
}
|
||||
|
||||
QV4::ReturnedValue QObjectWrapper::get(const Managed *m, String *name, bool *hasProperty)
|
||||
|
@ -1840,7 +1840,7 @@ QV4::ReturnedValue CallArgument::toValue(QV4::ExecutionEngine *engine)
|
|||
ReturnedValue QObjectMethod::create(ExecutionContext *scope, QObject *object, int index)
|
||||
{
|
||||
Scope valueScope(scope);
|
||||
Scoped<QObjectMethod> method(valueScope, valueScope.engine->memoryManager->allocObject<QObjectMethod>(scope));
|
||||
Scoped<QObjectMethod> method(valueScope, valueScope.engine->memoryManager->allocate<QObjectMethod>(scope));
|
||||
method->d()->setObject(object);
|
||||
|
||||
if (QQmlData *ddata = QQmlData::get(object))
|
||||
|
@ -1853,7 +1853,7 @@ ReturnedValue QObjectMethod::create(ExecutionContext *scope, QObject *object, in
|
|||
ReturnedValue QObjectMethod::create(ExecutionContext *scope, const QQmlValueTypeWrapper *valueType, int index)
|
||||
{
|
||||
Scope valueScope(scope);
|
||||
Scoped<QObjectMethod> method(valueScope, valueScope.engine->memoryManager->allocObject<QObjectMethod>(scope));
|
||||
Scoped<QObjectMethod> method(valueScope, valueScope.engine->memoryManager->allocate<QObjectMethod>(scope));
|
||||
method->d()->setPropertyCache(valueType->d()->propertyCache());
|
||||
method->d()->index = index;
|
||||
method->d()->valueTypeWrapper.set(valueScope.engine, valueType->d());
|
||||
|
@ -2026,7 +2026,7 @@ void Heap::QMetaObjectWrapper::ensureConstructorsCache() {
|
|||
ReturnedValue QMetaObjectWrapper::create(ExecutionEngine *engine, const QMetaObject* metaObject) {
|
||||
|
||||
QV4::Scope scope(engine);
|
||||
Scoped<QMetaObjectWrapper> mo(scope, engine->memoryManager->allocObject<QV4::QMetaObjectWrapper>(metaObject)->asReturnedValue());
|
||||
Scoped<QMetaObjectWrapper> mo(scope, engine->memoryManager->allocate<QV4::QMetaObjectWrapper>(metaObject)->asReturnedValue());
|
||||
mo->init(engine);
|
||||
return mo->asReturnedValue();
|
||||
}
|
||||
|
|
|
@ -691,7 +691,7 @@ bool SequencePrototype::isSequenceType(int sequenceTypeId)
|
|||
|
||||
#define NEW_REFERENCE_SEQUENCE(ElementType, ElementTypeName, SequenceType, unused) \
|
||||
if (sequenceType == qMetaTypeId<SequenceType>()) { \
|
||||
QV4::ScopedObject obj(scope, engine->memoryManager->allocObject<QQml##ElementTypeName##List>(object, propertyIndex)); \
|
||||
QV4::ScopedObject obj(scope, engine->memoryManager->allocate<QQml##ElementTypeName##List>(object, propertyIndex)); \
|
||||
return obj.asReturnedValue(); \
|
||||
} else
|
||||
|
||||
|
@ -709,7 +709,7 @@ ReturnedValue SequencePrototype::newSequence(QV4::ExecutionEngine *engine, int s
|
|||
|
||||
#define NEW_COPY_SEQUENCE(ElementType, ElementTypeName, SequenceType, unused) \
|
||||
if (sequenceType == qMetaTypeId<SequenceType>()) { \
|
||||
QV4::ScopedObject obj(scope, engine->memoryManager->allocObject<QQml##ElementTypeName##List>(v.value<SequenceType >())); \
|
||||
QV4::ScopedObject obj(scope, engine->memoryManager->allocate<QQml##ElementTypeName##List>(v.value<SequenceType >())); \
|
||||
return obj.asReturnedValue(); \
|
||||
} else
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ public:
|
|||
}
|
||||
|
||||
template <typename ObjectType, typename... Args>
|
||||
typename ObjectType::Data *allocObject(Args... args)
|
||||
typename ObjectType::Data *allocate(Args... args)
|
||||
{
|
||||
Scope scope(engine);
|
||||
Scoped<ObjectType> t(scope, allocateObject<ObjectType>());
|
||||
|
|
|
@ -1421,7 +1421,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args)
|
|||
|
||||
QQmlComponentExtension *e = componentExtension(args->v4engine());
|
||||
|
||||
QV4::Scoped<QV4::QmlIncubatorObject> r(scope, v4->memoryManager->allocObject<QV4::QmlIncubatorObject>(mode));
|
||||
QV4::Scoped<QV4::QmlIncubatorObject> r(scope, v4->memoryManager->allocate<QV4::QmlIncubatorObject>(mode));
|
||||
QV4::ScopedObject p(scope, e->incubationProto.value());
|
||||
r->setPrototype(p);
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ ReturnedValue QmlListWrapper::create(ExecutionEngine *engine, QObject *object, i
|
|||
|
||||
Scope scope(engine);
|
||||
|
||||
Scoped<QmlListWrapper> r(scope, engine->memoryManager->allocObject<QmlListWrapper>());
|
||||
Scoped<QmlListWrapper> r(scope, engine->memoryManager->allocate<QmlListWrapper>());
|
||||
r->d()->object = object;
|
||||
r->d()->propertyType = propType;
|
||||
void *args[] = { &r->d()->property(), nullptr };
|
||||
|
@ -86,7 +86,7 @@ ReturnedValue QmlListWrapper::create(ExecutionEngine *engine, const QQmlListProp
|
|||
{
|
||||
Scope scope(engine);
|
||||
|
||||
Scoped<QmlListWrapper> r(scope, engine->memoryManager->allocObject<QmlListWrapper>());
|
||||
Scoped<QmlListWrapper> r(scope, engine->memoryManager->allocate<QmlListWrapper>());
|
||||
r->d()->object = prop.object;
|
||||
r->d()->property() = prop;
|
||||
r->d()->propertyType = propType;
|
||||
|
|
|
@ -825,7 +825,7 @@ QV4::ReturnedValue QQmlLocale::wrap(ExecutionEngine *v4, const QLocale &locale)
|
|||
{
|
||||
QV4::Scope scope(v4);
|
||||
QV4LocaleDataDeletable *d = localeV4Data(scope.engine);
|
||||
QV4::Scoped<QQmlLocaleData> wrapper(scope, v4->memoryManager->allocObject<QQmlLocaleData>());
|
||||
QV4::Scoped<QQmlLocaleData> wrapper(scope, v4->memoryManager->allocate<QQmlLocaleData>());
|
||||
*wrapper->d()->locale = locale;
|
||||
QV4::ScopedObject p(scope, d->prototype.value());
|
||||
wrapper->setPrototype(p);
|
||||
|
|
|
@ -111,7 +111,7 @@ ReturnedValue QQmlTypeWrapper::create(QV4::ExecutionEngine *engine, QObject *o,
|
|||
Q_ASSERT(t.isValid());
|
||||
Scope scope(engine);
|
||||
|
||||
Scoped<QQmlTypeWrapper> w(scope, engine->memoryManager->allocObject<QQmlTypeWrapper>());
|
||||
Scoped<QQmlTypeWrapper> w(scope, engine->memoryManager->allocate<QQmlTypeWrapper>());
|
||||
w->d()->mode = mode; w->d()->object = o;
|
||||
w->d()->typePrivate = t.priv();
|
||||
QQmlType::refHandle(w->d()->typePrivate);
|
||||
|
@ -127,7 +127,7 @@ ReturnedValue QQmlTypeWrapper::create(QV4::ExecutionEngine *engine, QObject *o,
|
|||
Q_ASSERT(importNamespace);
|
||||
Scope scope(engine);
|
||||
|
||||
Scoped<QQmlTypeWrapper> w(scope, engine->memoryManager->allocObject<QQmlTypeWrapper>());
|
||||
Scoped<QQmlTypeWrapper> w(scope, engine->memoryManager->allocate<QQmlTypeWrapper>());
|
||||
w->d()->mode = mode; w->d()->object = o; w->d()->typeNamespace = t; w->d()->importNamespace = importNamespace;
|
||||
t->addref();
|
||||
return w.asReturnedValue();
|
||||
|
@ -232,7 +232,7 @@ ReturnedValue QQmlTypeWrapper::get(const Managed *m, String *name, bool *hasProp
|
|||
|
||||
value = type.scopedEnumIndex(QQmlEnginePrivate::get(v4->qmlEngine()), name, &ok);
|
||||
if (ok) {
|
||||
Scoped<QQmlScopedEnumWrapper> enumWrapper(scope, v4->memoryManager->allocObject<QQmlScopedEnumWrapper>());
|
||||
Scoped<QQmlScopedEnumWrapper> enumWrapper(scope, v4->memoryManager->allocate<QQmlScopedEnumWrapper>());
|
||||
enumWrapper->d()->typePrivate = type.priv();
|
||||
QQmlType::refHandle(enumWrapper->d()->typePrivate);
|
||||
enumWrapper->d()->scopeEnumIndex = value;
|
||||
|
|
|
@ -186,7 +186,7 @@ ReturnedValue QQmlValueTypeWrapper::create(ExecutionEngine *engine, QObject *obj
|
|||
Scope scope(engine);
|
||||
initProto(engine);
|
||||
|
||||
Scoped<QQmlValueTypeReference> r(scope, engine->memoryManager->allocObject<QQmlValueTypeReference>());
|
||||
Scoped<QQmlValueTypeReference> r(scope, engine->memoryManager->allocate<QQmlValueTypeReference>());
|
||||
r->d()->object = object;
|
||||
r->d()->property = property;
|
||||
r->d()->setPropertyCache(QJSEnginePrivate::get(engine)->cache(metaObject));
|
||||
|
@ -200,7 +200,7 @@ ReturnedValue QQmlValueTypeWrapper::create(ExecutionEngine *engine, const QVaria
|
|||
Scope scope(engine);
|
||||
initProto(engine);
|
||||
|
||||
Scoped<QQmlValueTypeWrapper> r(scope, engine->memoryManager->allocObject<QQmlValueTypeWrapper>());
|
||||
Scoped<QQmlValueTypeWrapper> r(scope, engine->memoryManager->allocate<QQmlValueTypeWrapper>());
|
||||
r->d()->setPropertyCache(QJSEnginePrivate::get(engine)->cache(metaObject));
|
||||
r->d()->valueType = QQmlValueTypeFactory::valueType(typeId);
|
||||
r->d()->gadgetPtr = nullptr;
|
||||
|
|
|
@ -595,7 +595,7 @@ ReturnedValue NodePrototype::getProto(ExecutionEngine *v4)
|
|||
Scope scope(v4);
|
||||
QQmlXMLHttpRequestData *d = xhrdata(v4);
|
||||
if (d->nodePrototype.isUndefined()) {
|
||||
ScopedObject p(scope, v4->memoryManager->allocObject<NodePrototype>());
|
||||
ScopedObject p(scope, v4->memoryManager->allocate<NodePrototype>());
|
||||
d->nodePrototype.set(v4, p);
|
||||
v4->v8Engine->freezeObject(p);
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ ReturnedValue Node::create(ExecutionEngine *v4, NodeImpl *data)
|
|||
{
|
||||
Scope scope(v4);
|
||||
|
||||
Scoped<Node> instance(scope, v4->memoryManager->allocObject<Node>(data));
|
||||
Scoped<Node> instance(scope, v4->memoryManager->allocate<Node>(data));
|
||||
ScopedObject p(scope);
|
||||
|
||||
switch (data->type) {
|
||||
|
@ -876,7 +876,7 @@ ReturnedValue Document::load(ExecutionEngine *v4, const QByteArray &data)
|
|||
return Encode::null();
|
||||
}
|
||||
|
||||
ScopedObject instance(scope, v4->memoryManager->allocObject<Node>(document));
|
||||
ScopedObject instance(scope, v4->memoryManager->allocate<Node>(document));
|
||||
document->release(); // the GC should own the NodeImpl via Node now
|
||||
ScopedObject p(scope);
|
||||
instance->setPrototype((p = Document::prototype(v4)));
|
||||
|
@ -930,7 +930,7 @@ ReturnedValue NamedNodeMap::get(const Managed *m, String *name, bool *hasPropert
|
|||
|
||||
ReturnedValue NamedNodeMap::create(ExecutionEngine *v4, NodeImpl *data, const QList<NodeImpl *> &list)
|
||||
{
|
||||
return (v4->memoryManager->allocObject<NamedNodeMap>(data, list))->asReturnedValue();
|
||||
return (v4->memoryManager->allocate<NamedNodeMap>(data, list))->asReturnedValue();
|
||||
}
|
||||
|
||||
ReturnedValue NodeList::getIndexed(const Managed *m, uint index, bool *hasProperty)
|
||||
|
@ -964,7 +964,7 @@ ReturnedValue NodeList::get(const Managed *m, String *name, bool *hasProperty)
|
|||
|
||||
ReturnedValue NodeList::create(ExecutionEngine *v4, NodeImpl *data)
|
||||
{
|
||||
return (v4->memoryManager->allocObject<NodeList>(data))->asReturnedValue();
|
||||
return (v4->memoryManager->allocate<NodeList>(data))->asReturnedValue();
|
||||
}
|
||||
|
||||
ReturnedValue Document::method_documentElement(const FunctionObject *b, const Value *thisObject, const Value *, int)
|
||||
|
@ -1643,7 +1643,7 @@ struct QQmlXMLHttpRequestCtor : public FunctionObject
|
|||
const QQmlXMLHttpRequestCtor *ctor = static_cast<const QQmlXMLHttpRequestCtor *>(f);
|
||||
|
||||
QQmlXMLHttpRequest *r = new QQmlXMLHttpRequest(scope.engine->v8Engine->networkAccessManager(), scope.engine);
|
||||
Scoped<QQmlXMLHttpRequestWrapper> w(scope, scope.engine->memoryManager->allocObject<QQmlXMLHttpRequestWrapper>(r));
|
||||
Scoped<QQmlXMLHttpRequestWrapper> w(scope, scope.engine->memoryManager->allocate<QQmlXMLHttpRequestWrapper>(r));
|
||||
ScopedObject proto(scope, ctor->d()->proto);
|
||||
w->setPrototype(proto);
|
||||
return w.asReturnedValue();
|
||||
|
@ -2049,7 +2049,7 @@ void *qt_add_qmlxmlhttprequest(ExecutionEngine *v4)
|
|||
{
|
||||
Scope scope(v4);
|
||||
|
||||
Scoped<QQmlXMLHttpRequestCtor> ctor(scope, v4->memoryManager->allocObject<QQmlXMLHttpRequestCtor>(v4));
|
||||
Scoped<QQmlXMLHttpRequestCtor> ctor(scope, v4->memoryManager->allocate<QQmlXMLHttpRequestCtor>(v4));
|
||||
ScopedString s(scope, v4->newString(QStringLiteral("XMLHttpRequest")));
|
||||
v4->globalObject->defineReadonlyProperty(s, ctor);
|
||||
|
||||
|
|
|
@ -1418,7 +1418,7 @@ ReturnedValue QtObject::method_binding(const FunctionObject *b, const Value *, c
|
|||
if (!f)
|
||||
THROW_TYPE_ERROR_WITH_MESSAGE("binding(): argument (binding expression) must be a function");
|
||||
|
||||
return Encode(scope.engine->memoryManager->allocObject<QQmlBindingFunction>(f));
|
||||
return Encode(scope.engine->memoryManager->allocate<QQmlBindingFunction>(f));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1797,7 +1797,7 @@ void QV4::GlobalExtensions::init(Object *globalObject, QJSEngine::Extensions ext
|
|||
globalObject->defineDefaultProperty(QStringLiteral("print"), QV4::ConsoleObject::method_log);
|
||||
|
||||
|
||||
QV4::ScopedObject console(scope, globalObject->engine()->memoryManager->allocObject<QV4::ConsoleObject>());
|
||||
QV4::ScopedObject console(scope, globalObject->engine()->memoryManager->allocate<QV4::ConsoleObject>());
|
||||
globalObject->defineDefaultProperty(QStringLiteral("console"), console);
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ void QV8Engine::initializeGlobal()
|
|||
QV4::Scope scope(m_v4Engine);
|
||||
QV4::GlobalExtensions::init(m_v4Engine->globalObject, QJSEngine::AllExtensions);
|
||||
|
||||
QV4::ScopedObject qt(scope, m_v4Engine->memoryManager->allocObject<QV4::QtObject>(m_engine));
|
||||
QV4::ScopedObject qt(scope, m_v4Engine->memoryManager->allocate<QV4::QtObject>(m_engine));
|
||||
m_v4Engine->globalObject->defineDefaultProperty(QStringLiteral("Qt"), qt);
|
||||
|
||||
#if QT_CONFIG(qml_locale)
|
||||
|
|
|
@ -93,7 +93,7 @@ struct DelegateModelGroupFunction : QV4::FunctionObject
|
|||
|
||||
static Heap::DelegateModelGroupFunction *create(QV4::ExecutionContext *scope, uint flag, QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg))
|
||||
{
|
||||
return scope->engine()->memoryManager->allocObject<DelegateModelGroupFunction>(scope, flag, code);
|
||||
return scope->engine()->memoryManager->allocate<DelegateModelGroupFunction>(scope, flag, code);
|
||||
}
|
||||
|
||||
static ReturnedValue call(const QV4::FunctionObject *that, const Value *thisObject, const Value *argv, int argc)
|
||||
|
@ -2521,7 +2521,7 @@ QQmlV4Handle QQmlDelegateModelGroup::get(int index)
|
|||
model->m_cacheMetaType->initializePrototype();
|
||||
QV4::ExecutionEngine *v4 = model->m_cacheMetaType->v4Engine;
|
||||
QV4::Scope scope(v4);
|
||||
QV4::ScopedObject o(scope, v4->memoryManager->allocObject<QQmlDelegateModelItemObject>(cacheItem));
|
||||
QV4::ScopedObject o(scope, v4->memoryManager->allocate<QQmlDelegateModelItemObject>(cacheItem));
|
||||
QV4::ScopedObject p(scope, model->m_cacheMetaType->modelItemProto.value());
|
||||
o->setPrototype(p);
|
||||
++cacheItem->scriptRef;
|
||||
|
@ -3279,7 +3279,7 @@ struct QQmlDelegateModelGroupChange : QV4::Object
|
|||
V4_OBJECT2(QQmlDelegateModelGroupChange, QV4::Object)
|
||||
|
||||
static QV4::Heap::QQmlDelegateModelGroupChange *create(QV4::ExecutionEngine *e) {
|
||||
return e->memoryManager->allocObject<QQmlDelegateModelGroupChange>();
|
||||
return e->memoryManager->allocate<QQmlDelegateModelGroupChange>();
|
||||
}
|
||||
|
||||
static QV4::ReturnedValue method_get_index(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) {
|
||||
|
@ -3316,7 +3316,7 @@ struct QQmlDelegateModelGroupChangeArray : public QV4::Object
|
|||
public:
|
||||
static QV4::Heap::QQmlDelegateModelGroupChangeArray *create(QV4::ExecutionEngine *engine, const QVector<QQmlChangeSet::Change> &changes)
|
||||
{
|
||||
return engine->memoryManager->allocObject<QQmlDelegateModelGroupChangeArray>(changes);
|
||||
return engine->memoryManager->allocate<QQmlDelegateModelGroupChangeArray>(changes);
|
||||
}
|
||||
|
||||
quint32 count() const { return d()->changes->count(); }
|
||||
|
|
|
@ -2434,7 +2434,7 @@ QQmlV4Handle QQmlListModel::get(int index) const
|
|||
QObject *object = m_listModel->getOrCreateModelObject(const_cast<QQmlListModel *>(this), index);
|
||||
QQmlData *ddata = QQmlData::get(object);
|
||||
if (ddata->jsWrapper.isNullOrUndefined()) {
|
||||
result = scope.engine->memoryManager->allocObject<QV4::ModelObject>(object, const_cast<QQmlListModel *>(this));
|
||||
result = scope.engine->memoryManager->allocate<QV4::ModelObject>(object, const_cast<QQmlListModel *>(this));
|
||||
// Keep track of the QObjectWrapper in persistent value storage
|
||||
ddata->jsWrapper.set(scope.engine, result);
|
||||
} else {
|
||||
|
|
|
@ -228,8 +228,8 @@ public:
|
|||
|
||||
QV4::ScopedString name(scope, v4->newString(QString::fromUtf8(propertyName)));
|
||||
QV4::ExecutionContext *global = v4->rootContext();
|
||||
QV4::ScopedFunctionObject g(scope, v4->memoryManager->allocObject<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::get_property));
|
||||
QV4::ScopedFunctionObject s(scope, v4->memoryManager->allocObject<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::set_property));
|
||||
QV4::ScopedFunctionObject g(scope, v4->memoryManager->allocate<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::get_property));
|
||||
QV4::ScopedFunctionObject s(scope, v4->memoryManager->allocate<QV4::IndexedBuiltinFunction>(global, propertyId, QQmlDMCachedModelData::set_property));
|
||||
p->setGetter(g);
|
||||
p->setSetter(s);
|
||||
proto->insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable);
|
||||
|
@ -442,7 +442,7 @@ public:
|
|||
}
|
||||
QV4::Scope scope(v4);
|
||||
QV4::ScopedObject proto(scope, type->prototype.value());
|
||||
QV4::ScopedObject o(scope, proto->engine()->memoryManager->allocObject<QQmlDelegateModelItemObject>(this));
|
||||
QV4::ScopedObject o(scope, proto->engine()->memoryManager->allocate<QQmlDelegateModelItemObject>(this));
|
||||
o->setPrototype(proto);
|
||||
++scriptRef;
|
||||
return o.asReturnedValue();
|
||||
|
@ -648,7 +648,7 @@ public:
|
|||
{
|
||||
QQmlAdaptorModelEngineData *data = engineData(v4);
|
||||
QV4::Scope scope(v4);
|
||||
QV4::ScopedObject o(scope, v4->memoryManager->allocObject<QQmlDelegateModelItemObject>(this));
|
||||
QV4::ScopedObject o(scope, v4->memoryManager->allocate<QQmlDelegateModelItemObject>(this));
|
||||
QV4::ScopedObject p(scope, data->listItemProto.value());
|
||||
o->setPrototype(p);
|
||||
++scriptRef;
|
||||
|
|
|
@ -596,7 +596,7 @@ public:
|
|||
static QV4::Heap::QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine)
|
||||
{
|
||||
QV4::Scope scope(engine);
|
||||
QV4::Scoped<QQuickJSContext2DPrototype> o(scope, engine->memoryManager->allocObject<QQuickJSContext2DPrototype>());
|
||||
QV4::Scoped<QQuickJSContext2DPrototype> o(scope, engine->memoryManager->allocate<QQuickJSContext2DPrototype>());
|
||||
|
||||
o->defineDefaultProperty(QStringLiteral("quadraticCurveTo"), method_quadraticCurveTo, 0);
|
||||
o->defineDefaultProperty(QStringLiteral("restore"), method_restore, 0);
|
||||
|
@ -954,7 +954,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionE
|
|||
{
|
||||
QV4::Scope scope(v4);
|
||||
QQuickContext2DEngineData *ed = engineData(scope.engine);
|
||||
QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, scope.engine->memoryManager->allocObject<QQuickJSContext2DPixelData>());
|
||||
QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, scope.engine->memoryManager->allocate<QQuickJSContext2DPixelData>());
|
||||
QV4::ScopedObject p(scope, ed->pixelArrayProto.value());
|
||||
pixelData->setPrototype(p);
|
||||
|
||||
|
@ -966,7 +966,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionE
|
|||
*pixelData->d()->image = image.format() == QImage::Format_ARGB32 ? image : image.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
|
||||
QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, scope.engine->memoryManager->allocObject<QQuickJSContext2DImageData>());
|
||||
QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, scope.engine->memoryManager->allocate<QQuickJSContext2DImageData>());
|
||||
imageData->d()->pixelData = pixelData.asReturnedValue();
|
||||
return imageData.asReturnedValue();
|
||||
}
|
||||
|
@ -1582,7 +1582,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(const
|
|||
}
|
||||
QQuickContext2DEngineData *ed = engineData(scope.engine);
|
||||
|
||||
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
|
||||
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>());
|
||||
QV4::ScopedObject p(scope, ed->gradientProto.value());
|
||||
gradient->setPrototype(p);
|
||||
*gradient->d()->brush = QLinearGradient(x0, y0, x1, y1);
|
||||
|
@ -1634,7 +1634,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(const
|
|||
|
||||
QQuickContext2DEngineData *ed = engineData(scope.engine);
|
||||
|
||||
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
|
||||
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>());
|
||||
QV4::ScopedObject p(scope, ed->gradientProto.value());
|
||||
gradient->setPrototype(p);
|
||||
*gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r0+r1, QPointF(x0, y0));
|
||||
|
@ -1678,7 +1678,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(cons
|
|||
|
||||
QQuickContext2DEngineData *ed = engineData(scope.engine);
|
||||
|
||||
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
|
||||
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>());
|
||||
QV4::ScopedObject p(scope, ed->gradientProto.value());
|
||||
gradient->setPrototype(p);
|
||||
*gradient->d()->brush = QConicalGradient(x, y, angle);
|
||||
|
@ -1738,7 +1738,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(const QV4::F
|
|||
CHECK_CONTEXT(r)
|
||||
|
||||
if (argc >= 2) {
|
||||
QV4::Scoped<QQuickContext2DStyle> pattern(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
|
||||
QV4::Scoped<QQuickContext2DStyle> pattern(scope, scope.engine->memoryManager->allocate<QQuickContext2DStyle>());
|
||||
|
||||
QColor color = scope.engine->toVariant(argv[0], qMetaTypeId<QColor>()).value<QColor>();
|
||||
if (color.isValid()) {
|
||||
|
@ -4399,7 +4399,7 @@ void QQuickContext2D::setV4Engine(QV4::ExecutionEngine *engine)
|
|||
|
||||
QQuickContext2DEngineData *ed = engineData(engine);
|
||||
QV4::Scope scope(engine);
|
||||
QV4::Scoped<QQuickJSContext2D> wrapper(scope, engine->memoryManager->allocObject<QQuickJSContext2D>());
|
||||
QV4::Scoped<QQuickJSContext2D> wrapper(scope, engine->memoryManager->allocate<QQuickJSContext2D>());
|
||||
QV4::ScopedObject p(scope, ed->contextPrototype.value());
|
||||
wrapper->setPrototype(p);
|
||||
wrapper->d()->context = this;
|
||||
|
|
|
@ -8677,7 +8677,7 @@ void QV4::Heap::QQuickItemWrapper::markObjects(QV4::Heap::Base *that, QV4::MarkS
|
|||
|
||||
quint64 QQuickItemPrivate::_q_createJSWrapper(QV4::ExecutionEngine *engine)
|
||||
{
|
||||
return (engine->memoryManager->allocObject<QQuickItemWrapper>(q_func()))->asReturnedValue();
|
||||
return (engine->memoryManager->allocate<QQuickItemWrapper>(q_func()))->asReturnedValue();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
@ -7388,7 +7388,7 @@ void tst_qqmlecmascript::onDestructionViaGC()
|
|||
QVERIFY2(!weakReferenceMutator.isNull(), qPrintable(component.errorString()));
|
||||
weakReferenceMutator->init(v4, weakRef.data(), &mutatorResult);
|
||||
|
||||
v4->memoryManager->allocObject<QV4::WeakReferenceSentinel>(weakRef.data(), &sentinelResult);
|
||||
v4->memoryManager->allocate<QV4::WeakReferenceSentinel>(weakRef.data(), &sentinelResult);
|
||||
}
|
||||
gc(engine);
|
||||
|
||||
|
|
Loading…
Reference in New Issue