Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 JavaScriptFunctionObject;
84 struct ErrorObject;
85 struct ArgumentsObject;
86 struct QObjectWrapper;
87 struct RegExpObject;
88 struct UrlObject;
89 struct UrlSearchParamsObject;
90 struct RegExp;
91 struct EvalFunction;
92
93 struct SharedArrayBuffer;
94 struct ArrayBuffer;
95 struct DataView;
96 struct TypedArray;
97
98 struct MapObject;
99 struct SetObject;
100
101 struct PromiseObject;
102 struct PromiseCapability;
103
104 template <typename T, size_t> struct Pointer;
105}
106
107struct CppStackFrame;
108struct JSTypesStackFrame;
109struct MetaTypesStackFrame;
110class MemoryManager;
111class ExecutableAllocator;
112struct PropertyKey;
113struct StringOrSymbol;
114struct String;
115struct Symbol;
116struct Object;
117struct ObjectPrototype;
118struct ObjectIterator;
119struct ExecutionContext;
120struct CallContext;
121struct QmlContext;
122struct ScriptFunction;
123struct InternalClass;
124struct Property;
125struct Value;
126template<size_t> struct HeapValue;
127template<size_t> struct ValueArray;
128struct Lookup;
129struct ArrayData;
130struct VTable;
131struct Function;
132
133struct BooleanObject;
134struct NumberObject;
135struct StringObject;
136struct ArrayObject;
137struct DateObject;
138struct FunctionObject;
139struct ErrorObject;
140struct ArgumentsObject;
141struct Managed;
142struct ExecutionEngine;
143struct QObjectWrapper;
144struct RegExpObject;
145struct RegExp;
146struct EvalFunction;
147
148struct SharedArrayBuffer;
149struct ArrayBuffer;
150struct DataView;
151struct TypedArray;
152
153struct MapObject;
154struct SetMapObject;
155
156struct PromiseObject;
157struct PromiseCapability;
158
159struct CallData;
160struct Scope;
161struct ScopedValue;
162template<typename T> struct Scoped;
163typedef Scoped<String> ScopedString;
164typedef Scoped<StringOrSymbol> ScopedStringOrSymbol;
165typedef Scoped<Object> ScopedObject;
166typedef Scoped<ArrayObject> ScopedArrayObject;
167typedef Scoped<FunctionObject> ScopedFunctionObject;
168typedef Scoped<ExecutionContext> ScopedContext;
169
171class PersistentValue;
172class WeakValue;
173struct MarkStack;
174
175struct IdentifierTable;
176class RegExpCache;
178
189
192
194{
196 QT_WARNING_DISABLE_MSVC(4201) // nonstandard extension used: nameless struct/union
197 union {
199 struct {
202 };
203 struct {
212 };
213 };
215
216 enum Type {
217 Data = 0,
218 Accessor = 1,
219 Generic = 2
220 };
221
222 PropertyAttributes() : m_all(0) {}
224 if (f != Attr_Invalid) {
225 setType(f & Attr_Accessor ? Accessor : Data);
226 if (!(f & Attr_Accessor))
227 setWritable(!(f & Attr_NotWritable));
228 setEnumerable(!(f & Attr_NotEnumerable));
229 setConfigurable(!(f & Attr_NotConfigurable));
230 }
231 }
233 if (f != Attr_Invalid) {
234 setType(f & Attr_Accessor ? Accessor : Data);
235 if (!(f & Attr_Accessor))
236 setWritable(!(f & Attr_NotWritable));
237 setEnumerable(!(f & Attr_NotEnumerable));
238 setConfigurable(!(f & Attr_NotConfigurable));
239 }
240 }
241
242 void setType(Type t) { m_type = t; type_set = true; }
243 Type type() const { return type_set ? (Type)m_type : Generic; }
244
245 bool isData() const { return type() == PropertyAttributes::Data || writable_set; }
246 bool isAccessor() const { return type() == PropertyAttributes::Accessor; }
247 bool isGeneric() const { return type() == PropertyAttributes::Generic && !writable_set; }
248
249 bool hasType() const { return type_set; }
250 bool hasWritable() const { return writable_set; }
251 bool hasConfigurable() const { return configurable_set; }
252 bool hasEnumerable() const { return enumerable_set; }
253
254 void setWritable(bool b) { m_writable = b; writable_set = true; }
255 void setConfigurable(bool b) { m_configurable = b; configurable_set = true; }
256 void setEnumerable(bool b) { m_enumerable = b; enumerable_set = true; }
257
258 void resolve() { m_mask = 0xf; if (m_type == Accessor) { m_writable = false; writable_set = false; } }
259
260 bool isWritable() const { return m_type != Data || m_writable; }
261 bool isEnumerable() const { return m_enumerable; }
262 bool isConfigurable() const { return m_configurable; }
263
264 void clearType() { m_type = Data; type_set = false; }
265 void clearWritable() { m_writable = false; writable_set = false; }
266 void clearEnumerable() { m_enumerable = false; enumerable_set = false; }
267 void clearConfigurable() { m_configurable = false; configurable_set = false; }
268
269 void clear() { m_all = 0; }
270 bool isEmpty() const { return !m_all; }
271
272 uint all() const { return m_all; }
273
275 return m_all == other.m_all;
276 }
278 return m_all != other.m_all;
279 }
280};
281
282struct Q_QML_EXPORT StackFrame {
285 int line = -1;
286 int column = -1;
287};
288typedef QVector<StackFrame> StackTrace;
289
290namespace JIT {
291
293 Ignore,
295};
296
297} // JIT namespace
298
299} // QV4 namespace
300
302
304
305#endif // QV4GLOBAL_H
Definition main.cpp:8
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
CallResultDestination
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 QT_WARNING_POP
#define QT_WARNING_DISABLE_MSVC(number)
#define QT_WARNING_PUSH
#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:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
unsigned char uchar
Definition qtypes.h:32
unsigned int uint
Definition qtypes.h:34
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:23