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
qv4calldata_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QV4CALLDATA_P_H
5#define QV4CALLDATA_P_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 <private/qv4staticvalue_p.h>
19
21
22namespace QV4 {
23
25{
26 enum Offsets {
28 Context = 1,
30 This = 3,
32 Argc = 5,
33
36 };
37
44
45 int argc() const {
47 return _argc.int_32();
48 }
49
50 void setArgc(int argc) {
51 Q_ASSERT(argc >= 0);
53 }
54
55 inline ReturnedValue argument(int i) const {
56 return i < argc() ? args[i].asReturnedValue()
57 : StaticValue::undefinedValue().asReturnedValue();
58 }
59
61
62 static constexpr int HeaderSize()
63 {
64 return offsetof(CallData, args) / sizeof(QV4::StaticValue);
65 }
66
67 template<typename Value>
69
70 template<typename Value>
71 const Value *argValues() const;
72};
73
74Q_STATIC_ASSERT(std::is_standard_layout<CallData>::value);
75Q_STATIC_ASSERT(offsetof(CallData, function ) == CallData::Function * sizeof(StaticValue));
77Q_STATIC_ASSERT(offsetof(CallData, accumulator) == CallData::Accumulator * sizeof(StaticValue));
78Q_STATIC_ASSERT(offsetof(CallData, thisObject ) == CallData::This * sizeof(StaticValue));
79Q_STATIC_ASSERT(offsetof(CallData, newTarget ) == CallData::NewTarget * sizeof(StaticValue));
80Q_STATIC_ASSERT(offsetof(CallData, _argc ) == CallData::Argc * sizeof(StaticValue));
81Q_STATIC_ASSERT(offsetof(CallData, args ) == 6 * sizeof(StaticValue));
82
83} // namespace QV4
84
86
87#endif // QV4CALLDATA_P_H
Combined button and popup list for selecting options.
quint64 ReturnedValue
static void * context
#define Q_STATIC_ASSERT(Condition)
Definition qassert.h:108
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QJSValueList args
StaticValue newTarget
StaticValue args[1]
StaticValue accumulator
void setArgc(int argc)
StaticValue context
const Value * argValues() const
int argc() const
StaticValue function
ReturnedValue argument(int i) const
StaticValue thisObject
StaticValue _argc
static constexpr int HeaderSize()
Value * argValues()
bool isInteger() const
constexpr ReturnedValue asReturnedValue() const
QV4_NEARLY_ALWAYS_INLINE constexpr void setInt_32(int i)
static constexpr StaticValue undefinedValue()
QV4_NEARLY_ALWAYS_INLINE constexpr int int_32() const