aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stackframe_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2018-07-13 12:18:52 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2018-07-13 11:29:11 +0000
commit36d1d046470dec970fd7a19be2f77dc83526ffb3 (patch)
tree9513308957fc8b15e3377cc1b6d55f69d56d92a9 /src/qml/jsruntime/qv4stackframe_p.h
parent9757d5f9c90988f81bca8ce395555765896711d0 (diff)
Add LastOffset/OffsetCount constants to CallData::Offsets
For use by code that needs to iterate over the stack slots occupied by the CallData (like a JIT). Also add more checks to verify that the offsets correspond with the actual member field layout in memory. Change-Id: Iedae11a9d7602286b10910b22c9bf0eedc23b411 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4stackframe_p.h')
-rw-r--r--src/qml/jsruntime/qv4stackframe_p.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4stackframe_p.h b/src/qml/jsruntime/qv4stackframe_p.h
index 4966a5637d..aa507d61a6 100644
--- a/src/qml/jsruntime/qv4stackframe_p.h
+++ b/src/qml/jsruntime/qv4stackframe_p.h
@@ -57,7 +57,10 @@ struct CallData
Accumulator = 2,
This = 3,
NewTarget = 4,
- Argc = 5
+ Argc = 5,
+
+ LastOffset = Argc,
+ OffsetCount = LastOffset + 1
};
Value function;
@@ -87,8 +90,13 @@ struct CallData
};
Q_STATIC_ASSERT(std::is_standard_layout<CallData>::value);
-Q_STATIC_ASSERT(offsetof(CallData, thisObject) == CallData::This*sizeof(Value));
-Q_STATIC_ASSERT(offsetof(CallData, args) == 6*sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, function ) == CallData::Function * sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, context ) == CallData::Context * sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, accumulator) == CallData::Accumulator * sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, thisObject ) == CallData::This * sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, newTarget ) == CallData::NewTarget * sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, _argc ) == CallData::Argc * sizeof(Value));
+Q_STATIC_ASSERT(offsetof(CallData, args ) == 6 * sizeof(Value));
struct Q_QML_EXPORT CppStackFrame {
EngineBase *engine;