#include <private/qv4functionobject_p.h>
#include <private/qv4objectproto_p.h>
#include <private/qv4scopedvalue_p.h>
+#include <private/qv4objectiterator_p.h>
using namespace QV4;
#include "qjsvalue_p.h"
#include "private/qv4string_p.h"
#include "private/qv4object_p.h"
+#include "private/qv4context_p.h"
QT_BEGIN_NAMESPACE
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;
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;
#include "qv4object_p.h"
#include "qv4functionobject_p.h"
#include "qv4mm_p.h"
+#include "qv4runtime_p.h"
using namespace QV4;
#include "qv4sparsearray_p.h"
#include "qv4objectproto_p.h"
#include "qv4scopedvalue_p.h"
+#include "qv4runtime_p.h"
using namespace QV4;
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;
#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>
#include "qv4instr_moth_p.h"
#include "qv4runtime_p.h"
#include "qv4script_p.h"
+#include "qv4objectiterator_p.h"
#include <iostream>
#include <algorithm>
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>();
}
#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 {
Returned<Object> *newVariantObject(const QVariant &v);
- Returned<Object> *newForEachIteratorObject(ExecutionContext *ctx, Object *o);
+ Returned<Object> *newForEachIteratorObject(Object *o);
Returned<Object> *qmlContextObject() const;
#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;
#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"
#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);
struct InternalClass;
struct Property;
struct Value;
+struct Lookup;
+struct HeapObject;
+struct ArrayData;
struct BooleanObject;
struct NumberObject;
// 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;
#ifndef QV4INTERNALCLASS_H
#define QV4INTERNALCLASS_H
-#include <QHash>
-#include <QVector>
#include "qv4global_p.h"
+
+#include <QHash>
#include <private/qqmljsmemorypool_p.h>
QT_BEGIN_NAMESPACE
#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>
#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"
#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
****************************************************************************/
#include "qv4numberobject_p.h"
+#include "qv4runtime_p.h"
+
#include <QtCore/qnumeric.h>
#include <QtCore/qmath.h>
#include <QtCore/QDebug>
#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;
** $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)
#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 {
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());
}
#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;
#define QV4PROPERTYDESCRIPTOR_H
#include "qv4global_p.h"
-#include "qv4value_inl_p.h"
+#include "qv4value_p.h"
#include "qv4internalclass_p.h"
QT_BEGIN_NAMESPACE
#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"
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)
}
#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);
#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
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();
#include "qv4engine_p.h"
#include "qv4value_p.h"
#include "qv4persistent_p.h"
+#include "qv4property_p.h"
QT_BEGIN_NAMESPACE
#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>
#include "qv4value_inl_p.h"
#include "qv4object_p.h"
+#include "qv4context_p.h"
QT_BEGIN_NAMESPACE
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
**
****************************************************************************/
#include <qv4engine_p.h>
+#include <qv4runtime_p.h>
#ifndef V4_BOOTSTRAP
#include <qv4object_p.h>
#include <qv4objectproto_p.h>
#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
return !isObject();
}
+inline String *Value::asString() const
+{
+ if (isString())
+ return stringValue();
+ return 0;
+}
+
inline ExecutionEngine *Value::engine() const
{
Managed *m = asManaged();
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
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();
#include <private/qv8engine_p.h>
#include <private/qqmllist_p.h>
#include <private/qv4objectproto_p.h>
+#include <qv4objectiterator_p.h>
#include <private/qv4functionobject_p.h>
#include <private/qv4value_inl_p.h>
#include <private/qv4functionobject_p.h>
+#include <qv4objectiterator_p.h>
QT_BEGIN_NAMESPACE
#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)