Qt 6.x
The Qt SDK
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
4#ifndef QV4GLOBAL_H
5#define QV4GLOBAL_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qglobal.h>
19#include <private/qv4compilerglobal_p.h>
20#include <QString>
21
22#include <qtqmlglobal.h>
23#include <private/qtqmlglobal_p.h>
24
25// Do certain things depending on whether the JIT is enabled or disabled
26
27#if QT_CONFIG(qml_jit)
28#define ENABLE_YARR_JIT 1
29#define ENABLE_JIT 1
30#define ENABLE_ASSEMBLER 1
31#else
32#define ENABLE_YARR_JIT 0
33#define ENABLE_ASSEMBLER 0
34#define ENABLE_JIT 0
35#endif
36
37#if defined(Q_OS_QNX) && defined(_CPPLIB_VER)
38#include <math.h>
39#undef isnan
40#undef isfinite
41#undef isinf
42#undef signbit
43#endif
44
46
47namespace QV4 {
48
49namespace Compiler {
50 struct Module;
51 struct Context;
52 struct JSUnitGenerator;
53 class Codegen;
54}
55
56namespace Moth {
57 class BytecodeGenerator;
58}
59
60namespace Heap {
61 struct Base;
62 struct MemberData;
63 struct ArrayData;
64
65 struct StringOrSymbol;
66 struct String;
67 struct Symbol;
68 struct Object;
69 struct ObjectPrototype;
70
71 struct ExecutionContext;
72 struct CallContext;
73 struct QmlContext;
74 struct ScriptFunction;
75 struct InternalClass;
76
77 struct BooleanObject;
78 struct NumberObject;
79 struct StringObject;
80 struct ArrayObject;
81 struct DateObject;
82 struct FunctionObject;
83 struct ErrorObject;
84 struct ArgumentsObject;
85 struct QObjectWrapper;
86 struct RegExpObject;
87 struct UrlObject;
88 struct UrlSearchParamsObject;
89 struct RegExp;
90 struct EvalFunction;
91
92 struct SharedArrayBuffer;
93 struct ArrayBuffer;
94 struct DataView;
95 struct TypedArray;
96
97 struct MapObject;
98 struct SetObject;
99
100 struct PromiseObject;
101 struct PromiseCapability;
102
103 template <typename T, size_t> struct Pointer;
104}
105
106struct CppStackFrame;
107struct JSTypesStackFrame;
108struct MetaTypesStackFrame;
109class MemoryManager;
110class ExecutableAllocator;
111struct PropertyKey;
112struct StringOrSymbol;
113struct String;
114struct Symbol;
115struct Object;
116struct ObjectPrototype;
117struct ObjectIterator;
118struct ExecutionContext;
119struct CallContext;
120struct QmlContext;
121struct ScriptFunction;
122struct InternalClass;
123struct Property;
124struct Value;
125template<size_t> struct HeapValue;
126template<size_t> struct ValueArray;
127struct Lookup;
128struct ArrayData;
129struct VTable;
130struct Function;
131
132struct BooleanObject;
133struct NumberObject;
134struct StringObject;
135struct ArrayObject;
136struct DateObject;
137struct FunctionObject;
138struct ErrorObject;
139struct ArgumentsObject;
140struct Managed;
141struct ExecutionEngine;
142struct QObjectWrapper;
143struct RegExpObject;
144struct RegExp;
145struct EvalFunction;
146
147struct SharedArrayBuffer;
148struct ArrayBuffer;
149struct DataView;
150struct TypedArray;
151
152struct MapObject;
153struct SetMapObject;
154
155struct PromiseObject;
156struct PromiseCapability;
157
158struct CallData;
159struct Scope;
160struct ScopedValue;
161template<typename T> struct Scoped;
168
170class PersistentValue;
171class WeakValue;
172struct MarkStack;
173
174struct IdentifierTable;
175class RegExpCache;
177
186 Attr_Invalid = 0xff
188
191
193{
194 union {
196 struct {
199 };
200 struct {
209 };
210 };
211
212 enum Type {
213 Data = 0,
214 Accessor = 1,
215 Generic = 2
216 };
217
218 PropertyAttributes() : m_all(0) {}
220 if (f != Attr_Invalid) {
221 setType(f & Attr_Accessor ? Accessor : Data);
222 if (!(f & Attr_Accessor))
223 setWritable(!(f & Attr_NotWritable));
224 setEnumerable(!(f & Attr_NotEnumerable));
225 setConfigurable(!(f & Attr_NotConfigurable));
226 }
227 }
229 if (f != Attr_Invalid) {
230 setType(f & Attr_Accessor ? Accessor : Data);
231 if (!(f & Attr_Accessor))
232 setWritable(!(f & Attr_NotWritable));
233 setEnumerable(!(f & Attr_NotEnumerable));
234 setConfigurable(!(f & Attr_NotConfigurable));
235 }
236 }
237
238 void setType(Type t) { m_type = t; type_set = true; }
239 Type type() const { return type_set ? (Type)m_type : Generic; }
240
241 bool isData() const { return type() == PropertyAttributes::Data || writable_set; }
242 bool isAccessor() const { return type() == PropertyAttributes::Accessor; }
243 bool isGeneric() const { return type() == PropertyAttributes::Generic && !writable_set; }
244
245 bool hasType() const { return type_set; }
246 bool hasWritable() const { return writable_set; }
247 bool hasConfigurable() const { return configurable_set; }
248 bool hasEnumerable() const { return enumerable_set; }
249
250 void setWritable(bool b) { m_writable = b; writable_set = true; }
251 void setConfigurable(bool b) { m_configurable = b; configurable_set = true; }
252 void setEnumerable(bool b) { m_enumerable = b; enumerable_set = true; }
253
254 void resolve() { m_mask = 0xf; if (m_type == Accessor) { m_writable = false; writable_set = false; } }
255
256 bool isWritable() const { return m_type != Data || m_writable; }
257 bool isEnumerable() const { return m_enumerable; }
258 bool isConfigurable() const { return m_configurable; }
259
260 void clearType() { m_type = Data; type_set = false; }
261 void clearWritable() { m_writable = false; writable_set = false; }
262 void clearEnumerable() { m_enumerable = false; enumerable_set = false; }
263 void clearConfigurable() { m_configurable = false; configurable_set = false; }
264
265 void clear() { m_all = 0; }
266 bool isEmpty() const { return !m_all; }
267
268 uint all() const { return m_all; }
269
271 return m_all == other.m_all;
272 }
274 return m_all != other.m_all;
275 }
276};
277
278struct Q_QML_EXPORT StackFrame {
281 int line = -1;
282 int column = -1;
283};
285
286namespace JIT {
287
289 Ignore,
291};
292
293} // JIT namespace
294
295} // QV4 namespace
296
298
300
301#endif // QV4GLOBAL_H
Definition main.cpp:8
Definition qlist.h:74
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
CallResultDestination
\qmltype Particle \inqmlmodule QtQuick.Particles
Scoped< FunctionObject > ScopedFunctionObject
QVector< StackFrame > StackTrace
Scoped< Object > ScopedObject
Scoped< ArrayObject > ScopedArrayObject
Scoped< String > ScopedString
Scoped< StringOrSymbol > ScopedStringOrSymbol
PropertyFlag
@ Attr_Invalid
@ Attr_NotConfigurable
@ Attr_Data
@ Attr_NotEnumerable
@ Attr_ReadOnly
@ Attr_NotWritable
@ Attr_ReadOnly_ButConfigurable
@ Attr_Accessor
Scoped< ExecutionContext > ScopedContext
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
PropertyFlags
GLboolean GLboolean GLboolean b
GLfloat GLfloat f
GLenum type
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble t
Definition qopenglext.h:243
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:144
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:163
unsigned char uchar
Definition qtypes.h:27
unsigned int uint
Definition qtypes.h:29
QSharedPointer< T > other(t)
[5]
proxy setType(QNetworkProxy::Socks5Proxy)
PropertyAttributes(PropertyFlags f)
bool isEnumerable() const
bool operator!=(PropertyAttributes other)
void setEnumerable(bool b)
PropertyAttributes(PropertyFlag f)
void setConfigurable(bool b)
bool hasConfigurable() const
bool operator==(PropertyAttributes other)
bool isConfigurable() const
bool hasEnumerable() const
Definition moc.h:24