From 40fd9ff0ffcf72fb1f27d011dfe07fea764fcff2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 6 Dec 2013 10:28:50 +0100 Subject: Move Managed::type and some flags into the vtable Move the type flag into the vtable to free up these bits in the Managed class, and not have to set them at object construction time. As we often need to know whether a Managed object is a Object, FunctionObject or String, add some bitflags to test for these to the vtable. Change-Id: I7d08ca044544debb307b55f124f34cb086ad9e84 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4mathobject.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qml/jsruntime/qv4mathobject.cpp') diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp index 5a7af1f041..6225d6b4ae 100644 --- a/src/qml/jsruntime/qv4mathobject.cpp +++ b/src/qml/jsruntime/qv4mathobject.cpp @@ -51,14 +51,14 @@ using namespace QV4; +DEFINE_MANAGED_VTABLE(MathObject); + static const double qt_PI = 2.0 * ::asin(1.0); -MathObject::MathObject(ExecutionEngine *engine) - : Object(engine) +MathObject::MathObject(InternalClass *ic) + : Object(ic) { - type = Type_MathObject; - - Scope scope(engine); + Scope scope(ic->engine); ScopedObject protectThis(scope, this); defineReadonlyProperty(QStringLiteral("E"), Primitive::fromDouble(::exp(1.0))); -- cgit v1.2.3