From 1be51cc3e7c9ca5256a52136d6fcc9c22c997625 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 13 Oct 2013 21:03:44 +0200 Subject: inline get_element calls Inline calls to get_element if the base is an object with a simple array structure, and the index is an integer number. Implemented for 64bit only for now, saves ~25% on crypto.js Change-Id: I3e34a6409169d90d3937f62264707d52a6c2f9f7 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4managed_p.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/qml/jsruntime/qv4managed_p.h') diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index e77c724994..b4469c8048 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -159,7 +159,7 @@ private: protected: Managed(InternalClass *internal) : _data(0), vtbl(&static_vtbl), internalClass(internal) - { inUse = 1; extensible = 1; hasAccessorProperty = 0; } + { inUse = 1; extensible = 1; } public: void *operator new(size_t size, MemoryManager *mm); @@ -282,20 +282,24 @@ public: ReturnedValue asReturnedValue() { return Value::fromManaged(this).asReturnedValue(); } + enum { + SimpleArray = 1 + }; + union { uint _data; struct { - uint markBit : 1; - uint inUse : 1; - uint extensible : 1; // used by Object - uint isNonStrictArgumentsObject : 1; - uint needsActivation : 1; // used by FunctionObject - uint strictMode : 1; // used by FunctionObject - uint bindingKeyFlag : 1; - uint hasAccessorProperty : 1; - uint type : 8; - mutable uint subtype : 8; - uint unused : 8; + uchar markBit : 1; + uchar inUse : 1; + uchar extensible : 1; // used by Object + uchar isNonStrictArgumentsObject : 1; + uchar needsActivation : 1; // used by FunctionObject + uchar strictMode : 1; // used by FunctionObject + uchar bindingKeyFlag : 1; + uchar hasAccessorProperty : 1; + uchar type; + mutable uchar subtype; + uchar flags; }; }; -- cgit v1.2.3