Cleanup header file dependencies

Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
Lars Knoll 2014-07-25 17:44:14 +02:00 committed by Simon Hausmann
parent 43296bb5fb
commit 6f6b350976
35 changed files with 89 additions and 274 deletions

View File

@ -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;

View File

@ -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;

View File

@ -34,6 +34,7 @@
#include "qv4object_p.h"
#include "qv4functionobject_p.h"
#include "qv4mm_p.h"
#include "qv4runtime_p.h"
using namespace QV4;

View File

@ -35,6 +35,7 @@
#include "qv4sparsearray_p.h"
#include "qv4objectproto_p.h"
#include "qv4scopedvalue_p.h"
#include "qv4runtime_p.h"
using namespace QV4;

View File

@ -42,19 +42,11 @@ 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;

View File

@ -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>

View File

@ -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>

View File

@ -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>();
}

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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>

View File

@ -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"

View File

@ -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

View File

@ -32,6 +32,8 @@
****************************************************************************/
#include "qv4numberobject_p.h"
#include "qv4runtime_p.h"
#include <QtCore/qnumeric.h>
#include <QtCore/qmath.h>
#include <QtCore/QDebug>

View File

@ -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;

View File

@ -30,70 +30,17 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLJS_OBJECTS_H
#define QMLJS_OBJECTS_H
#ifndef QV4_OBJECT_H
#define QV4_OBJECT_H
#include "qv4global_p.h"
#include "qv4runtime_p.h"
#include "qv4engine_p.h"
#include "qv4context_p.h"
#include "qv4string_p.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)

View File

@ -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());
}

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -36,6 +36,7 @@
#include "qv4engine_p.h"
#include "qv4value_p.h"
#include "qv4persistent_p.h"
#include "qv4property_p.h"
QT_BEGIN_NAMESPACE

View File

@ -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>

View File

@ -50,6 +50,7 @@
#include "qv4value_inl_p.h"
#include "qv4object_p.h"
#include "qv4context_p.h"
QT_BEGIN_NAMESPACE

View File

@ -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

View File

@ -31,6 +31,7 @@
**
****************************************************************************/
#include <qv4engine_p.h>
#include <qv4runtime_p.h>
#ifndef V4_BOOTSTRAP
#include <qv4object_p.h>
#include <qv4objectproto_p.h>

View File

@ -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

View File

@ -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();

View File

@ -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>

View File

@ -46,6 +46,7 @@
#include <private/qv4value_inl_p.h>
#include <private/qv4functionobject_p.h>
#include <qv4objectiterator_p.h>
QT_BEGIN_NAMESPACE

View File

@ -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)