From a885d10a0289da85b8c966d2fa40fb10edae4fd7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Mar 2014 16:55:06 +0100 Subject: Extend the QML bootstrap library by the IR builders This is among other things needed to fix the qml import scanner to detect dependencies from .js files correctly. The patch also fixes the use of Q_QML_EXPORT towards Q_QML_PRIVATE_EXPORT where appropriate and corrects the wrong include path for the double conversion code to actually be relative to the file it is included from. This worked by accident because of other include paths present in the build. Change-Id: I338583dad2f76300819af8ab0dae8e5724c84430 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4runtime_p.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/qml/jsruntime/qv4runtime_p.h') diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index d00c579283..0979105680 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -103,7 +103,7 @@ struct NoThrowContext : public ExecutionContext { }; -struct Q_QML_EXPORT Runtime { +struct Q_QML_PRIVATE_EXPORT Runtime { // call static ReturnedValue callGlobalLookup(ExecutionContext *context, uint index, CallDataRef callData); static ReturnedValue callActivationProperty(ExecutionContext *, const StringRef name, CallDataRef callData); @@ -232,7 +232,7 @@ struct Q_QML_EXPORT Runtime { static void setQmlQObjectProperty(ExecutionContext *ctx, const ValueRef object, int propertyIndex, const ValueRef value); }; -struct Q_QML_EXPORT RuntimeHelpers { +struct Q_QML_PRIVATE_EXPORT RuntimeHelpers { static ReturnedValue objectDefaultValue(Object *object, int typeHint); static ReturnedValue toPrimitive(const ValueRef value, int typeHint); @@ -255,6 +255,7 @@ struct Q_QML_EXPORT RuntimeHelpers { // type conversion and testing +#ifndef V4_BOOTSTRAP inline ReturnedValue RuntimeHelpers::toPrimitive(const ValueRef value, int typeHint) { Object *o = value->asObject(); @@ -262,6 +263,7 @@ inline ReturnedValue RuntimeHelpers::toPrimitive(const ValueRef value, int typeH return value.asReturnedValue(); return RuntimeHelpers::objectDefaultValue(o, typeHint); } +#endif inline double RuntimeHelpers::toNumber(const ValueRef value) { @@ -338,6 +340,7 @@ inline ReturnedValue Runtime::bitAnd(const ValueRef left, const ValueRef right) return Encode(lval & rval); } +#ifndef V4_BOOTSTRAP inline ReturnedValue Runtime::add(ExecutionContext *ctx, const ValueRef left, const ValueRef right) { TRACE2(left, right); @@ -349,6 +352,7 @@ inline ReturnedValue Runtime::add(ExecutionContext *ctx, const ValueRef left, co return RuntimeHelpers::addHelper(ctx, left, right); } +#endif // V4_BOOTSTRAP inline ReturnedValue Runtime::sub(const ValueRef left, const ValueRef right) { @@ -532,6 +536,7 @@ inline Bool Runtime::compareStrictNotEqual(const ValueRef left, const ValueRef r return ! RuntimeHelpers::strictEqual(left, right); } +#ifndef V4_BOOTSTRAP inline Bool Runtime::compareInstanceof(ExecutionContext *ctx, const ValueRef left, const ValueRef right) { TRACE2(left, right); @@ -550,6 +555,13 @@ inline uint Runtime::compareIn(ExecutionContext *ctx, const ValueRef left, const return v->booleanValue(); } +#endif // V4_BOOTSTRAP + +inline Bool Runtime::toBoolean(const ValueRef value) +{ + return value->toBoolean(); +} + } // namespace QV4 QT_END_NAMESPACE -- cgit v1.2.3