diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-07-25 17:44:14 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-04 20:17:23 +0100 |
commit | 6f6b350976ccfe959223b1fbe8c21fe71efc45bd (patch) | |
tree | 5a15e3140d3d63e6ce415c3f09636402b22b878c | |
parent | 43296bb5fb578cc64b14fb4480e6daa87bb6491d (diff) |
Cleanup header file dependencies
Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
35 files changed, 90 insertions, 275 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 78c1905d41..02dc1a5078 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -52,6 +52,7 @@ #include <private/qv4functionobject_p.h> #include <private/qv4objectproto_p.h> #include <private/qv4scopedvalue_p.h> +#include <private/qv4objectiterator_p.h> using namespace QV4; diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index f7976e7cfc..cc6953cbf7 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -36,6 +36,7 @@ #include "qjsvalue_p.h" #include "private/qv4string_p.h" #include "private/qv4object_p.h" +#include "private/qv4context_p.h" QT_BEGIN_NAMESPACE @@ -51,7 +52,7 @@ QJSValueIteratorPrivate::QJSValueIteratorPrivate(const QJSValue &v) QV4::Scope scope(e); QV4::ScopedObject o(scope, jsp->value); - iterator = e->newForEachIteratorObject(e->currentContext(), o)->asReturnedValue(); + iterator = e->newForEachIteratorObject(o)->asReturnedValue(); currentName = (QV4::String *)0; nextName = (QV4::String *)0; @@ -223,7 +224,7 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) QJSValuePrivate *jsp = QJSValuePrivate::get(object); QV4::Scope scope(v4); QV4::ScopedObject o(scope, jsp->value); - d_ptr->iterator = v4->newForEachIteratorObject(v4->currentContext(), o)->asReturnedValue(); + d_ptr->iterator = v4->newForEachIteratorObject(o)->asReturnedValue(); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); it->d()->it.flags = QV4::ObjectIterator::NoFlags; QV4::String *nm = 0; diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index 35bd6e5501..4c8c172d0d 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -34,6 +34,7 @@ #include "qv4object_p.h" #include "qv4functionobject_p.h" #include "qv4mm_p.h" +#include "qv4runtime_p.h" using namespace QV4; diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 011279ae07..1d17672714 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -35,6 +35,7 @@ #include "qv4sparsearray_p.h" #include "qv4objectproto_p.h" #include "qv4scopedvalue_p.h" +#include "qv4runtime_p.h" using namespace QV4; diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index b4c78c3736..5235b651fb 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -42,20 +42,12 @@ QT_BEGIN_NAMESPACE namespace QV4 { -struct Object; -struct ExecutionEngine; -struct DeclarativeEnvironment; -struct Lookup; -struct Function; -struct ValueRef; - namespace CompiledData { struct CompilationUnit; struct Function; } struct CallContext; -struct CallContext; struct CatchContext; struct WithContext; diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index e00a705700..c8bd73dd4c 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -35,6 +35,8 @@ #include "qv4dateobject_p.h" #include "qv4objectproto_p.h" #include "qv4scopedvalue_p.h" +#include "qv4runtime_p.h" + #include <QtCore/qnumeric.h> #include <QtCore/qmath.h> #include <QtCore/QDateTime> diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index bcf0d07719..c001b60295 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -38,6 +38,7 @@ #include "qv4instr_moth_p.h" #include "qv4runtime_p.h" #include "qv4script_p.h" +#include "qv4objectiterator_p.h" #include <iostream> #include <algorithm> diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 3e7421a290..42cd860919 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -700,10 +700,10 @@ Returned<Object> *ExecutionEngine::newVariantObject(const QVariant &v) return o->asReturned<Object>(); } -Returned<Object> *ExecutionEngine::newForEachIteratorObject(ExecutionContext *ctx, Object *o) +Returned<Object> *ExecutionEngine::newForEachIteratorObject(Object *o) { Scope scope(this); - ScopedObject obj(scope, memoryManager->alloc<ForEachIteratorObject>(ctx, o)); + ScopedObject obj(scope, memoryManager->alloc<ForEachIteratorObject>(this, o)); return obj->asReturned<Object>(); } diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index c77c5b1ce1..6c9b90cb30 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -35,8 +35,7 @@ #include "qv4global_p.h" #include "private/qv4isel_p.h" -#include "qv4util_p.h" -#include "qv4property_p.h" +#include "qv4managed_p.h" #include <private/qintrusivelist_p.h> namespace WTF { @@ -341,7 +340,7 @@ public: Returned<Object> *newVariantObject(const QVariant &v); - Returned<Object> *newForEachIteratorObject(ExecutionContext *ctx, Object *o); + Returned<Object> *newForEachIteratorObject(Object *o); Returned<Object> *qmlContextObject() const; diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index b2c4d2e09d..63bbb01e74 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -34,44 +34,12 @@ #define QV4FUNCTION_H #include "qv4global_p.h" - -#include <QtCore/QVector> -#include <QtCore/QByteArray> -#include <QtCore/qurl.h> - -#include "qv4value_p.h" #include <private/qv4compileddata_p.h> -#include <private/qv4engine_p.h> QT_BEGIN_NAMESPACE namespace QV4 { -struct String; -struct Function; -struct Object; -struct FunctionObject; -struct ExecutionContext; -struct ExecutionEngine; -class MemoryManager; - -struct ObjectPrototype; -struct StringPrototype; -struct NumberPrototype; -struct BooleanPrototype; -struct ArrayPrototype; -struct FunctionPrototype; -struct DatePrototype; -struct ErrorPrototype; -struct EvalErrorPrototype; -struct RangeErrorPrototype; -struct ReferenceErrorPrototype; -struct SyntaxErrorPrototype; -struct TypeErrorPrototype; -struct URIErrorPrototype; -struct InternalClass; -struct Lookup; - struct Q_QML_EXPORT Function { const CompiledData::Function *compiledFunction; CompiledData::CompilationUnit *compilationUnit; diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 275b1c08c0..49a560d092 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -48,15 +48,11 @@ #include <private/qqmljsast_p.h> #include <private/qqmlcontextwrapper_p.h> #include <private/qqmlengine_p.h> -#include <qv4jsir_p.h> #include <qv4codegen_p.h> #include "private/qlocale_tools_p.h" #include <QtCore/qmath.h> #include <QtCore/QDebug> -#include <cassert> -#include <typeinfo> -#include <iostream> #include <algorithm> #include "qv4alloca_p.h" #include "qv4profiling_p.h" diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 2d57f6c015..32fa2e0349 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -33,59 +33,15 @@ #ifndef QV4FUNCTIONOBJECT_H #define QV4FUNCTIONOBJECT_H -#include "qv4global_p.h" -#include "qv4runtime_p.h" -#include "qv4engine_p.h" -#include "qv4context_p.h" #include "qv4object_p.h" -#include "qv4string_p.h" -#include "qv4managed_p.h" -#include "qv4property_p.h" #include "qv4function_p.h" -#include "qv4objectiterator_p.h" +#include "qv4context_p.h" #include "qv4mm_p.h" -#include <QtCore/QString> -#include <QtCore/QHash> -#include <QtCore/QScopedPointer> -#include <cstdio> -#include <cassert> - QT_BEGIN_NAMESPACE namespace QV4 { -struct Function; -struct Object; -struct BooleanObject; -struct NumberObject; -struct StringObject; -struct ArrayObject; -struct DateObject; -struct FunctionObject; -struct ErrorObject; -struct ArgumentsObject; -struct ExecutionContext; -struct ExecutionEngine; -class MemoryManager; - -struct ObjectPrototype; -struct StringPrototype; -struct NumberPrototype; -struct BooleanPrototype; -struct ArrayPrototype; -struct FunctionPrototype; -struct DatePrototype; -struct ErrorPrototype; -struct EvalErrorPrototype; -struct RangeErrorPrototype; -struct ReferenceErrorPrototype; -struct SyntaxErrorPrototype; -struct TypeErrorPrototype; -struct URIErrorPrototype; -struct InternalClass; -struct Lookup; - struct Q_QML_EXPORT FunctionObject: Object { struct Q_QML_PRIVATE_EXPORT Data : Object::Data { Data(ExecutionContext *scope, String *name, bool createProto = false); diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 81f1240d89..f265ed5f4f 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -126,6 +126,9 @@ struct ScriptFunction; struct InternalClass; struct Property; struct Value; +struct Lookup; +struct HeapObject; +struct ArrayData; struct BooleanObject; struct NumberObject; @@ -146,6 +149,7 @@ struct QObjectWrapper; // It will be returned in rax on x64, [eax,edx] on x86 and [r0,r1] on arm typedef quint64 ReturnedValue; struct CallData; +struct Scope; struct ScopedValue; struct ValueRef; template<typename T> struct Scoped; diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 06feea1d5a..972c341992 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -33,9 +33,9 @@ #ifndef QV4INTERNALCLASS_H #define QV4INTERNALCLASS_H -#include <QHash> -#include <QVector> #include "qv4global_p.h" + +#include <QHash> #include <private/qqmljsmemorypool_p.h> QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 268559dec8..fc5fb6aaeb 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -37,6 +37,8 @@ #include <qv4booleanobject_p.h> #include <qv4objectiterator_p.h> #include <qv4scopedvalue_p.h> +#include <qv4runtime_p.h> + #include <qjsondocument.h> #include <qstack.h> #include <qstringlist.h> diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index c69eace865..e382ad2739 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -33,9 +33,6 @@ #ifndef QMLJS_MANAGED_H #define QMLJS_MANAGED_H -#include <QtCore/QString> -#include <QtCore/QVector> -#include <QtCore/QDebug> #include "qv4global_p.h" #include "qv4value_p.h" #include "qv4internalclass_p.h" diff --git a/src/qml/jsruntime/qv4mm_p.h b/src/qml/jsruntime/qv4mm_p.h index cf9a14861e..f2267e5852 100644 --- a/src/qml/jsruntime/qv4mm_p.h +++ b/src/qml/jsruntime/qv4mm_p.h @@ -35,10 +35,8 @@ #define QV4GC_H #include "qv4global_p.h" -#include "qv4context_p.h" #include "qv4value_inl_p.h" - -#include <QScopedPointer> +#include "qv4scopedvalue_p.h" //#define DETAILED_MM_STATS diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp index 227ff14104..9f9c55d818 100644 --- a/src/qml/jsruntime/qv4numberobject.cpp +++ b/src/qml/jsruntime/qv4numberobject.cpp @@ -32,6 +32,8 @@ ****************************************************************************/ #include "qv4numberobject_p.h" +#include "qv4runtime_p.h" + #include <QtCore/qnumeric.h> #include <QtCore/qmath.h> #include <QtCore/QDebug> diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 0c61d666ab..b70a18f6a5 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -41,22 +41,9 @@ #include "qv4lookup_p.h" #include "qv4scopedvalue_p.h" #include "qv4memberdata_p.h" +#include "qv4objectiterator_p.h" -#include <private/qqmljsengine_p.h> -#include <private/qqmljslexer_p.h> -#include <private/qqmljsparser_p.h> -#include <private/qqmljsast_p.h> -#include <qv4jsir_p.h> -#include <qv4codegen_p.h> -#include "private/qlocale_tools_p.h" - -#include <QtCore/qmath.h> -#include <QtCore/QDebug> -#include <cassert> -#include <typeinfo> -#include <iostream> #include <stdint.h> -#include "qv4alloca_p.h" using namespace QV4; diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 4e9d1527c2..d57d1bf0f8 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -30,70 +30,17 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QMLJS_OBJECTS_H -#define QMLJS_OBJECTS_H - -#include "qv4global_p.h" -#include "qv4runtime_p.h" -#include "qv4engine_p.h" -#include "qv4context_p.h" -#include "qv4string_p.h" +#ifndef QV4_OBJECT_H +#define QV4_OBJECT_H + #include "qv4managed_p.h" -#include "qv4property_p.h" -#include "qv4internalclass_p.h" -#include "qv4arraydata_p.h" #include "qv4memberdata_p.h" - -#include <QtCore/QString> -#include <QtCore/QHash> -#include <QtCore/QScopedPointer> -#include <cstdio> -#include <cassert> - -#ifdef _WIN32_WCE -#undef assert -#define assert(x) -#endif // _WIN32_WCE +#include "qv4arraydata_p.h" QT_BEGIN_NAMESPACE namespace QV4 { -struct Function; -struct Lookup; -struct Object; -struct ObjectIterator; -struct BooleanObject; -struct NumberObject; -struct StringObject; -struct ArrayObject; -struct DateObject; -struct FunctionObject; -struct RegExpObject; -struct ErrorObject; -struct ArgumentsObject; -struct ExecutionContext; -struct CallContext; -struct ExecutionEngine; -class MemoryManager; - -struct ObjectPrototype; -struct StringPrototype; -struct NumberPrototype; -struct BooleanPrototype; -struct ArrayPrototype; -struct FunctionPrototype; -struct DatePrototype; -struct RegExpPrototype; -struct ErrorPrototype; -struct EvalErrorPrototype; -struct RangeErrorPrototype; -struct ReferenceErrorPrototype; -struct SyntaxErrorPrototype; -struct TypeErrorPrototype; -struct URIErrorPrototype; - - struct Q_QML_EXPORT Object: Managed { struct Data : Managed::Data { Data(ExecutionEngine *engine) diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index 3ed73b5c08..24efd7eb86 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -34,24 +34,12 @@ #define QV4OBJECTITERATOR_H #include "qv4global_p.h" -#include "qv4property_p.h" -#include "qv4scopedvalue_p.h" #include "qv4object_p.h" QT_BEGIN_NAMESPACE namespace QV4 { -struct SparseArrayNode; -struct Object; -struct ArrayObject; -struct PropertyAttributes; -struct ExecutionContext; -struct Property; -struct String; -struct InternalClass; -struct ForEachIteratorObject; - struct Q_QML_EXPORT ObjectIterator { enum Flags { @@ -81,8 +69,8 @@ private: struct ForEachIteratorObject: Object { struct Data : Object::Data { - Data(ExecutionContext *ctx, Object *o) - : Object::Data(ctx->engine()) + Data(ExecutionEngine *engine, Object *o) + : Object::Data(engine) , it(workArea, workArea + 1, o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { setVTable(staticVTable()); } diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 9cbf4b204e..d448d21f0c 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -36,30 +36,13 @@ #include "qv4argumentsobject_p.h" #include "qv4mm_p.h" #include "qv4scopedvalue_p.h" +#include "qv4runtime_p.h" +#include "qv4objectiterator_p.h" + #include <QtCore/qnumeric.h> #include <QtCore/qmath.h> #include <QtCore/QDateTime> #include <QtCore/QStringList> -#include <QtCore/QDebug> -#include <cassert> - -#include <private/qqmljsengine_p.h> -#include <private/qqmljslexer_p.h> -#include <private/qqmljsparser_p.h> -#include <private/qqmljsast_p.h> -#include <qv4jsir_p.h> -#include <qv4codegen_p.h> - -#ifndef Q_OS_WIN -# include <time.h> -# ifndef Q_OS_VXWORKS -# include <sys/time.h> -# else -# include "qplatformdefs.h" -# endif -#else -# include <windows.h> -#endif using namespace QV4; diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h index f9b3159033..601e3446f4 100644 --- a/src/qml/jsruntime/qv4property_p.h +++ b/src/qml/jsruntime/qv4property_p.h @@ -34,7 +34,7 @@ #define QV4PROPERTYDESCRIPTOR_H #include "qv4global_p.h" -#include "qv4value_inl_p.h" +#include "qv4value_p.h" #include "qv4internalclass_p.h" QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 54b42c54fb..fbf5ba1759 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -35,11 +35,11 @@ #include "qv4runtime_p.h" #ifndef V4_BOOTSTRAP #include "qv4object_p.h" -#include "qv4jsir_p.h" #include "qv4objectproto_p.h" #include "qv4globalobject_p.h" #include "qv4stringobject_p.h" #include "qv4argumentsobject_p.h" +#include "qv4objectiterator_p.h" #include "qv4lookup_p.h" #include "qv4function_p.h" #include "private/qlocale_tools_p.h" @@ -625,8 +625,7 @@ ReturnedValue Runtime::foreachIterator(ExecutionContext *ctx, const ValueRef in) Scoped<Object> o(scope, (Object *)0); if (!in->isNullOrUndefined()) o = in->toObject(ctx); - Scoped<Object> it(scope, ctx->engine()->newForEachIteratorObject(ctx, o)); - return it.asReturnedValue(); + return ctx->engine()->newForEachIteratorObject(o)->asReturnedValue(); } ReturnedValue Runtime::foreachNextPropertyName(const ValueRef foreach_iterator) @@ -858,6 +857,25 @@ QV4::Bool Runtime::compareLessEqual(const QV4::ValueRef l, const QV4::ValueRef r } #ifndef V4_BOOTSTRAP +Bool Runtime::compareInstanceof(ExecutionContext *ctx, const ValueRef left, const ValueRef right) +{ + TRACE2(left, right); + + Scope scope(ctx); + ScopedValue v(scope, Runtime::instanceof(ctx, left, right)); + return v->booleanValue(); +} + +uint Runtime::compareIn(ExecutionContext *ctx, const ValueRef left, const ValueRef right) +{ + TRACE2(left, right); + + Scope scope(ctx); + ScopedValue v(scope, Runtime::in(ctx, left, right)); + return v->booleanValue(); +} + + ReturnedValue Runtime::callGlobalLookup(ExecutionContext *context, uint index, CallData *callData) { Scope scope(context); diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index 52a345f83e..f69ea1620c 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -35,20 +35,11 @@ #include "qv4global_p.h" #include "qv4value_inl_p.h" -#include "qv4math_p.h" -#include "qv4scopedvalue_p.h" #include "qv4context_p.h" +#include "qv4math_p.h" -#include <QtCore/QString> #include <QtCore/qnumeric.h> -#include <QtCore/QDebug> -#include <QtCore/qurl.h> -#include <cmath> -#include <cassert> -#include <limits> - -//#include <wtf/MathExtras.h> QT_BEGIN_NAMESPACE @@ -529,27 +520,6 @@ 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); - - Scope scope(ctx); - ScopedValue v(scope, Runtime::instanceof(ctx, left, right)); - return v->booleanValue(); -} - -inline uint Runtime::compareIn(ExecutionContext *ctx, const ValueRef left, const ValueRef right) -{ - TRACE2(left, right); - - Scope scope(ctx); - ScopedValue v(scope, Runtime::in(ctx, left, right)); - return v->booleanValue(); -} - -#endif // V4_BOOTSTRAP - inline Bool Runtime::toBoolean(const ValueRef value) { return value->toBoolean(); diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index f62dfeac6d..90a3bf1602 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -36,6 +36,7 @@ #include "qv4engine_p.h" #include "qv4value_p.h" #include "qv4persistent_p.h" +#include "qv4property_p.h" QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 7a0a643a7e..462c4b43f4 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -39,7 +39,8 @@ #include <private/qv4arrayobject_p.h> #include <private/qqmlengine_p.h> #include <private/qv4scopedvalue_p.h> -#include <private/qv4internalclass_p.h> +#include "qv4runtime_p.h" +#include "qv4objectiterator_p.h" #include <algorithm> diff --git a/src/qml/jsruntime/qv4sequenceobject_p.h b/src/qml/jsruntime/qv4sequenceobject_p.h index be348e524c..c0848ec0ba 100644 --- a/src/qml/jsruntime/qv4sequenceobject_p.h +++ b/src/qml/jsruntime/qv4sequenceobject_p.h @@ -50,6 +50,7 @@ #include "qv4value_inl_p.h" #include "qv4object_p.h" +#include "qv4context_p.h" QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index ce0e1f9d73..901a12c5a8 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -171,20 +171,6 @@ public: static uint toArrayIndex(const QString &str); }; -#ifndef V4_BOOTSTRAP -template<> -inline String *value_cast(const Value &v) { - return v.asString(); -} - -template<> -inline ReturnedValue value_convert<String>(ExecutionEngine *e, const Value &v) -{ - return v.toString(e)->asReturnedValue(); -} - -#endif - } QT_END_NAMESPACE diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index 0293054457..a80cc40add 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -31,6 +31,7 @@ ** ****************************************************************************/ #include <qv4engine_p.h> +#include <qv4runtime_p.h> #ifndef V4_BOOTSTRAP #include <qv4object_p.h> #include <qv4objectproto_p.h> diff --git a/src/qml/jsruntime/qv4value_inl_p.h b/src/qml/jsruntime/qv4value_inl_p.h index 7a6cdb40d2..2600148417 100644 --- a/src/qml/jsruntime/qv4value_inl_p.h +++ b/src/qml/jsruntime/qv4value_inl_p.h @@ -35,18 +35,11 @@ #include <cmath> // this HAS to come -#include <QtCore/QString> -#include <QtCore/qnumeric.h> -#include "qv4global_p.h" +#include "qv4value_p.h" + #include "qv4string_p.h" -#include <QtCore/QDebug> #include "qv4managed_p.h" #include "qv4engine_p.h" -#include <private/qtqmlglobal_p.h> - -//#include <wtf/MathExtras.h> - -#include "qv4value_p.h" QT_BEGIN_NAMESPACE @@ -70,6 +63,13 @@ inline bool Value::isPrimitive() const return !isObject(); } +inline String *Value::asString() const +{ + if (isString()) + return stringValue(); + return 0; +} + inline ExecutionEngine *Value::engine() const { Managed *m = asManaged(); @@ -275,6 +275,21 @@ inline ErrorObject *Value::asErrorObject() const template<typename T> inline T *Value::as() const { Managed *m = isObject() ? managed() : 0; return m ? m->as<T>() : 0; } +#ifndef V4_BOOTSTRAP + +template<> +inline String *value_cast(const Value &v) { + return v.asString(); +} + +template<> +inline ReturnedValue value_convert<String>(ExecutionEngine *e, const Value &v) +{ + return v.toString(e)->asReturnedValue(); +} + +#endif + #endif } // namespace QV4 diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 2180fbc248..bf8367c9eb 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -381,13 +381,6 @@ inline Managed *Value::asManaged() const return 0; } -inline String *Value::asString() const -{ - if (isString()) - return stringValue(); - return 0; -} - struct Q_QML_PRIVATE_EXPORT Primitive : public Value { inline static Primitive emptyValue(); diff --git a/src/qml/qml/qqmllistwrapper.cpp b/src/qml/qml/qqmllistwrapper.cpp index 13e5e49b55..b62689c454 100644 --- a/src/qml/qml/qqmllistwrapper.cpp +++ b/src/qml/qml/qqmllistwrapper.cpp @@ -35,6 +35,7 @@ #include <private/qv8engine_p.h> #include <private/qqmllist_p.h> #include <private/qv4objectproto_p.h> +#include <qv4objectiterator_p.h> #include <private/qv4functionobject_p.h> diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index b26557e0ff..fee1392c44 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -46,6 +46,7 @@ #include <private/qv4value_inl_p.h> #include <private/qv4functionobject_p.h> +#include <qv4objectiterator_p.h> QT_BEGIN_NAMESPACE diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 019d6790e1..30a01188fe 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -48,6 +48,7 @@ #include <private/qv4functionobject_p.h> #include <private/qv4scopedvalue_p.h> #include <private/qv4alloca_p.h> +#include <private/qv4runtime_p.h> #ifdef Q_CC_MSVC #define NO_INLINE __declspec(noinline) |