diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-11-24 15:38:41 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-11 15:52:13 +0100 |
commit | 8afc1f7fe24c625cdb84406cc7665f1dcabf88c4 (patch) | |
tree | 04c5d73167544182e509ce7e40bd18c29909d0a7 /src/qml/jsruntime/qv4stringobject.cpp | |
parent | 4322c8d7686c7cbbdf348146d32d705007b21d56 (diff) |
Move prototype back from the vtable into Object
This is the only way we can support a GC that moves
objects around in memory.
Change-Id: I1d168fae4aa9f575b730e469e762bc5b5549b886
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index ed29c84ff9..8c864803af 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -70,8 +70,8 @@ using namespace QV4; DEFINE_OBJECT_VTABLE(StringObject); -Heap::StringObject::StringObject(InternalClass *ic) - : Heap::Object(ic) +Heap::StringObject::StringObject(InternalClass *ic, QV4::Object *prototype) + : Heap::Object(ic, prototype) { Q_ASSERT(internalClass->vtable == QV4::StringObject::staticVTable()); value = ic->engine->newString(QStringLiteral(""))->asReturnedValue(); @@ -83,7 +83,7 @@ Heap::StringObject::StringObject(InternalClass *ic) } Heap::StringObject::StringObject(ExecutionEngine *engine, const ValueRef val) - : Heap::Object(engine->stringObjectClass) + : Heap::Object(engine->stringObjectClass, engine->stringPrototype.asObject()) { value = val; Q_ASSERT(value.isString()); @@ -386,8 +386,8 @@ ReturnedValue StringPrototype::method_match(CallContext *context) bool global = rx->global(); // ### use the standard builtin function, not the one that might be redefined in the proto - ScopedString execString(scope, context->d()->engine->newString(QStringLiteral("exec"))); - Scoped<FunctionObject> exec(scope, context->d()->engine->regExpClass->prototype->get(execString.getPointer())); + ScopedString execString(scope, scope.engine->newString(QStringLiteral("exec"))); + Scoped<FunctionObject> exec(scope, scope.engine->regExpPrototype.asObject()->get(execString.getPointer())); ScopedCallData callData(scope, 1); callData->thisObject = rx; |