diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-08-27 14:38:24 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-09-22 08:19:59 +0000 |
commit | 9420eb5c4e55d68b996bb0120db1f2dfeeef3a8c (patch) | |
tree | b8d3e9b6c41f728de1749f5fe029046277c4a9d4 /src/qml/jsruntime/qv4regexpobject_p.h | |
parent | 17a0c271e0ec606d15fc87dab23b2e3750c0e301 (diff) |
Use the new construction scheme for RegExpObjects
Gives around 10% speed improvement on the v8 regexp
benchmark.
Change-Id: Iad37bcbc79ccbfb92f65852b660364c919862a75
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject_p.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h index 04fc838147..0c9757a514 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(); + RegExpObject(QV4::RegExp *value, bool global); + RegExpObject(const QRegExp &re); Pointer<RegExp> value; bool global; @@ -74,11 +74,6 @@ struct RegExpCtor : FunctionObject { void clearLastMatch(); }; -struct RegExpPrototype : RegExpObject -{ - inline RegExpPrototype(ExecutionEngine *e); -}; - } struct RegExpObject: Object { @@ -93,6 +88,11 @@ struct RegExpObject: Object { }; enum { + Index_LastIndex = 0, + Index_Source = 1, + Index_Global = 2, + Index_IgnoreCase = 3, + Index_Multiline = 4, Index_ArrayIndex = Heap::ArrayObject::LengthPropertyIndex + 1, Index_ArrayInput = Index_ArrayIndex + 1 }; @@ -100,7 +100,7 @@ struct RegExpObject: Object { Heap::RegExp *value() const { return d()->value; } bool global() const { return d()->global; } - void init(ExecutionEngine *engine); + void initProperties(); Value *lastIndexProperty(); QRegExp toQRegExp() const; @@ -128,8 +128,6 @@ struct RegExpCtor: FunctionObject struct RegExpPrototype: RegExpObject { - V4_OBJECT2(RegExpPrototype, RegExpObject) - void init(ExecutionEngine *engine, Object *ctor); static ReturnedValue method_exec(CallContext *ctx); @@ -145,11 +143,6 @@ struct RegExpPrototype: RegExpObject static ReturnedValue method_get_rightContext(CallContext *ctx); }; -inline Heap::RegExpPrototype::RegExpPrototype(ExecutionEngine *e) - : RegExpObject(e->emptyClass, e->objectPrototype()) -{ -} - } QT_END_NAMESPACE |