From 8afc1f7fe24c625cdb84406cc7665f1dcabf88c4 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 24 Nov 2014 15:38:41 +0100 Subject: 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 --- src/qml/jsruntime/qv4regexpobject_p.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/qml/jsruntime/qv4regexpobject_p.h') diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h index febd0dd7b2..1320527fe1 100644 --- a/src/qml/jsruntime/qv4regexpobject_p.h +++ b/src/qml/jsruntime/qv4regexpobject_p.h @@ -57,9 +57,9 @@ namespace QV4 { namespace Heap { struct RegExpObject : Object { + RegExpObject(InternalClass *ic, QV4::Object *prototype); RegExpObject(QV4::ExecutionEngine *engine, QV4::RegExp *value, bool global); RegExpObject(QV4::ExecutionEngine *engine, const QRegExp &re); - RegExpObject(InternalClass *ic); RegExp *value; bool global; @@ -76,7 +76,7 @@ struct RegExpCtor : FunctionObject { struct RegExpPrototype : RegExpObject { - inline RegExpPrototype(InternalClass *ic); + inline RegExpPrototype(ExecutionEngine *e); }; } @@ -145,10 +145,9 @@ struct RegExpPrototype: RegExpObject static ReturnedValue method_get_rightContext(CallContext *ctx); }; -inline Heap::RegExpPrototype::RegExpPrototype(InternalClass *ic) - : RegExpObject(ic) +inline Heap::RegExpPrototype::RegExpPrototype(ExecutionEngine *e) + : RegExpObject(InternalClass::create(e, QV4::RegExpPrototype::staticVTable()), e->objectPrototype.asObject()) { - setVTable(QV4::RegExpPrototype::staticVTable()); } } -- cgit v1.2.3