ReturnedValue QQmlSqlDatabaseWrapper::getIndexed(Managed *m, uint index, bool *hasProperty)
{
- QV4::Scope scope(m->engine());
+ QV4::Scope scope(static_cast<QQmlSqlDatabaseWrapper *>(m)->engine());
Q_ASSERT(m->as<QQmlSqlDatabaseWrapper>());
QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, static_cast<QQmlSqlDatabaseWrapper *>(m));
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Rows)
return Object::getIndexed(m, index, hasProperty);
- return qmlsqldatabase_rows_index(r, m->engine(), index, hasProperty);
+ return qmlsqldatabase_rows_index(r, scope.engine, index, hasProperty);
}
static ReturnedValue qmlsqldatabase_rows_item(CallContext *ctx)
ReturnedValue ArgumentsGetterFunction::call(Managed *getter, CallData *callData)
{
- ExecutionEngine *v4 = getter->engine();
+ ExecutionEngine *v4 = static_cast<ArgumentsGetterFunction *>(getter)->engine();
Scope scope(v4);
Scoped<ArgumentsGetterFunction> g(scope, static_cast<ArgumentsGetterFunction *>(getter));
Scoped<ArgumentsObject> o(scope, callData->thisObject.as<ArgumentsObject>());
ReturnedValue ArgumentsSetterFunction::call(Managed *setter, CallData *callData)
{
- ExecutionEngine *v4 = setter->engine();
+ ExecutionEngine *v4 = static_cast<ArgumentsSetterFunction *>(setter)->engine();
Scope scope(v4);
Scoped<ArgumentsSetterFunction> s(scope, static_cast<ArgumentsSetterFunction *>(setter));
Scoped<ArgumentsObject> o(scope, callData->thisObject.as<ArgumentsObject>());
ReturnedValue ArrayBufferCtor::construct(Managed *m, CallData *callData)
{
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = static_cast<Object *>(m)->engine();
Scope scope(v4);
ScopedValue l(scope, callData->argument(0));
ReturnedValue ArrayCtor::construct(Managed *m, CallData *callData)
{
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = static_cast<ArrayCtor *>(m)->engine();
Scope scope(v4);
ScopedArrayObject a(scope, v4->newArrayObject());
uint len;
ReturnedValue BooleanCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<BooleanCtor *>(m)->engine());
bool n = callData->argc ? callData->args[0].toBoolean() : false;
ScopedValue b(scope, QV4::Primitive::fromBoolean(n));
- return Encode(m->engine()->newBooleanObject(b));
+ return Encode(scope.engine->newBooleanObject(b));
}
ReturnedValue BooleanCtor::call(Managed *, CallData *callData)
V4_MANAGED(ExecutionContext, Managed)
Q_MANAGED_TYPE(ExecutionContext)
+ ExecutionEngine *engine() const { return d()->engine; }
+
Heap::CallContext *newCallContext(FunctionObject *f, CallData *callData);
Heap::WithContext *newWithContext(Object *with);
Heap::CatchContext *newCatchContext(String *exceptionVarName, const ValueRef exceptionValue);
ReturnedValue DataViewCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<Object *>(m)->engine());
Scoped<ArrayBuffer> buffer(scope, callData->argument(0));
if (!buffer)
return scope.engine->throwTypeError();
ReturnedValue DateCtor::construct(Managed *m, CallData *callData)
{
+ Scope scope(static_cast<DateCtor *>(m)->engine());
double t = 0;
if (callData->argc == 0)
t = currentTime();
else if (callData->argc == 1) {
- Scope scope(m->engine());
ScopedValue arg(scope, callData->args[0]);
if (DateObject *d = arg->asDateObject())
arg = d->date();
t = TimeClip(UTC(t));
}
- return Encode(m->engine()->newDateObject(Primitive::fromDouble(t)));
+ return Encode(scope.engine->newDateObject(Primitive::fromDouble(t)));
}
ReturnedValue DateCtor::call(Managed *m, CallData *)
{
double t = currentTime();
- return m->engine()->newString(ToString(t))->asReturnedValue();
+ return static_cast<DateCtor *>(m)->engine()->newString(ToString(t))->asReturnedValue();
}
void DatePrototype::init(ExecutionEngine *engine, Object *ctor)
ReturnedValue ErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<ErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return Encode(m->engine()->newErrorObject(v));
+ return Encode(scope.engine->newErrorObject(v));
}
ReturnedValue ErrorCtor::call(Managed *that, CallData *callData)
ReturnedValue EvalErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<EvalErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return (m->engine()->memoryManager->alloc<EvalErrorObject>(m->engine(), v))->asReturnedValue();
+ return (scope.engine->memoryManager->alloc<EvalErrorObject>(scope.engine, v))->asReturnedValue();
}
Heap::RangeErrorCtor::RangeErrorCtor(QV4::ExecutionContext *scope)
ReturnedValue RangeErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<RangeErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return (m->engine()->memoryManager->alloc<RangeErrorObject>(scope.engine, v))->asReturnedValue();
+ return (scope.engine->memoryManager->alloc<RangeErrorObject>(scope.engine, v))->asReturnedValue();
}
Heap::ReferenceErrorCtor::ReferenceErrorCtor(QV4::ExecutionContext *scope)
ReturnedValue ReferenceErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<ReferenceErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return (m->engine()->memoryManager->alloc<ReferenceErrorObject>(scope.engine, v))->asReturnedValue();
+ return (scope.engine->memoryManager->alloc<ReferenceErrorObject>(scope.engine, v))->asReturnedValue();
}
Heap::SyntaxErrorCtor::SyntaxErrorCtor(QV4::ExecutionContext *scope)
ReturnedValue SyntaxErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<SyntaxErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return (m->engine()->memoryManager->alloc<SyntaxErrorObject>(scope.engine, v))->asReturnedValue();
+ return (scope.engine->memoryManager->alloc<SyntaxErrorObject>(scope.engine, v))->asReturnedValue();
}
Heap::TypeErrorCtor::TypeErrorCtor(QV4::ExecutionContext *scope)
ReturnedValue TypeErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<TypeErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return (m->engine()->memoryManager->alloc<TypeErrorObject>(scope.engine, v))->asReturnedValue();
+ return (scope.engine->memoryManager->alloc<TypeErrorObject>(scope.engine, v))->asReturnedValue();
}
Heap::URIErrorCtor::URIErrorCtor(QV4::ExecutionContext *scope)
ReturnedValue URIErrorCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<URIErrorCtor *>(m)->engine());
ScopedValue v(scope, callData->argument(0));
- return (m->engine()->memoryManager->alloc<URIErrorObject>(scope.engine, v))->asReturnedValue();
+ return (scope.engine->memoryManager->alloc<URIErrorObject>(scope.engine, v))->asReturnedValue();
}
void ErrorPrototype::init(ExecutionEngine *engine, Object *ctor, Object *obj)
// 15.3.2
ReturnedValue FunctionCtor::construct(Managed *that, CallData *callData)
{
- Scope scope(that->engine());
+ Scope scope(static_cast<Object *>(that)->engine());
Scoped<FunctionCtor> f(scope, static_cast<FunctionCtor *>(that));
ScopedContext ctx(scope, scope.engine->currentContext());
QString arguments;
ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
+ ExecutionEngine *v4 = static_cast<Object *>(that)->engine();
if (v4->hasException)
return Encode::undefined();
CHECK_STACK_LIMITS(v4);
ReturnedValue ScriptFunction::call(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
+ ExecutionEngine *v4 = static_cast<Object *>(that)->engine();
if (v4->hasException)
return Encode::undefined();
CHECK_STACK_LIMITS(v4);
ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
+ ExecutionEngine *v4 = static_cast<Object *>(that)->engine();
if (v4->hasException)
return Encode::undefined();
CHECK_STACK_LIMITS(v4);
static ReturnedValue construct(Managed *m, CallData *)
{
- return m->engine()->throwTypeError();
+ return static_cast<IndexedBuiltinFunction *>(m)->engine()->throwTypeError();
}
static ReturnedValue call(Managed *that, CallData *callData);
};
-ExecutionEngine *Managed::engine() const
-{
- return internalClass()->engine;
-}
-
QString Managed::className() const
{
const char *s = 0;
};
Q_MANAGED_TYPE(Invalid)
- ExecutionEngine *engine() const;
-
template <typename T>
T *as() {
Q_ASSERT(internalClass());
ReturnedValue NumberCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<NumberCtor *>(m)->engine());
double dbl = callData->argc ? callData->args[0].toNumber() : 0.;
ScopedValue d(scope, QV4::Primitive::fromDouble(dbl));
- return Encode(m->engine()->newNumberObject(d));
+ return Encode(scope.engine->newNumberObject(d));
}
ReturnedValue NumberCtor::call(Managed *, CallData *callData)
ReturnedValue Object::construct(Managed *m, CallData *)
{
- return m->engine()->throwTypeError();
+ return static_cast<Object *>(m)->engine()->throwTypeError();
}
ReturnedValue Object::call(Managed *m, CallData *)
{
- return m->engine()->throwTypeError();
+ return static_cast<Object *>(m)->engine()->throwTypeError();
}
ReturnedValue Object::get(Managed *m, String *name, bool *hasProperty)
void Object::setLookup(Managed *m, Lookup *l, const ValueRef value)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<Object *>(m)->engine());
ScopedObject o(scope, static_cast<Object *>(m));
ScopedString name(scope, scope.engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]);
PropertyAttributes a = o->internalClass()->propertyData[it->memberIndex];
++it->memberIndex;
if (!(it->flags & ObjectIterator::EnumerableOnly) || a.isEnumerable()) {
- *name = m->engine()->newString(n->string);
+ *name = o->engine()->newString(n->string);
*attrs = a;
pd->copy(p, a);
return;
uint Object::getLength(const Managed *m)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<const Object *>(m)->engine());
ScopedValue v(scope, static_cast<Object *>(const_cast<Managed *>(m))->get(scope.engine->id_length));
return v->toUInt32();
}
ReturnedValue ArrayObject::getLookup(Managed *m, Lookup *l)
{
- Scope scope(m->engine());
- ScopedString name(scope, m->engine()->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]);
- if (name->equals(m->engine()->id_length)) {
+ Scope scope(static_cast<Object *>(m)->engine());
+ ScopedString name(scope, scope.engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]);
+ if (name->equals(scope.engine->id_length)) {
// special case, as the property is on the object itself
l->getter = Lookup::arrayLengthGetter;
ArrayObject *a = static_cast<ArrayObject *>(m);
ReturnedValue ObjectCtor::construct(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
- Scope scope(v4);
ObjectCtor *ctor = static_cast<ObjectCtor *>(that);
+ ExecutionEngine *v4 = ctor->engine();
+ Scope scope(v4);
if (!callData->argc || callData->args[0].isUndefined() || callData->args[0].isNull()) {
ScopedObject obj(scope, v4->newObject());
ScopedObject proto(scope, ctor->get(v4->id_prototype));
ReturnedValue ObjectCtor::call(Managed *m, CallData *callData)
{
+ ObjectCtor *ctor = static_cast<ObjectCtor *>(m);
+ ExecutionEngine *v4 = ctor->engine();
if (!callData->argc || callData->args[0].isUndefined() || callData->args[0].isNull())
- return m->engine()->newObject()->asReturnedValue();
- return RuntimeHelpers::toObject(m->engine(), ValueRef(&callData->args[0]));
+ return v4->newObject()->asReturnedValue();
+ return RuntimeHelpers::toObject(v4, ValueRef(&callData->args[0]));
}
void ObjectPrototype::init(ExecutionEngine *v4, Object *ctor)
QV4::ReturnedValue QObjectWrapper::get(Managed *m, String *name, bool *hasProperty)
{
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
- QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(m->engine());
+ QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(that->engine());
return that->getQmlProperty(qmlContext, name, IgnoreRevision, hasProperty, /*includeImports*/ true);
}
void QObjectWrapper::put(Managed *m, String *name, const ValueRef value)
{
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = that->engine();
if (v4->hasException || QQmlData::wasDeleted(that->d()->object))
return;
ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<Object *>(m)->engine());
ScopedContext ctx(scope, scope.engine->currentContext());
ScopedValue r(scope, callData->argument(0));
ReturnedValue QmlBindingWrapper::call(Managed *that, CallData *)
{
- ExecutionEngine *engine = that->engine();
+ ExecutionEngine *engine = static_cast<Object *>(that)->engine();
CHECK_STACK_LIMITS(engine);
Scope scope(engine);
bool StringObject::deleteIndexedProperty(Managed *m, uint index)
{
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = static_cast<StringObject *>(m)->engine();
Scope scope(v4);
Scoped<StringObject> o(scope, m->asStringObject());
- if (!o) {
- v4->throwTypeError();
- return false;
- }
+ Q_ASSERT(!!o);
if (index < static_cast<uint>(o->d()->value.stringValue()->toQString().length())) {
if (v4->currentContext()->strictMode)
ReturnedValue StringCtor::construct(Managed *m, CallData *callData)
{
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = static_cast<Object *>(m)->engine();
Scope scope(v4);
ScopedValue value(scope);
if (callData->argc)
ReturnedValue StringCtor::call(Managed *m, CallData *callData)
{
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = static_cast<Object *>(m)->engine();
Scope scope(v4);
ScopedValue value(scope);
if (callData->argc)
ReturnedValue TypedArrayCtor::construct(Managed *m, CallData *callData)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<Object *>(m)->engine());
Scoped<TypedArrayCtor> that(scope, static_cast<TypedArrayCtor *>(m));
if (!callData->argc || !callData->args[0].isObject()) {
ReturnedValue TypedArray::getIndexed(Managed *m, uint index, bool *hasProperty)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<Object *>(m)->engine());
Scoped<TypedArray> a(scope, static_cast<TypedArray *>(m));
uint bytesPerElement = a->d()->type->bytesPerElement;
void TypedArray::putIndexed(Managed *m, uint index, const ValueRef value)
{
- if (m->engine()->hasException)
+ ExecutionEngine *v4 = static_cast<Object *>(m)->engine();
+ if (v4->hasException)
return;
- Scope scope(m->engine());
+ Scope scope(v4);
Scoped<TypedArray> a(scope, static_cast<TypedArray *>(m));
uint bytesPerElement = a->d()->type->bytesPerElement;
if (isString())
return RuntimeHelpers::stringToNumber(stringValue()->toQString());
{
- Scope scope(managed()->engine());
+ Q_ASSERT(isObject());
+ Scope scope(objectValue()->engine());
ScopedValue prim(scope, RuntimeHelpers::toPrimitive(ValueRef::fromRawValue(this), NUMBER_HINT));
if (scope.engine->hasException)
return 0;
if (isString())
return stringValue()->toQString();
{
- Scope scope(managed()->engine());
+ Q_ASSERT(isObject());
+ Scope scope(objectValue()->engine());
ScopedValue ex(scope);
bool caughtException = false;
ScopedValue prim(scope, RuntimeHelpers::toPrimitive(ValueRef::fromRawValue(this), STRING_HINT));
if (isString())
return stringValue()->toQString();
{
- Scope scope(managed()->engine());
+ Q_ASSERT(isObject());
+ Scope scope(objectValue()->engine());
ScopedValue prim(scope, RuntimeHelpers::toPrimitive(ValueRef::fromRawValue(this), STRING_HINT));
return prim->toQString();
}
ReturnedValue QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty)
{
Q_ASSERT(m->as<QmlContextWrapper>());
- QV4::ExecutionEngine *v4 = m->engine();
- QV4::Scope scope(v4);
QmlContextWrapper *resource = static_cast<QmlContextWrapper *>(m);
+ QV4::ExecutionEngine *v4 = resource->engine();
+ QV4::Scope scope(v4);
// In V8 the JS global object would come _before_ the QML global object,
// so simulate that here.
void QmlContextWrapper::put(Managed *m, String *name, const ValueRef value)
{
Q_ASSERT(m->as<QmlContextWrapper>());
- ExecutionEngine *v4 = m->engine();
+ QmlContextWrapper *resource = static_cast<QmlContextWrapper *>(m);
+ ExecutionEngine *v4 = resource->engine();
QV4::Scope scope(v4);
if (scope.hasException())
return;
- QV4::Scoped<QmlContextWrapper> wrapper(scope, static_cast<QmlContextWrapper *>(m));
+ QV4::Scoped<QmlContextWrapper> wrapper(scope, resource);
PropertyAttributes attrs;
Property *pd = wrapper->__getOwnProperty__(name, &attrs);
ReturnedValue QQmlIdObjectsArray::getIndexed(Managed *m, uint index, bool *hasProperty)
{
- Scope scope(m->engine());
+ Scope scope(static_cast<QV4::QQmlIdObjectsArray*>(m)->engine());
Scoped<QQmlIdObjectsArray> This(scope, static_cast<QV4::QQmlIdObjectsArray*>(m));
Scoped<QmlContextWrapper> contextWrapper(scope, This->d()->contextWrapper);
QQmlContextData *context = contextWrapper->getContext();
if (hasProperty)
*hasProperty = true;
- ExecutionEngine *v4 = m->engine();
- QQmlEnginePrivate *ep = v4->qmlEngine() ? QQmlEnginePrivate::get(v4->qmlEngine()) : 0;
+ QQmlEnginePrivate *ep = scope.engine->qmlEngine() ? QQmlEnginePrivate::get(scope.engine->qmlEngine()) : 0;
if (ep)
ep->captureProperty(&context->idValues[index].bindings);
ReturnedValue QmlListWrapper::get(Managed *m, String *name, bool *hasProperty)
{
Q_ASSERT(m->as<QmlListWrapper>());
- QV4::ExecutionEngine *v4 = m->engine();
QmlListWrapper *w = static_cast<QmlListWrapper *>(m);
+ QV4::ExecutionEngine *v4 = w->engine();
if (name->equals(v4->id_length) && !w->d()->object.isNull()) {
quint32 count = w->d()->property.count ? w->d()->property.count(&w->d()->property) : 0;
Q_UNUSED(hasProperty);
Q_ASSERT(m->as<QmlListWrapper>());
- QV4::ExecutionEngine *v4 = m->engine();
QmlListWrapper *w = static_cast<QmlListWrapper *>(m);
+ QV4::ExecutionEngine *v4 = w->engine();
quint32 count = w->d()->property.count ? w->d()->property.count(&w->d()->property) : 0;
if (index < count && w->d()->property.at) {
{
Q_ASSERT(m->as<QmlTypeWrapper>());
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = static_cast<QmlTypeWrapper *>(m)->engine();
QV4::Scope scope(v4);
- Scoped<QmlTypeWrapper> w(scope, static_cast<QmlTypeWrapper *>(m));
+ Scoped<QmlTypeWrapper> w(scope, static_cast<QmlTypeWrapper *>(m));
if (hasProperty)
*hasProperty = true;
{
Q_ASSERT(m->as<QmlTypeWrapper>());
QmlTypeWrapper *w = static_cast<QmlTypeWrapper *>(m);
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = w->engine();
if (v4->hasException)
return;
{
Q_ASSERT(m->as<QQmlValueTypeWrapper>());
QQmlValueTypeWrapper *r = static_cast<QQmlValueTypeWrapper *>(m);
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = r->engine();
// Note: readReferenceValue() can change the reference->type.
if (QQmlValueTypeReference *reference = r->as<QQmlValueTypeReference>()) {
void QQmlValueTypeWrapper::put(Managed *m, String *name, const ValueRef value)
{
Q_ASSERT(m->as<QQmlValueTypeWrapper>());
- ExecutionEngine *v4 = m->engine();
+ ExecutionEngine *v4 = static_cast<QQmlValueTypeWrapper *>(m)->engine();
Scope scope(v4);
if (scope.hasException())
return;
ReturnedValue NamedNodeMap::getIndexed(Managed *m, uint index, bool *hasProperty)
{
- QV4::ExecutionEngine *v4 = m->engine();
NamedNodeMap *r = m->as<NamedNodeMap>();
+ QV4::ExecutionEngine *v4 = r->engine();
if (!r) {
if (hasProperty)
*hasProperty = false;
{
Q_ASSERT(m->as<NamedNodeMap>());
NamedNodeMap *r = static_cast<NamedNodeMap *>(m);
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = r->engine();
name->makeIdentifier(v4);
if (name->equals(v4->id_length))
ReturnedValue NodeList::getIndexed(Managed *m, uint index, bool *hasProperty)
{
Q_ASSERT(m->as<NodeList>());
- QV4::ExecutionEngine *v4 = m->engine();
NodeList *r = static_cast<NodeList *>(m);
+ QV4::ExecutionEngine *v4 = r->engine();
if ((int)index < r->d()->d->children.count()) {
if (hasProperty)
ReturnedValue NodeList::get(Managed *m, String *name, bool *hasProperty)
{
Q_ASSERT(m->as<NodeList>());
- QV4::ExecutionEngine *v4 = m->engine();
NodeList *r = static_cast<NodeList *>(m);
+ QV4::ExecutionEngine *v4 = r->engine();
name->makeIdentifier(v4);
}
static ReturnedValue construct(Managed *that, QV4::CallData *)
{
- Scope scope(that->engine());
+ Scope scope(static_cast<QQmlXMLHttpRequestCtor *>(that)->engine());
Scoped<QQmlXMLHttpRequestCtor> ctor(scope, that->as<QQmlXMLHttpRequestCtor>());
if (!ctor)
- return that->engine()->throwTypeError();
+ return scope.engine->throwTypeError();
QQmlXMLHttpRequest *r = new QQmlXMLHttpRequest(scope.engine, scope.engine->v8Engine->networkAccessManager());
- Scoped<QQmlXMLHttpRequestWrapper> w(scope, that->engine()->memoryManager->alloc<QQmlXMLHttpRequestWrapper>(that->engine(), r));
+ Scoped<QQmlXMLHttpRequestWrapper> w(scope, scope.engine->memoryManager->alloc<QQmlXMLHttpRequestWrapper>(scope.engine, r));
ScopedObject proto(scope, ctor->d()->proto);
w->setPrototype(proto);
return w.asReturnedValue();
ReturnedValue QQmlBindingFunction::call(Managed *that, CallData *callData)
{
- Scope scope(that->engine());
+ Scope scope(static_cast<QQmlBindingFunction*>(that)->engine());
ScopedFunctionObject function(scope, static_cast<QQmlBindingFunction*>(that)->d()->originalFunction);
return function->call(callData);
}
static QV4::ReturnedValue construct(QV4::Managed *m, QV4::CallData *)
{
- return m->engine()->throwTypeError();
+ return static_cast<DelegateModelGroupFunction *>(m)->engine()->throwTypeError();
}
static QV4::ReturnedValue call(QV4::Managed *that, QV4::CallData *callData)
{
- QV4::ExecutionEngine *v4 = that->engine();
+ QV4::ExecutionEngine *v4 = static_cast<DelegateModelGroupFunction *>(that)->engine();
QV4::Scope scope(v4);
QV4::Scoped<DelegateModelGroupFunction> f(scope, that, QV4::Scoped<DelegateModelGroupFunction>::Cast);
QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject);
static QV4::ReturnedValue getIndexed(QV4::Managed *m, uint index, bool *hasProperty)
{
Q_ASSERT(m->as<QQmlDelegateModelGroupChangeArray>());
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = static_cast<QQmlDelegateModelGroupChangeArray *>(m)->engine();
QV4::Scope scope(v4);
QV4::Scoped<QQmlDelegateModelGroupChangeArray> array(scope, static_cast<QQmlDelegateModelGroupChangeArray *>(m));
Q_ASSERT(m->as<QQmlDelegateModelGroupChangeArray>());
QQmlDelegateModelGroupChangeArray *array = static_cast<QQmlDelegateModelGroupChangeArray *>(m);
- if (name->equals(m->engine()->id_length)) {
+ if (name->equals(array->engine()->id_length)) {
if (hasProperty)
*hasProperty = true;
return QV4::Encode(array->count());
QV4::ReturnedValue QQuickJSContext2DPixelData::getIndexed(QV4::Managed *m, uint index, bool *hasProperty)
{
Q_ASSERT(m->as<QQuickJSContext2DPixelData>());
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = static_cast<QQuickJSContext2DPixelData *>(m)->engine();
QV4::Scope scope(v4);
QV4::Scoped<QQuickJSContext2DPixelData> r(scope, static_cast<QQuickJSContext2DPixelData *>(m));
void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const QV4::ValueRef value)
{
Q_ASSERT(m->as<QQuickJSContext2DPixelData>());
- QV4::ExecutionEngine *v4 = m->engine();
+ QV4::ExecutionEngine *v4 = static_cast<QQuickJSContext2DPixelData *>(m)->engine();
QV4::Scope scope(v4);
if (scope.hasException())
return;
static ReturnedValue call(Managed *m, CallData *)
{
- m->engine()->memoryManager->runGC();
+ static_cast<GC *>(m)->engine()->memoryManager->runGC();
return Encode::undefined();
}
};