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
qv4identifiertable_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
#
ifndef
QV4IDENTIFIERTABLE_H
5
#
define
QV4IDENTIFIERTABLE_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
"qv4identifierhash_p.h"
19
#
include
"qv4string_p.h"
20
#
include
"qv4engine_p.h"
21
#
include
<
qset
.
h
>
22
#
include
<
limits
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
namespace
QV4
{
27
28
struct
Q_QML_EXPORT
IdentifierTable
29
{
30
ExecutionEngine
*
engine
;
31
32
uint
alloc
;
33
uint
size
;
34
int
numBits
;
35
Heap
::
StringOrSymbol
**
entriesByHash
;
36
Heap
::
StringOrSymbol
**
entriesById
;
37
38
QSet
<
IdentifierHashData
*>
idHashes
;
39
40
void
addEntry
(
Heap
::
StringOrSymbol
*
str
);
41
42
public
:
43
44
IdentifierTable
(
ExecutionEngine
*
engine
,
int
numBits
= 8);
45
~
IdentifierTable
();
46
47
Heap
::
String
*
insertString
(
const
QString
&
s
);
48
Heap
::
Symbol
*
insertSymbol
(
const
QString
&
s
);
49
50
PropertyKey
asPropertyKey
(
const
Heap
::
String
*
str
) {
51
if
(
str
->
identifier
.
isValid
())
52
return
str
->
identifier
;
53
return
asPropertyKeyImpl
(
str
);
54
}
55
PropertyKey
asPropertyKey
(
const
QV4
::
String
*
str
) {
56
return
asPropertyKey
(
str
->
d
());
57
}
58
59
enum
KeyConversionBehavior
{
Default
,
ForceConversionToId
};
60
PropertyKey
asPropertyKey
(
const
QString
&
s
,
KeyConversionBehavior
conversionBehavior
=
Default
);
61
62
PropertyKey
asPropertyKeyImpl
(
const
Heap
::
String
*
str
);
63
64
Heap
::
StringOrSymbol
*
resolveId
(
PropertyKey
i
)
const
;
65
Heap
::
String
*
stringForId
(
PropertyKey
i
)
const
;
66
Heap
::
Symbol
*
symbolForId
(
PropertyKey
i
)
const
;
67
68
void
markObjects
(
MarkStack
*
markStack
);
69
void
sweep
();
70
71
void
addIdentifierHash
(
IdentifierHashData
*
h
) {
72
idHashes
.
insert
(
h
);
73
}
74
void
removeIdentifierHash
(
IdentifierHashData
*
h
) {
75
idHashes
.
remove
(
h
);
76
}
77
78
private
:
79
Heap
::
String
*
resolveStringEntry
(
const
QString
&
s
,
uint
hash
,
uint
subtype
);
80
};
81
82
}
83
84
QT_END_NAMESPACE
85
86
#
endif
QPlatformGraphicsBufferHelper
\inmodule QtGui
QV4
Definition
qjsvalue.h:23
QV4::IdentifierTable
Definition
qv4identifiertable_p.h:29
qtdeclarative
src
qml
jsruntime
qv4identifiertable_p.h
Generated on
for Qt by
1.14.0