aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-09 17:14:11 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-10 08:20:15 +0000
commit4acb72bf35e736f222c90e49b3e84e20355d33a7 (patch)
tree47980e17c8d9b0d7349fe0291872c1e4d7663ecc /src/qml/jsruntime/qv4engine_p.h
parentb459c43c5d119507f888ac9ab1ca96f8e7bb6e34 (diff)
Cleanup naming of Stack frame structures
Change-Id: I0b392040b6726e6d93f237ccccc9f053256ed819 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r--src/qml/jsruntime/qv4engine_p.h54
1 files changed, 40 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 3fc79fd67d..3c3e6e048f 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -87,6 +87,46 @@ struct CompilationUnit;
struct InternalClass;
struct InternalClassPool;
+struct JSStackFrame {
+ enum Offsets {
+ JSFunction = 0,
+ Context = 1,
+ Accumulator = 2
+ };
+ // callData is directly before this
+ union {
+ Value jsFunction;
+ Value stack[1];
+ };
+ Value context;
+ Value accumulator; // ###
+ // registers follow
+};
+
+struct Q_QML_EXPORT CppStackFrame {
+ CppStackFrame *parent;
+ Function *v4Function;
+ JSStackFrame *jsFrame;
+ int line = -1;
+ int column = -1;
+
+ QString source() const;
+ QString function() const;
+ inline QV4::ExecutionContext *context() const {
+ return static_cast<ExecutionContext *>(&jsFrame->context);
+ }
+
+ inline QV4::Heap::CallContext *callContext() const {
+ Heap::ExecutionContext *ctx = static_cast<ExecutionContext &>(jsFrame->context).d();\
+ while (ctx->type != Heap::ExecutionContext::Type_CallContext)
+ ctx = ctx->outer;
+ return static_cast<Heap::CallContext *>(ctx);
+ }
+ ReturnedValue thisObject() const;
+};
+
+
+
struct Q_QML_EXPORT ExecutionEngine : public EngineBase
{
private:
@@ -354,7 +394,6 @@ public:
void setProfiler(Profiling::Profiler *profiler);
#endif // QT_NO_QML_DEBUGGER
- Heap::ExecutionContext *pushGlobalContext();
void setCurrentContext(Heap::ExecutionContext *context);
ExecutionContext *currentContext() const {
return static_cast<ExecutionContext *>(&currentStackFrame->jsFrame->context);
@@ -524,19 +563,6 @@ inline bool ExecutionEngine::checkStackLimits()
return false;
}
-inline QV4::ExecutionContext *EngineBase::StackFrame::context() const
-{
- return static_cast<ExecutionContext *>(&jsFrame->context);
-}
-
-inline QV4::Heap::CallContext *EngineBase::StackFrame::callContext() const
-{
- Heap::ExecutionContext *ctx = static_cast<ExecutionContext &>(jsFrame->context).d();\
- while (ctx->type != Heap::ExecutionContext::Type_CallContext)
- ctx = ctx->outer;
- return static_cast<Heap::CallContext *>(ctx);
-}
-
} // namespace QV4
QT_END_NAMESPACE