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
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// Qt-Security score:significant
4
5#ifndef QV4CALLDATA_P_H
6#define QV4CALLDATA_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qv4staticvalue_p.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace QV4 {
24
26{
38
45
46 int argc() const {
47 Q_ASSERT(_argc.isInteger());
48 return _argc.int_32();
49 }
50
51 void setArgc(int argc) {
52 Q_ASSERT(argc >= 0);
53 _argc.setInt_32(argc);
54 }
55
56 inline ReturnedValue argument(int i) const {
57 return i < argc() ? args[i].asReturnedValue()
58 : StaticValue::undefinedValue().asReturnedValue();
59 }
60
62
63 static constexpr int HeaderSize()
64 {
65 return offsetof(CallData, args) / sizeof(QV4::StaticValue);
66 }
67
68 template<typename Value>
69 Value *argValues();
70
71 template<typename Value>
72 const Value *argValues() const;
73};
74
83
84} // namespace QV4
85
86QT_END_NAMESPACE
87
88#endif // QV4CALLDATA_P_H
Definition qjsvalue.h:24
Q_STATIC_ASSERT(sizeof(CppStackFrame)==sizeof(JSTypesStackFrame))
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()