Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4global_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QV4GLOBAL_H
6#define QV4GLOBAL_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qglobal.h>
20#include <private/qv4compilerglobal_p.h>
21#include <QString>
22
23#include <qtqmlglobal.h>
24#include <private/qtqmlglobal_p.h>
25
26// Do certain things depending on whether the JIT is enabled or disabled
27
28#if QT_CONFIG(qml_jit)
29#define ENABLE_YARR_JIT 1
30#define ENABLE_JIT 1
31#define ENABLE_ASSEMBLER 1
32#else
33#define ENABLE_YARR_JIT 0
34#define ENABLE_ASSEMBLER 0
35#define ENABLE_JIT 0
36#endif
37
38#if defined(Q_OS_QNX) && defined(_CPPLIB_VER)
39#include <math.h>
40#undef isnan
41#undef isfinite
42#undef isinf
43#undef signbit
44#endif
45
46QT_BEGIN_NAMESPACE
47
48namespace QV4 {
49
50namespace Compiler {
51 struct Module;
52 struct Context;
53 struct JSUnitGenerator;
54 class Codegen;
55}
56
57namespace Moth {
59}
60
61namespace Heap {
62 struct Base;
63 struct MemberData;
64 struct ArrayData;
65
66 struct StringOrSymbol;
67 struct String;
68 struct Symbol;
69 struct Object;
70 struct ObjectPrototype;
71
72 struct ExecutionContext;
73 struct CallContext;
74 struct QmlContext;
75 struct ScriptFunction;
76 struct InternalClass;
77
78 struct BooleanObject;
79 struct NumberObject;
80 struct StringObject;
81 struct ArrayObject;
82 struct DateObject;
83 struct FunctionObject;
84 struct JavaScriptFunctionObject;
85 struct ErrorObject;
86 struct ArgumentsObject;
87 struct QObjectWrapper;
88 struct RegExpObject;
89 struct UrlObject;
90 struct UrlSearchParamsObject;
91 struct RegExp;
92 struct EvalFunction;
93
94 struct SharedArrayBuffer;
95 struct ArrayBuffer;
96 struct DataView;
97 struct TypedArray;
98
99 struct MapObject;
100 struct SetObject;
101
102 struct PromiseObject;
103 struct PromiseCapability;
104
105 template <typename T, size_t> struct Pointer;
106}
107
108struct CppStackFrame;
109struct JSTypesStackFrame;
110struct MetaTypesStackFrame;
111class MemoryManager;
112class ExecutableAllocator;
113struct PropertyKey;
114struct StringOrSymbol;
115struct String;
116struct Symbol;
117struct Object;
118struct ObjectPrototype;
119struct ObjectIterator;
120struct ExecutionContext;
121struct CallContext;
122struct QmlContext;
123struct ScriptFunction;
124struct InternalClass;
125struct Property;
126struct Value;
127template<size_t> struct HeapValue;
128template<size_t> struct ValueArray;
129struct Lookup;
130struct ArrayData;
131struct VTable;
132struct Function;
133
134struct BooleanObject;
135struct NumberObject;
136struct StringObject;
137struct ArrayObject;
138struct DateObject;
139struct FunctionObject;
140struct ErrorObject;
141struct ArgumentsObject;
142struct Managed;
143struct ExecutionEngine;
144struct QObjectWrapper;
145struct RegExpObject;
146struct RegExp;
147struct EvalFunction;
148
149struct SharedArrayBuffer;
150struct ArrayBuffer;
151struct DataView;
152struct TypedArray;
153
154struct MapObject;
155struct SetMapObject;
156
157struct PromiseObject;
158struct PromiseCapability;
159
160struct CallData;
161struct Scope;
162struct ScopedValue;
163template<typename T> struct Scoped;
164typedef Scoped<String> ScopedString;
165typedef Scoped<StringOrSymbol> ScopedStringOrSymbol;
166typedef Scoped<Object> ScopedObject;
167typedef Scoped<ArrayObject> ScopedArrayObject;
168typedef Scoped<FunctionObject> ScopedFunctionObject;
169typedef Scoped<ExecutionContext> ScopedContext;
170
171struct PersistentValueStorage;
172class PersistentValue;
173class WeakValue;
174struct MarkStack;
175
176struct IdentifierTable;
177class RegExpCache;
179
190
193
195{
197 QT_WARNING_DISABLE_MSVC(4201) // nonstandard extension used: nameless struct/union
198 union {
200 struct {
203 };
204 struct {
213 };
214 };
216
217 enum Type {
218 Data = 0,
221 };
222
242
243 void setType(Type t) { m_type = t; type_set = true; }
244 Type type() const { return type_set ? (Type)m_type : Generic; }
245
246 bool isData() const { return type() == PropertyAttributes::Data || writable_set; }
247 bool isAccessor() const { return type() == PropertyAttributes::Accessor; }
248 bool isGeneric() const { return type() == PropertyAttributes::Generic && !writable_set; }
249
250 bool hasType() const { return type_set; }
251 bool hasWritable() const { return writable_set; }
252 bool hasConfigurable() const { return configurable_set; }
253 bool hasEnumerable() const { return enumerable_set; }
254
255 void setWritable(bool b) { m_writable = b; writable_set = true; }
257 void setEnumerable(bool b) { m_enumerable = b; enumerable_set = true; }
258
259 void resolve() { m_mask = 0xf; if (m_type == Accessor) { m_writable = false; writable_set = false; } }
260
261 bool isWritable() const { return m_type != Data || m_writable; }
262 bool isEnumerable() const { return m_enumerable; }
263 bool isConfigurable() const { return m_configurable; }
264
265 void clearType() { m_type = Data; type_set = false; }
266 void clearWritable() { m_writable = false; writable_set = false; }
267 void clearEnumerable() { m_enumerable = false; enumerable_set = false; }
269
270 void clear() { m_all = 0; }
271 bool isEmpty() const { return !m_all; }
272
273 uint all() const { return m_all; }
274
276 return m_all == other.m_all;
277 }
279 return m_all != other.m_all;
280 }
281};
282
283struct Q_QML_EXPORT StackFrame {
286 int line = -1;
287 int column = -1;
288};
290
291namespace JIT {
292
297
298} // JIT namespace
299
300} // QV4 namespace
301
303
304QT_END_NAMESPACE
305
306#endif // QV4GLOBAL_H
DECLARE_HEAP_OBJECT(StrictArgumentsObject, Object)
DECLARE_EXPORTED_HEAP_OBJECT(Object, Base)
Definition qv4object_p.h:37
DECLARE_HEAP_OBJECT(ArgumentsObject, Object)
CallResultDestination
Definition qjsvalue.h:23
Scoped< FunctionObject > ScopedFunctionObject
QVector< StackFrame > StackTrace
int qYouForgotTheQ_MANAGED_Macro(T, T)
Scoped< Object > ScopedObject
Scoped< ArrayObject > ScopedArrayObject
Scoped< String > ScopedString
Scoped< StringOrSymbol > ScopedStringOrSymbol
void qYouForgotTheQ_MANAGED_Macro(T1, T2)
PropertyFlag
@ Attr_Invalid
@ Attr_NotConfigurable
@ Attr_Data
@ Attr_NotEnumerable
@ Attr_ReadOnly
@ Attr_NotWritable
@ Attr_ReadOnly_ButConfigurable
@ Attr_Accessor
Scoped< ExecutionContext > ScopedContext
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
DEFINE_OBJECT_VTABLE(StrictArgumentsObject)
DEFINE_OBJECT_VTABLE(ArgumentsObject)
#define V4_MANAGED_SIZE_TEST
#define V4_NEEDS_DESTROY
#define V4_MANAGED_ITSELF(DataClass, superClass)
#define Q_MANAGED_TYPE(type)
#define V4_INTERNALCLASS(c)
#define Q_MANAGED_CHECK
static qint64 virtualGetLength(const Managed *m)
static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *desc, PropertyAttributes attrs)
Heap::CallContext * context() const
static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
static OwnPropertyKeyIterator * virtualOwnPropertyKeys(const Object *m, Value *target)
static bool isNonStrictArgumentsObject(Managed *m)
static bool virtualDeleteProperty(Managed *m, PropertyKey id)
static PropertyAttributes virtualGetOwnProperty(const Managed *m, PropertyKey id, Property *p)
bool isMapped(uint arg) const
static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver)
static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *p, PropertyAttributes attrs)
static qint64 virtualGetLength(const Managed *m)
QStringList toQStringList() const
void init(const QStringList &list)
void init(double val)
PropertyKey next(const Object *o, Property *pd=nullptr, PropertyAttributes *attrs=nullptr) override