aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexpobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-11-24 15:38:41 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-11 15:52:13 +0100
commit8afc1f7fe24c625cdb84406cc7665f1dcabf88c4 (patch)
tree04c5d73167544182e509ce7e40bd18c29909d0a7 /src/qml/jsruntime/qv4regexpobject.cpp
parent4322c8d7686c7cbbdf348146d32d705007b21d56 (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/qv4regexpobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 7758cd8483..7191a16235 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -65,8 +65,8 @@ using namespace QV4;
DEFINE_OBJECT_VTABLE(RegExpObject);
DEFINE_OBJECT_VTABLE(RegExpPrototype);
-Heap::RegExpObject::RegExpObject(InternalClass *ic)
- : Heap::Object(ic)
+Heap::RegExpObject::RegExpObject(InternalClass *ic, QV4::Object *prototype)
+ : Heap::Object(ic, prototype)
{
setVTable(QV4::RegExpObject::staticVTable());
@@ -78,7 +78,7 @@ Heap::RegExpObject::RegExpObject(InternalClass *ic)
}
Heap::RegExpObject::RegExpObject(QV4::ExecutionEngine *engine, QV4::RegExp *value, bool global)
- : Heap::Object(engine->regExpClass)
+ : Heap::Object(engine->regExpClass, engine->regExpPrototype.asObject())
, value(value->d())
, global(global)
{
@@ -93,7 +93,7 @@ Heap::RegExpObject::RegExpObject(QV4::ExecutionEngine *engine, QV4::RegExp *valu
// The conversion is not 100% exact since ECMA regexp and QRegExp
// have different semantics/flags, but we try to do our best.
Heap::RegExpObject::RegExpObject(QV4::ExecutionEngine *engine, const QRegExp &re)
- : Heap::Object(engine->regExpClass)
+ : Heap::Object(engine->regExpClass, engine->regExpPrototype.asObject())
{
setVTable(QV4::RegExpObject::staticVTable());
@@ -380,7 +380,7 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx)
}
// fill in result data
- Scoped<ArrayObject> array(scope, ctx->d()->engine->newArrayObject(ctx->d()->engine->regExpExecArrayClass));
+ Scoped<ArrayObject> array(scope, scope.engine->newArrayObject(scope.engine->regExpExecArrayClass, scope.engine->arrayPrototype.asObject()));
int len = r->value()->captureCount();
array->arrayReserve(len);
ScopedValue v(scope);