diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-12-01 16:13:20 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-20 07:39:55 +0100 |
commit | d3a6412c66f62aa045f2856b0bf0ede4af10a984 (patch) | |
tree | 9de9776a0301fc6176d58df84f60c6b6ea4fcb75 /src/qml/jsruntime | |
parent | 3dade3b66c886b935e95bb106fa7252320c127b3 (diff) |
Remove most of the places where getPointer() is used
This is no longer required, and simply uglifies the code
Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 18 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 96 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4errorobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 12 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4include.cpp | 20 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 8 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 18 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 44 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 12 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 28 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4serialize.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 8 |
17 files changed, 145 insertions, 145 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 69cfcdf07a..f6e676de2c 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -121,7 +121,7 @@ ReturnedValue ArrayPrototype::method_toString(CallContext *ctx) if (ctx->d()->engine->hasException) return Encode::undefined(); ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("join"))); - ScopedFunctionObject f(scope, o->get(s.getPointer())); + ScopedFunctionObject f(scope, o->get(s)); if (!!f) { ScopedCallData d(scope, 0); d->thisObject = ctx->d()->callData->thisObject; @@ -145,7 +145,7 @@ ReturnedValue ArrayPrototype::method_concat(CallContext *ctx) return Encode::undefined(); ScopedArrayObject instance(scope, thisObject); if (instance) { - result->copyArrayData(instance.getPointer()); + result->copyArrayData(instance); } else { result->arraySet(0, thisObject); } @@ -158,7 +158,7 @@ ReturnedValue ArrayPrototype::method_concat(CallContext *ctx) elt = ctx->d()->callData->args[i]; if (elt) { uint n = elt->getLength(); - uint newLen = ArrayData::append(result.getPointer(), elt.getPointer(), n); + uint newLen = ArrayData::append(result, elt, n); result->setArrayLengthUnchecked(newLen); } else if (eltAsObj && eltAsObj->isListType()) { const uint startIndex = result->getLength(); @@ -212,7 +212,7 @@ ReturnedValue ArrayPrototype::method_join(CallContext *ctx) // crazy! // ScopedString name(scope, ctx->d()->engine->newString(QStringLiteral("0"))); - ScopedValue r6(scope, self->get(name.getPointer())); + ScopedValue r6(scope, self->get(name)); if (!r6->isNullOrUndefined()) R = r6->toQString(); @@ -221,7 +221,7 @@ ReturnedValue ArrayPrototype::method_join(CallContext *ctx) R += r4; name = Primitive::fromDouble(k).toString(scope.engine); - r12 = self->get(name.getPointer()); + r12 = self->get(name); if (scope.hasException()) return Encode::undefined(); @@ -279,7 +279,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) ScopedString s(scope); for (int i = 0; i < ctx->d()->callData->argc; ++i) { s = Primitive::fromDouble(l + i).toString(scope.engine); - instance->put(s.getPointer(), ctx->d()->callData->args[i]); + instance->put(s, ctx->d()->callData->args[i]); } double newLen = l + ctx->d()->callData->argc; if (!instance->isArrayObject()) @@ -294,7 +294,7 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx) if (!ctx->d()->callData->argc) ; else if (!instance->protoHasArray() && instance->arrayData()->length() <= len && instance->arrayData()->type == Heap::ArrayData::Simple) { - instance->arrayData()->vtable()->putArray(instance.getPointer(), len, ctx->d()->callData->args, ctx->d()->callData->argc); + instance->arrayData()->vtable()->putArray(instance, len, ctx->d()->callData->args, ctx->d()->callData->argc); len = instance->arrayData()->length(); } else { for (int i = 0; i < ctx->d()->callData->argc; ++i) @@ -362,7 +362,7 @@ ReturnedValue ArrayPrototype::method_shift(CallContext *ctx) ScopedValue result(scope); if (!instance->protoHasArray() && !instance->arrayData()->attrs && instance->arrayData()->length() <= len && instance->arrayData()->type != Heap::ArrayData::Custom) { - result = instance->arrayData()->vtable()->pop_front(instance.getPointer()); + result = instance->arrayData()->vtable()->pop_front(instance); } else { result = instance->getIndexed(0); if (scope.hasException()) @@ -543,7 +543,7 @@ ReturnedValue ArrayPrototype::method_unshift(CallContext *ctx) if (!instance->protoHasArray() && !instance->arrayData()->attrs && instance->arrayData()->length() <= len && instance->arrayData()->type != Heap::ArrayData::Custom) { - instance->arrayData()->vtable()->push_front(instance.getPointer(), ctx->d()->callData->args, ctx->d()->callData->argc); + instance->arrayData()->vtable()->push_front(instance, ctx->d()->callData->args, ctx->d()->callData->argc); } else { ScopedValue v(scope); for (uint k = len; k > 0; --k) { diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 5b993ab2f8..3c36612222 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -110,10 +110,10 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable) Scoped<ExecutionContext> ctx(scope, this); while (ctx) { if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - CallContext *c = static_cast<CallContext *>(ctx.getPointer()); - if (!c->d()->activation) - c->d()->activation = d()->engine->newObject(); - activation = c->d()->activation; + Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d()); + if (!c->activation) + c->activation = scope.engine->newObject(); + activation = c->activation; break; } ctx = ctx->d()->outer; @@ -212,27 +212,27 @@ bool ExecutionContext::deleteProperty(String *name) for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { hasWith = true; - ScopedObject withObject(scope, static_cast<WithContext *>(ctx.getPointer())->d()->withObject); + ScopedObject withObject(scope, static_cast<Heap::WithContext *>(ctx->d())->withObject); if (withObject->hasProperty(name)) return withObject->deleteProperty(name); } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext) { - CatchContext *c = static_cast<CatchContext *>(ctx.getPointer()); - if (c->d()->exceptionVarName->isEqualTo(name)) + Heap::CatchContext *c = static_cast<Heap::CatchContext *>(ctx->d()); + if (c->exceptionVarName->isEqualTo(name)) return false; } else if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - CallContext *c = static_cast<CallContext *>(ctx.getPointer()); - ScopedFunctionObject f(scope, c->d()->function); + Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d()); + ScopedFunctionObject f(scope, c->function); if (f->needsActivation() || hasWith) { uint index = f->function()->internalClass->find(name); if (index < UINT_MAX) // ### throw in strict mode? return false; } - ScopedObject activation(scope, c->d()->activation); + ScopedObject activation(scope, c->activation); if (activation && activation->hasProperty(name)) return activation->deleteProperty(name); } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - ScopedObject global(scope, static_cast<GlobalContext *>(ctx.getPointer())->d()->global); + ScopedObject global(scope, static_cast<Heap::GlobalContext *>(ctx->d())->global); if (global->hasProperty(name)) return global->deleteProperty(name); } @@ -287,33 +287,33 @@ void ExecutionContext::setProperty(String *name, const ValueRef value) Scoped<ExecutionContext> ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { - ScopedObject w(scope, static_cast<WithContext *>(ctx.getPointer())->d()->withObject); + ScopedObject w(scope, static_cast<Heap::WithContext *>(ctx->d())->withObject); if (w->hasProperty(name)) { w->put(name, value); return; } - } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext && static_cast<CatchContext *>(ctx.getPointer())->d()->exceptionVarName->isEqualTo(name)) { - static_cast<CatchContext *>(ctx.getPointer())->d()->exceptionValue = *value; + } else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext && static_cast<Heap::CatchContext *>(ctx->d())->exceptionVarName->isEqualTo(name)) { + static_cast<Heap::CatchContext *>(ctx->d())->exceptionValue = *value; return; } else { ScopedObject activation(scope, (Object *)0); if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - CallContext *c = static_cast<CallContext *>(ctx.getPointer()); - if (c->d()->function->function) { - uint index = c->d()->function->function->internalClass->find(name); + Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d()); + if (c->function->function) { + uint index = c->function->function->internalClass->find(name); if (index < UINT_MAX) { - if (index < c->d()->function->formalParameterCount()) { - c->d()->callData->args[c->d()->function->formalParameterCount() - index - 1] = *value; + if (index < c->function->formalParameterCount()) { + c->callData->args[c->function->formalParameterCount() - index - 1] = *value; } else { - index -= c->d()->function->formalParameterCount(); - c->d()->locals[index] = *value; + index -= c->function->formalParameterCount(); + c->locals[index] = *value; } return; } } - activation = c->d()->activation; + activation = c->activation; } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - activation = static_cast<GlobalContext *>(ctx.getPointer())->d()->global; + activation = static_cast<Heap::GlobalContext *>(ctx->d())->global; } if (activation) { @@ -330,7 +330,7 @@ void ExecutionContext::setProperty(String *name, const ValueRef value) } } } - if (d()->strictMode || name->equals(d()->engine->id_this.getPointer())) { + if (d()->strictMode || name->equals(d()->engine->id_this)) { ScopedValue n(scope, name->asReturnedValue()); engine()->throwReferenceError(n); return; @@ -344,7 +344,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) ScopedValue v(scope); name->makeIdentifier(); - if (name->equals(d()->engine->id_this.getPointer())) + if (name->equals(d()->engine->id_this)) return d()->callData->thisObject.asReturnedValue(); bool hasWith = false; @@ -352,7 +352,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) Scoped<ExecutionContext> ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { - ScopedObject w(scope, static_cast<WithContext *>(ctx.getPointer())->d()->withObject); + ScopedObject w(scope, static_cast<Heap::WithContext *>(ctx->d())->withObject); hasWith = true; bool hasProperty = false; v = w->get(name, &hasProperty); @@ -364,23 +364,23 @@ ReturnedValue ExecutionContext::getProperty(String *name) else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext) { hasCatchScope = true; - CatchContext *c = static_cast<CatchContext *>(ctx.getPointer()); - if (c->d()->exceptionVarName->isEqualTo(name)) - return c->d()->exceptionValue.asReturnedValue(); + Heap::CatchContext *c = static_cast<Heap::CatchContext *>(ctx->d()); + if (c->exceptionVarName->isEqualTo(name)) + return c->exceptionValue.asReturnedValue(); } else if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - QV4::CallContext *c = static_cast<CallContext *>(ctx.getPointer()); - ScopedFunctionObject f(scope, c->d()->function); + Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d()); + ScopedFunctionObject f(scope, c->function); if (f->function() && (f->needsActivation() || hasWith || hasCatchScope)) { uint index = f->function()->internalClass->find(name); if (index < UINT_MAX) { - if (index < c->d()->function->formalParameterCount()) - return c->d()->callData->args[c->d()->function->formalParameterCount() - index - 1].asReturnedValue(); - return c->d()->locals[index - c->d()->function->formalParameterCount()].asReturnedValue(); + if (index < c->function->formalParameterCount()) + return c->callData->args[c->function->formalParameterCount() - index - 1].asReturnedValue(); + return c->locals[index - c->function->formalParameterCount()].asReturnedValue(); } } - ScopedObject activation(scope, c->d()->activation); + ScopedObject activation(scope, c->activation); if (activation) { bool hasProperty = false; v = activation->get(name, &hasProperty); @@ -393,7 +393,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - ScopedObject global(scope, static_cast<GlobalContext *>(ctx.getPointer())->d()->global); + ScopedObject global(scope, static_cast<Heap::GlobalContext *>(ctx->d())->global); bool hasProperty = false; v = global->get(name, &hasProperty); if (hasProperty) @@ -411,7 +411,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) base = (Object *)0; name->makeIdentifier(); - if (name->equals(d()->engine->id_this.getPointer())) + if (name->equals(d()->engine->id_this)) return d()->callData->thisObject.asReturnedValue(); bool hasWith = false; @@ -419,7 +419,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) Scoped<ExecutionContext> ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { - ScopedObject w(scope, static_cast<WithContext *>(ctx.getPointer())->d()->withObject); + ScopedObject w(scope, static_cast<Heap::WithContext *>(ctx->d())->withObject); hasWith = true; bool hasProperty = false; v = w->get(name, &hasProperty); @@ -432,23 +432,23 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) else if (ctx->d()->type == Heap::ExecutionContext::Type_CatchContext) { hasCatchScope = true; - CatchContext *c = static_cast<CatchContext *>(ctx.getPointer()); - if (c->d()->exceptionVarName->isEqualTo(name)) - return c->d()->exceptionValue.asReturnedValue(); + Heap::CatchContext *c = static_cast<Heap::CatchContext *>(ctx->d()); + if (c->exceptionVarName->isEqualTo(name)) + return c->exceptionValue.asReturnedValue(); } else if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { - QV4::CallContext *c = static_cast<CallContext *>(ctx.getPointer()); - ScopedFunctionObject f(scope, c->d()->function); + Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d()); + ScopedFunctionObject f(scope, c->function); if (f->function() && (f->needsActivation() || hasWith || hasCatchScope)) { uint index = f->function()->internalClass->find(name); if (index < UINT_MAX) { if (index < f->formalParameterCount()) - return c->d()->callData->args[f->formalParameterCount() - index - 1].asReturnedValue(); - return c->d()->locals[index - f->formalParameterCount()].asReturnedValue(); + return c->callData->args[f->formalParameterCount() - index - 1].asReturnedValue(); + return c->locals[index - f->formalParameterCount()].asReturnedValue(); } } - ScopedObject activation(scope, c->d()->activation); + ScopedObject activation(scope, c->activation); if (activation) { bool hasProperty = false; v = activation->get(name, &hasProperty); @@ -460,11 +460,11 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base) } if (f->function() && f->function()->isNamedExpression() && name->equals(ScopedString(scope, f->function()->name()))) - return c->d()->function->asReturnedValue(); + return c->function->asReturnedValue(); } else if (ctx->d()->type == Heap::ExecutionContext::Type_GlobalContext) { - ScopedObject global(scope, static_cast<GlobalContext *>(ctx.getPointer())->d()->global); + ScopedObject global(scope, static_cast<Heap::GlobalContext *>(ctx->d())->global); bool hasProperty = false; v = global->get(name, &hasProperty); if (hasProperty) diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 7fc9855f98..7f79de3035 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -1299,7 +1299,7 @@ ReturnedValue DatePrototype::method_toJSON(CallContext *ctx) return Encode::null(); ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("toISOString"))); - ScopedValue v(scope, O->objectValue()->get(s.getPointer())); + ScopedValue v(scope, O->objectValue()->get(s)); FunctionObject *toIso = v->asFunctionObject(); if (!toIso) diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 3d645404d3..11d9800c83 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -451,7 +451,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) globalObject()->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1); Scoped<String> name(scope, newString(QStringLiteral("thrower"))); - thrower = ScopedFunctionObject(scope, BuiltinFunction::create(global, name.getPointer(), ::throwTypeError)).getPointer(); + thrower = ScopedFunctionObject(scope, BuiltinFunction::create(global, name, ::throwTypeError)); } ExecutionEngine::~ExecutionEngine() @@ -1140,7 +1140,7 @@ QQmlError ExecutionEngine::catchExceptionAsQmlError() QV4::Scoped<QV4::ErrorObject> errorObj(scope, exception); if (!!errorObj && errorObj->asSyntaxError()) { QV4::ScopedString m(scope, newString(QStringLiteral("message"))); - QV4::ScopedValue v(scope, errorObj->get(m.getPointer())); + QV4::ScopedValue v(scope, errorObj->get(m)); error.setDescription(v->toQStringNoThrow()); } else error.setDescription(exception->toQStringNoThrow()); diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp index b1c83a075a..849c560024 100644 --- a/src/qml/jsruntime/qv4errorobject.cpp +++ b/src/qml/jsruntime/qv4errorobject.cpp @@ -375,7 +375,7 @@ ReturnedValue ErrorPrototype::method_toString(CallContext *ctx) qname = name->toQString(); ScopedString s(scope, ctx->d()->engine->newString(QString::fromLatin1("message"))); - ScopedValue message(scope, o->get(s.getPointer())); + ScopedValue message(scope, o->get(s)); QString qmessage; if (!message->isUndefined()) qmessage = message->toQString(); diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 822184042c..e7610cfb59 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -88,7 +88,7 @@ Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const QString Scope s(scope->engine()); ScopedFunctionObject f(s, this); ScopedString n(s, s.engine->newString(name)); - f->init(n.getPointer(), createProto); + f->init(n, createProto); } Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const QString &name, bool createProto) @@ -98,7 +98,7 @@ Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const QString &nam Scope s(scope->engine); ScopedFunctionObject f(s, this); ScopedString n(s, s.engine->newString(name)); - f->init(n.getPointer(), createProto); + f->init(n, createProto); } Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const ReturnedValue name) @@ -108,7 +108,7 @@ Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const Returne Scope s(scope); ScopedFunctionObject f(s, this); ScopedString n(s, name); - f->init(n.getPointer(), false); + f->init(n, false); } Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValue name) @@ -118,7 +118,7 @@ Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValu Scope s(scope->engine); ScopedFunctionObject f(s, this); ScopedString n(s, name); - f->init(n.getPointer(), false); + f->init(n, false); } Heap::FunctionObject::FunctionObject(InternalClass *ic, QV4::Object *prototype) @@ -402,7 +402,7 @@ ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData) ScopedContext context(scope, v4->currentContext()); callData->thisObject = obj.asReturnedValue(); - Scoped<CallContext> ctx(scope, context->newCallContext(f.getPointer(), callData)); + Scoped<CallContext> ctx(scope, context->newCallContext(f, callData)); ExecutionContextSaver ctxSaver(scope, context); ScopedValue result(scope, Q_V4_PROFILE(v4, f->function())); @@ -490,7 +490,7 @@ ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData) CallContext::Data ctx(v4); ctx.strictMode = f->strictMode(); ctx.callData = callData; - ctx.function = f.getPointer()->d(); + ctx.function = f->d(); ctx.compilationUnit = f->function()->compilationUnit; ctx.lookups = ctx.compilationUnit->runtimeLookups; ctx.outer = f->scope(); diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index bf2662dd34..bdd2136851 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -81,11 +81,11 @@ QV4::ReturnedValue QV4Include::resultValue(QV4::ExecutionEngine *v4, Status stat QV4::ScopedObject o(scope, v4->newObject()); QV4::ScopedString s(scope); QV4::ScopedValue v(scope); - o->put((s = v4->newString(QStringLiteral("OK"))).getPointer(), (v = QV4::Primitive::fromInt32(Ok))); - o->put((s = v4->newString(QStringLiteral("LOADING"))).getPointer(), (v = QV4::Primitive::fromInt32(Loading))); - o->put((s = v4->newString(QStringLiteral("NETWORK_ERROR"))).getPointer(), (v = QV4::Primitive::fromInt32(NetworkError))); - o->put((s = v4->newString(QStringLiteral("EXCEPTION"))).getPointer(), (v = QV4::Primitive::fromInt32(Exception))); - o->put((s = v4->newString(QStringLiteral("status"))).getPointer(), (v = QV4::Primitive::fromInt32(status))); + o->put((s = v4->newString(QStringLiteral("OK"))), (v = QV4::Primitive::fromInt32(Ok))); + o->put((s = v4->newString(QStringLiteral("LOADING"))), (v = QV4::Primitive::fromInt32(Loading))); + o->put((s = v4->newString(QStringLiteral("NETWORK_ERROR"))), (v = QV4::Primitive::fromInt32(NetworkError))); + o->put((s = v4->newString(QStringLiteral("EXCEPTION"))), (v = QV4::Primitive::fromInt32(Exception))); + o->put((s = v4->newString(QStringLiteral("status"))), (v = QV4::Primitive::fromInt32(status))); return o.asReturnedValue(); } @@ -150,14 +150,14 @@ void QV4Include::finished() script.run(); if (scope.engine->hasException) { QV4::ScopedValue ex(scope, scope.engine->catchException()); - resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Exception))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Exception))); QV4::ScopedString exception(scope, v4->newString(QStringLiteral("exception"))); - resultObj->put(exception.getPointer(), ex); + resultObj->put(exception, ex); } else { - resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Ok))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Ok))); } } else { - resultObj->put(status.getPointer(), QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); } QV4::ScopedValue cb(scope, m_callbackFunction.value()); @@ -225,7 +225,7 @@ QV4::ReturnedValue QV4Include::method_include(QV4::CallContext *ctx) QV4::ScopedValue ex(scope, scope.engine->catchException()); result = resultValue(scope.engine, Exception); QV4::ScopedString exception(scope, scope.engine->newString(QStringLiteral("exception"))); - result->asObject()->put(exception.getPointer(), ex); + result->asObject()->put(exception, ex); } else { result = resultValue(scope.engine, Ok); } diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 8bcb2e4708..6b38c79d55 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -284,7 +284,7 @@ bool JsonParser::parseMember(Object *o) if (idx < UINT_MAX) { o->putIndexed(idx, val); } else { - o->insertMember(s.getPointer(), val); + o->insertMember(s, val); } END; @@ -705,7 +705,7 @@ QString Stringify::Str(const QString &key, ValueRef v) ScopedObject o(scope, value); if (o) { ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("toJSON"))); - Scoped<FunctionObject> toJSON(scope, o->get(s.getPointer())); + Scoped<FunctionObject> toJSON(scope, o->get(s)); if (!!toJSON) { ScopedCallData callData(scope, 1); callData->thisObject = value; @@ -808,7 +808,7 @@ QString Stringify::JO(Object *o) for (int i = 0; i < propertyList.size(); ++i) { bool exists; s = propertyList.at(i); - ScopedValue v(scope, o->get(s.getPointer(), &exists)); + ScopedValue v(scope, o->get(s, &exists)); if (!exists) continue; QString member = makeMember(s->toQString(), v); @@ -1002,7 +1002,7 @@ QV4::ReturnedValue JsonObject::fromJsonObject(ExecutionEngine *engine, const QJs ScopedValue v(scope); for (QJsonObject::const_iterator it = object.begin(); it != object.end(); ++it) { v = fromJsonValue(engine, it.value()); - o->put((s = engine->newString(it.key())).getPointer(), v); + o->put((s = engine->newString(it.key())), v); } return o.asReturnedValue(); } diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index 9febcaab69..dead79a939 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -155,7 +155,7 @@ ReturnedValue Lookup::indexedGetterFallback(Lookup *l, const ValueRef object, co ScopedString name(scope, index->toString(scope.engine)); if (scope.hasException()) return Encode::undefined(); - return o->get(name.getPointer()); + return o->get(name); } @@ -211,7 +211,7 @@ void Lookup::indexedSetterFallback(Lookup *l, const ValueRef object, const Value } ScopedString name(scope, index->toString(scope.engine)); - o->put(name.getPointer(), value); + o->put(name, value); } void Lookup::indexedSetterObjectInt(Lookup *l, const ValueRef object, const ValueRef index, const ValueRef v) @@ -251,7 +251,7 @@ ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Va proto = engine->stringPrototype.asObject(); Scope scope(engine); ScopedString name(scope, engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]); - if (name->equals(engine->id_length.getPointer())) { + if (name->equals(engine->id_length)) { // special case, as the property is on the object itself l->getter = stringLengthGetter; return stringLengthGetter(l, engine, object); diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 0e3ea50186..7e913361bf 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -77,7 +77,7 @@ void Object::put(ExecutionEngine *engine, const QString &name, const ValueRef va { Scope scope(engine); ScopedString n(scope, engine->newString(name)); - put(n.getPointer(), value); + put(n, value); } ReturnedValue Object::getValue(const ValueRef thisObject, const Property *p, PropertyAttributes attrs) @@ -127,7 +127,7 @@ void Object::defineDefaultProperty(const QString &name, ValueRef value) ExecutionEngine *e = engine(); Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); - defineDefaultProperty(s.getPointer(), value); + defineDefaultProperty(s, value); } void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(CallContext *), int argumentCount) @@ -136,9 +136,9 @@ void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(Ca Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); ScopedContext global(scope, e->rootContext()); - Scoped<FunctionObject> function(scope, BuiltinFunction::create(global, s.getPointer(), code)); + Scoped<FunctionObject> function(scope, BuiltinFunction::create(global, s, code)); function->defineReadonlyProperty(e->id_length, Primitive::fromInt32(argumentCount)); - defineDefaultProperty(s.getPointer(), function); + defineDefaultProperty(s, function); } void Object::defineDefaultProperty(String *name, ReturnedValue (*code)(CallContext *), int argumentCount) @@ -156,7 +156,7 @@ void Object::defineAccessorProperty(const QString &name, ReturnedValue (*getter) ExecutionEngine *e = engine(); Scope scope(e); Scoped<String> s(scope, e->newIdentifier(name)); - defineAccessorProperty(s.getPointer(), getter, setter); + defineAccessorProperty(s, getter, setter); } void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(CallContext *), ReturnedValue (*setter)(CallContext *)) @@ -165,8 +165,8 @@ void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(CallCo QV4::Scope scope(v4); ScopedProperty p(scope); ScopedContext global(scope, scope.engine->rootContext()); - p->setGetter(getter ? ScopedFunctionObject(scope, BuiltinFunction::create(global, name, getter)).getPointer() : 0); - p->setSetter(setter ? ScopedFunctionObject(scope, BuiltinFunction::create(global, name, setter)).getPointer() : 0); + p->setGetter(ScopedFunctionObject(scope, (getter ? BuiltinFunction::create(global, name, getter) : 0))); + p->setSetter(ScopedFunctionObject(scope, (setter ? BuiltinFunction::create(global, name, setter) : 0))); insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); } @@ -175,7 +175,7 @@ void Object::defineReadonlyProperty(const QString &name, ValueRef value) QV4::ExecutionEngine *e = engine(); Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); - defineReadonlyProperty(s.getPointer(), value); + defineReadonlyProperty(s, value); } void Object::defineReadonlyProperty(String *name, ValueRef value) @@ -1058,7 +1058,7 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, const QString &name, { Scope scope(engine); ScopedString s(scope, engine->newString(name)); - return __defineOwnProperty__(engine, s.getPointer(), p, attrs); + return __defineOwnProperty__(engine, s, p, attrs); } diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index e977c748fc..0a592bb7d7 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -64,7 +64,7 @@ ReturnedValue ObjectCtor::construct(Managed *that, CallData *callData) Scoped<Object> obj(scope, v4->newObject()); Scoped<Object> proto(scope, ctor->get(v4->id_prototype)); if (!!proto) - obj->setPrototype(proto.getPointer()); + obj->setPrototype(proto); return obj.asReturnedValue(); } return RuntimeHelpers::toObject(scope.engine, ValueRef(&callData->args[0])); @@ -109,8 +109,8 @@ void ObjectPrototype::init(ExecutionEngine *v4, Object *ctor) defineDefaultProperty(QStringLiteral("__defineSetter__"), method_defineSetter, 2); ScopedContext global(scope, scope.engine->rootContext()); - Property p(ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_get_proto)).getPointer(), - ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_set_proto)).getPointer()); + Property p(ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_get_proto)), + ScopedFunctionObject(scope, BuiltinFunction::create(global, v4->id___proto__, method_set_proto))); insertMember(v4->id___proto__, p, Attr_Accessor|Attr_NotEnumerable); } @@ -132,7 +132,7 @@ ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(CallContext *ctx) if (!O) return ctx->engine()->throwTypeError(); - if (ArgumentsObject::isNonStrictArgumentsObject(O.getPointer())) + if (ArgumentsObject::isNonStrictArgumentsObject(O)) Scoped<ArgumentsObject>(scope, O)->fullyCreate(); ScopedValue v(scope, ctx->argument(1)); @@ -140,7 +140,7 @@ ReturnedValue ObjectPrototype::method_getOwnPropertyDescriptor(CallContext *ctx) if (scope.hasException()) return Encode::undefined(); PropertyAttributes attrs; - Property *desc = O->__getOwnProperty__(name.getPointer(), &attrs); + Property *desc = O->__getOwnProperty__(name, &attrs); return fromPropertyDescriptor(scope.engine, desc, attrs); } @@ -191,7 +191,7 @@ ReturnedValue ObjectPrototype::method_defineProperty(CallContext *ctx) if (scope.engine->hasException) return Encode::undefined(); - if (!O->__defineOwnProperty__(scope.engine, name.getPointer(), pd, attrs)) + if (!O->__defineOwnProperty__(scope.engine, name, pd, attrs)) return ctx->engine()->throwTypeError(); return O.asReturnedValue(); @@ -226,7 +226,7 @@ ReturnedValue ObjectPrototype::method_defineProperties(CallContext *ctx) return Encode::undefined(); bool ok; if (name) - ok = O->__defineOwnProperty__(scope.engine, name.getPointer(), n, nattrs); + ok = O->__defineOwnProperty__(scope.engine, name, n, nattrs); else ok = O->__defineOwnProperty__(scope.engine, index, n, nattrs); if (!ok) @@ -248,7 +248,7 @@ ReturnedValue ObjectPrototype::method_seal(CallContext *ctx) o->setInternalClass(o->internalClass()->sealed()); if (o->arrayData()) { - ArrayData::ensureAttributes(o.getPointer()); + ArrayData::ensureAttributes(o); for (uint i = 0; i < o->d()->arrayData->alloc; ++i) { if (!o->arrayData()->isEmpty(i)) o->d()->arrayData->attrs[i].setConfigurable(false); @@ -265,7 +265,7 @@ ReturnedValue ObjectPrototype::method_freeze(CallContext *ctx) if (!o) return ctx->engine()->throwTypeError(); - if (ArgumentsObject::isNonStrictArgumentsObject(o.getPointer())) + if (ArgumentsObject::isNonStrictArgumentsObject(o)) Scoped<ArgumentsObject>(scope, o)->fullyCreate(); o->setExtensible(false); @@ -273,7 +273,7 @@ ReturnedValue ObjectPrototype::method_freeze(CallContext *ctx) o->setInternalClass(o->internalClass()->frozen()); if (o->arrayData()) { - ArrayData::ensureAttributes(o.getPointer()); + ArrayData::ensureAttributes(o); for (uint i = 0; i < o->arrayData()->alloc; ++i) { if (!o->arrayData()->isEmpty(i)) o->arrayData()->attrs[i].setConfigurable(false); @@ -430,9 +430,9 @@ ReturnedValue ObjectPrototype::method_hasOwnProperty(CallContext *ctx) Scoped<Object> O(scope, ctx->d()->callData->thisObject, Scoped<Object>::Convert); if (scope.engine->hasException) return Encode::undefined(); - bool r = O->hasOwnProperty(P.getPointer()); + bool r = O->hasOwnProperty(P); if (!r) - r = !O->query(P.getPointer()).isEmpty(); + r = !O->query(P).isEmpty(); return Encode(r); } @@ -466,7 +466,7 @@ ReturnedValue ObjectPrototype::method_propertyIsEnumerable(CallContext *ctx) if (scope.engine->hasException) return Encode::undefined(); PropertyAttributes attrs; - o->__getOwnProperty__(p.getPointer(), &attrs); + o->__getOwnProperty__(p, &attrs); return Encode(attrs.isEnumerable()); } @@ -494,7 +494,7 @@ ReturnedValue ObjectPrototype::method_defineGetter(CallContext *ctx) Property pd; pd.value = f; pd.set = Primitive::emptyValue(); - o->__defineOwnProperty__(scope.engine, prop.getPointer(), pd, Attr_Accessor); + o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); return Encode::undefined(); } @@ -522,7 +522,7 @@ ReturnedValue ObjectPrototype::method_defineSetter(CallContext *ctx) Property pd; pd.value = Primitive::emptyValue(); pd.set = f; - o->__defineOwnProperty__(scope.engine, prop.getPointer(), pd, Attr_Accessor); + o->__defineOwnProperty__(scope.engine, prop, pd, Attr_Accessor); return Encode::undefined(); } @@ -554,7 +554,7 @@ ReturnedValue ObjectPrototype::method_set_proto(CallContext *ctx) if (o->prototype() == p->d()) { ok = true; } else if (o->isExtensible()) { - ok = o->setPrototype(p.getPointer()); + ok = o->setPrototype(p); } } if (!ok) @@ -645,24 +645,24 @@ ReturnedValue ObjectPrototype::fromPropertyDescriptor(ExecutionEngine *engine, c if (attrs.isData()) { pd.value = desc->value; s = engine->newString(QStringLiteral("value")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); pd.value = Primitive::fromBoolean(attrs.isWritable()); s = engine->newString(QStringLiteral("writable")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); } else { pd.value = desc->getter() ? desc->getter()->asReturnedValue() : Encode::undefined(); s = engine->newString(QStringLiteral("get")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); pd.value = desc->setter() ? desc->setter()->asReturnedValue() : Encode::undefined(); s = engine->newString(QStringLiteral("set")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); } pd.value = Primitive::fromBoolean(attrs.isEnumerable()); s = engine->newString(QStringLiteral("enumerable")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); pd.value = Primitive::fromBoolean(attrs.isConfigurable()); s = engine->newString(QStringLiteral("configurable")); - o->__defineOwnProperty__(scope.engine, s.getPointer(), pd, Attr_Data); + o->__defineOwnProperty__(scope.engine, s, pd, Attr_Data); return o.asReturnedValue(); } diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 720d651291..daaa0c16f1 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -283,13 +283,13 @@ ReturnedValue QObjectWrapper::getQmlProperty(QQmlContextData *qmlContext, String } QQmlPropertyData local; - QQmlPropertyData *result = findProperty(scope.engine, qmlContext, name.getPointer(), revisionMode, &local); + QQmlPropertyData *result = findProperty(scope.engine, qmlContext, name, revisionMode, &local); if (!result) { if (includeImports && name->startsWithUpper()) { // Check for attached properties if (qmlContext && qmlContext->imports) { - QQmlTypeNameCache::Result r = qmlContext->imports->query(name.getPointer()); + QQmlTypeNameCache::Result r = qmlContext->imports->query(name); if (hasProperty) *hasProperty = true; @@ -308,7 +308,7 @@ ReturnedValue QObjectWrapper::getQmlProperty(QQmlContextData *qmlContext, String } } } - return QV4::Object::get(this, name.getPointer(), hasProperty); + return QV4::Object::get(this, name, hasProperty); } QQmlData *ddata = QQmlData::get(d()->object, false); @@ -348,8 +348,8 @@ ReturnedValue QObjectWrapper::getProperty(QObject *object, ExecutionContext *ctx QV4::ScopedString connect(scope, ctx->d()->engine->newIdentifier(QStringLiteral("connect"))); QV4::ScopedString disconnect(scope, ctx->d()->engine->newIdentifier(QStringLiteral("disconnect"))); - handler->put(connect.getPointer(), QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(connect.getPointer()))); - handler->put(disconnect.getPointer(), QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(disconnect.getPointer()))); + handler->put(connect, QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(connect))); + handler->put(disconnect, QV4::ScopedValue(scope, ctx->d()->engine->functionPrototype.asObject()->get(disconnect))); return handler.asReturnedValue(); } else { @@ -618,7 +618,7 @@ ReturnedValue QObjectWrapper::wrap(ExecutionEngine *engine, QObject *object) alternateWrapper = create(engine, object); if (!engine->m_multiplyWrappedQObjects) engine->m_multiplyWrappedQObjects = new MultiplyWrappedQObjectMap; - engine->m_multiplyWrappedQObjects->insert(object, alternateWrapper.getPointer()); + engine->m_multiplyWrappedQObjects->insert(object, alternateWrapper); ddata->hasTaintedV8Object = true; } diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index 6a1d86522d..fcbf91c3b0 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -152,7 +152,7 @@ void RegExpObject::init(ExecutionEngine *engine) ScopedString lastIndex(scope, engine->newIdentifier(QStringLiteral("lastIndex"))); ScopedValue v(scope, Primitive::fromInt32(0)); - insertMember(lastIndex.getPointer(), v, Attr_NotEnumerable|Attr_NotConfigurable); + insertMember(lastIndex, v, Attr_NotEnumerable|Attr_NotConfigurable); if (!this->value()) return; @@ -211,7 +211,7 @@ QString RegExpObject::source() const { Scope scope(engine()); ScopedString source(scope, scope.engine->newIdentifier(QStringLiteral("source"))); - ScopedValue s(scope, const_cast<RegExpObject *>(this)->get(source.getPointer())); + ScopedValue s(scope, const_cast<RegExpObject *>(this)->get(source)); return s->toQString(); } diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index e1d8b19b65..c4c0fd416c 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -284,7 +284,7 @@ ReturnedValue Runtime::deleteElement(ExecutionEngine *engine, const ValueRef bas } ScopedString name(scope, index->toString(engine)); - return Runtime::deleteMemberString(engine, base, name.getPointer()); + return Runtime::deleteMemberString(engine, base, name); } ReturnedValue Runtime::deleteMember(ExecutionEngine *engine, const ValueRef base, int nameIndex) @@ -349,7 +349,7 @@ QV4::ReturnedValue Runtime::in(ExecutionEngine *engine, const ValueRef left, con ScopedString s(scope, left->toString(engine)); if (scope.hasException()) return Encode::undefined(); - bool r = right->objectValue()->hasProperty(s.getPointer()); + bool r = right->objectValue()->hasProperty(s); return Encode(r); } @@ -451,14 +451,14 @@ Heap::String *RuntimeHelpers::convertToString(ExecutionEngine *engine, const Val case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); case Value::Undefined_Type: - return engine->id_undefined.getPointer()->d(); + return engine->id_undefined->d(); case Value::Null_Type: - return engine->id_null.getPointer()->d(); + return engine->id_null->d(); case Value::Boolean_Type: if (value->booleanValue()) - return engine->id_true.getPointer()->d(); + return engine->id_true->d(); else - return engine->id_false.getPointer()->d(); + return engine->id_false->d(); case Value::Managed_Type: if (value->isString()) return value->stringValue()->d(); @@ -482,14 +482,14 @@ static Heap::String *convert_to_string_add(ExecutionEngine *engine, const ValueR case Value::Empty_Type: Q_ASSERT(!"empty Value encountered"); case Value::Undefined_Type: - return engine->id_undefined.getPointer()->d(); + return engine->id_undefined->d(); case Value::Null_Type: - return engine->id_null.getPointer()->d(); + return engine->id_null->d(); case Value::Boolean_Type: if (value->booleanValue()) - return engine->id_true.getPointer()->d(); + return engine->id_true->d(); else - return engine->id_false.getPointer()->d(); + return engine->id_false->d(); case Value::Managed_Type: if (value->isString()) return value->stringValue()->d(); @@ -608,7 +608,7 @@ ReturnedValue Runtime::getElement(ExecutionEngine *engine, const ValueRef object ScopedString name(scope, index->toString(engine)); if (scope.hasException()) return Encode::undefined(); - return o->get(name.getPointer()); + return o->get(name); } void Runtime::setElement(ExecutionEngine *engine, const ValueRef object, const ValueRef index, const ValueRef value) @@ -632,7 +632,7 @@ void Runtime::setElement(ExecutionEngine *engine, const ValueRef object, const V } ScopedString name(scope, index->toString(engine)); - o->put(name.getPointer(), value); + o->put(name, value); } ReturnedValue Runtime::foreachIterator(ExecutionEngine *engine, const ValueRef in) @@ -998,7 +998,7 @@ ReturnedValue Runtime::callElement(ExecutionEngine *engine, const ValueRef index return Encode::undefined(); callData->thisObject = baseObject; - ScopedObject o(scope, baseObject->get(s.getPointer())); + ScopedObject o(scope, baseObject->get(s)); if (!o) return engine->throwTypeError(); @@ -1144,7 +1144,7 @@ QV4::ReturnedValue Runtime::typeofElement(ExecutionEngine *engine, const ValueRe ScopedObject obj(scope, base->toObject(engine)); if (scope.engine->hasException) return Encode::undefined(); - ScopedValue prop(scope, obj->get(name.getPointer())); + ScopedValue prop(scope, obj->get(name)); return Runtime::typeofValue(engine, prop); } diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index d125f04109..088e9616ce 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -185,7 +185,7 @@ Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContex p->setGetter(g); p->setSetter(0); s = engine->newString(QString::fromUtf8(param)); - qmlScopeObject->insertMember(s.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); + qmlScopeObject->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable); } } diff --git a/src/qml/jsruntime/qv4serialize.cpp b/src/qml/jsruntime/qv4serialize.cpp index 5eb3e81b51..0ca1b45386 100644 --- a/src/qml/jsruntime/qv4serialize.cpp +++ b/src/qml/jsruntime/qv4serialize.cpp @@ -272,7 +272,7 @@ void Serialize::serialize(QByteArray &data, const QV4::ValueRef v, QV8Engine *en serialize(data, s, engine); str = s; - val = o->get(str.getPointer()); + val = o->get(str); if (scope.hasException()) scope.engine->catchException(); @@ -333,7 +333,7 @@ ReturnedValue Serialize::deserialize(const char *&data, QV8Engine *engine) name = deserialize(data, engine); value = deserialize(data, engine); n = name.asReturnedValue(); - o->put(n.getPointer(), value); + o->put(n, value); } return o.asReturnedValue(); } @@ -363,7 +363,7 @@ ReturnedValue Serialize::deserialize(const char *&data, QV8Engine *engine) QVariant var = qVariantFromValue(ref); QV4::ScopedValue v(scope, engine->fromVariant((var))); QV4::ScopedString s(scope, v4->newString(QStringLiteral("__qml:hidden:ref"))); - rv->asObject()->defineReadonlyProperty(s.getPointer(), v); + rv->asObject()->defineReadonlyProperty(s, v); agent->release(); agent->setV8Engine(engine); diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index e148782d4c..3e30cbcae8 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -387,7 +387,7 @@ ReturnedValue StringPrototype::method_match(CallContext *context) // ### use the standard builtin function, not the one that might be redefined in the proto ScopedString execString(scope, scope.engine->newString(QStringLiteral("exec"))); - Scoped<FunctionObject> exec(scope, scope.engine->regExpPrototype.asObject()->get(execString.getPointer())); + Scoped<FunctionObject> exec(scope, scope.engine->regExpPrototype.asObject()->get(execString)); ScopedCallData callData(scope, 1); callData->thisObject = rx; @@ -396,7 +396,7 @@ ReturnedValue StringPrototype::method_match(CallContext *context) return exec->call(callData); ScopedString lastIndex(scope, context->d()->engine->newString(QStringLiteral("lastIndex"))); - rx->put(lastIndex.getPointer(), ScopedValue(scope, Primitive::fromInt32(0))); + rx->put(lastIndex, ScopedValue(scope, Primitive::fromInt32(0))); Scoped<ArrayObject> a(scope, context->d()->engine->newArrayObject()); double previousLastIndex = 0; @@ -409,11 +409,11 @@ ReturnedValue StringPrototype::method_match(CallContext *context) if (result->isNull()) break; assert(result->isObject()); - index = rx->get(lastIndex.getPointer(), 0); + index = rx->get(lastIndex, 0); double thisIndex = index->toInteger(); if (previousLastIndex == thisIndex) { previousLastIndex = thisIndex + 1; - rx->put(lastIndex.getPointer(), ScopedValue(scope, Primitive::fromDouble(previousLastIndex))); + rx->put(lastIndex, ScopedValue(scope, Primitive::fromDouble(previousLastIndex))); } else { previousLastIndex = thisIndex; } |