Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qv4argumentsobject_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
QV4ARGUMENTSOBJECTS_H
5
#
define
QV4ARGUMENTSOBJECTS_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
"qv4object_p.h"
19
20
QT_BEGIN_NAMESPACE
21
22
namespace
QV4
{
23
24
namespace
Heap
{
25
26
#
define
ArgumentsObjectMembers
(
class
,
Member
)
27
Member
(
class
,
Pointer
,
CallContext
*
,
context
)
28
Member
(
class
,
NoMark
,
bool
,
fullyCreated
)
29
Member
(
class
,
NoMark
,
uint
,
argCount
)
30
Member
(
class
,
NoMark
,
quint64
,
mapped
)
31
32
DECLARE_HEAP_OBJECT
(ArgumentsObject, Object) {
33
DECLARE_MARKOBJECTS(ArgumentsObject)
34
enum
{
35
LengthPropertyIndex = 0,
36
SymbolIteratorPropertyIndex = 1,
37
CalleePropertyIndex = 2
38
};
39
void
init(CppStackFrame *frame);
40
};
41
42
#
define
StrictArgumentsObjectMembers
(
class
,
Member
)
43
44
DECLARE_HEAP_OBJECT
(
StrictArgumentsObject
, Object) {
45
enum
{
46
LengthPropertyIndex = 0,
47
SymbolIteratorPropertyIndex = 1,
48
CalleePropertyIndex = 2,
49
CalleeSetterPropertyIndex = 3
50
};
51
void
init(JSTypesStackFrame *frame);
52
};
53
54
}
55
56
struct
ArgumentsObject
:
Object
{
57
V4_OBJECT2(
ArgumentsObject
, Object)
58
Q_MANAGED_TYPE
(
ArgumentsObject
)
59
60
Heap
::CallContext *
context
()
const
{
return
d()->context; }
61
bool
fullyCreated
()
const
{
return
d()->fullyCreated; }
62
63
static
bool
isNonStrictArgumentsObject
(Managed *m) {
64
return
m->vtable() == staticVTable();
65
}
66
67
static
bool
virtualDefineOwnProperty
(Managed *m,
PropertyKey
id,
const
Property
*desc, PropertyAttributes attrs);
68
static
ReturnedValue
virtualGet
(
const
Managed *m,
PropertyKey
id,
const
Value *receiver,
bool
*hasProperty);
69
static
bool
virtualPut
(Managed *m,
PropertyKey
id,
const
Value &value, Value *receiver);
70
static
bool
virtualDeleteProperty
(Managed *m,
PropertyKey
id);
71
static
PropertyAttributes
virtualGetOwnProperty
(
const
Managed *m,
PropertyKey
id,
Property
*p);
72
static
qint64
virtualGetLength
(
const
Managed *m);
73
static
OwnPropertyKeyIterator
*
virtualOwnPropertyKeys
(
const
Object *m, Value *target);
74
75
void
fullyCreate
();
76
77
// There's a slight hack here, as this limits the amount of mapped arguments to 64, but that should be
78
// more than enough for all practical uses of arguments
79
bool
isMapped
(uint arg)
const
{
80
return
arg < 64 && (d()->mapped & (1ull << arg));
81
}
82
83
void
removeMapping
(uint arg) {
84
if
(arg < 64)
85
(d()->mapped &= ~(1ull << arg));
86
}
87
88
};
89
90
struct
StrictArgumentsObject
:
Object
{
91
V4_OBJECT2(
StrictArgumentsObject
, Object)
92
Q_MANAGED_TYPE
(
ArgumentsObject
)
93
};
94
95
}
96
97
QT_END_NAMESPACE
98
99
#
endif
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QV4::Heap
Definition
qv4compileddata_p.h:76
QV4::Heap::DECLARE_HEAP_OBJECT
DECLARE_HEAP_OBJECT(StrictArgumentsObject, Object)
Definition
qv4argumentsobject_p.h:44
QV4::Heap::DECLARE_HEAP_OBJECT
DECLARE_HEAP_OBJECT(ArgumentsObject, Object)
Definition
qv4argumentsobject_p.h:32
QV4
Definition
qjsvalue.h:24
DEFINE_OBJECT_VTABLE
DEFINE_OBJECT_VTABLE(StrictArgumentsObject)
DEFINE_OBJECT_VTABLE
DEFINE_OBJECT_VTABLE(ArgumentsObject)
Q_MANAGED_TYPE
#define Q_MANAGED_TYPE(type)
Definition
qv4managed_p.h:61
QV4::ArgumentsObject
Definition
qv4argumentsobject_p.h:56
QV4::ArgumentsObject::virtualGetLength
static qint64 virtualGetLength(const Managed *m)
Definition
qv4argumentsobject.cpp:193
QV4::ArgumentsObject::virtualDefineOwnProperty
static bool virtualDefineOwnProperty(Managed *m, PropertyKey id, const Property *desc, PropertyAttributes attrs)
Definition
qv4argumentsobject.cpp:83
QV4::ArgumentsObject::context
Heap::CallContext * context() const
Definition
qv4argumentsobject_p.h:60
QV4::ArgumentsObject::fullyCreate
void fullyCreate()
Definition
qv4argumentsobject.cpp:68
QV4::ArgumentsObject::virtualGet
static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
Definition
qv4argumentsobject.cpp:120
QV4::ArgumentsObject::virtualOwnPropertyKeys
static OwnPropertyKeyIterator * virtualOwnPropertyKeys(const Object *m, Value *target)
Definition
qv4argumentsobject.cpp:199
QV4::ArgumentsObject::isNonStrictArgumentsObject
static bool isNonStrictArgumentsObject(Managed *m)
Definition
qv4argumentsobject_p.h:63
QV4::ArgumentsObject::virtualDeleteProperty
static bool virtualDeleteProperty(Managed *m, PropertyKey id)
Definition
qv4argumentsobject.cpp:161
QV4::ArgumentsObject::fullyCreated
bool fullyCreated() const
Definition
qv4argumentsobject_p.h:61
QV4::ArgumentsObject::removeMapping
void removeMapping(uint arg)
Definition
qv4argumentsobject_p.h:83
QV4::ArgumentsObject::virtualGetOwnProperty
static PropertyAttributes virtualGetOwnProperty(const Managed *m, PropertyKey id, Property *p)
Definition
qv4argumentsobject.cpp:171
QV4::ArgumentsObject::isMapped
bool isMapped(uint arg) const
Definition
qv4argumentsobject_p.h:79
QV4::ArgumentsObject::virtualPut
static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver)
Definition
qv4argumentsobject.cpp:142
QV4::PropertyKey
Definition
qv4propertykey_p.h:30
QV4::Property
Definition
qv4property_p.h:27
QV4::StrictArgumentsObject
Definition
qv4argumentsobject_p.h:90
qtdeclarative
src
qml
jsruntime
qv4argumentsobject_p.h
Generated on
for Qt by
1.18.0