aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-06-27 14:18:17 +0200
committerLars Knoll <lars.knoll@qt.io>2018-07-03 08:08:49 +0000
commit2666fe4a1440cc798b9db68fcc807450d46069c2 (patch)
treeac777b1d376d7743edbe15a3f671513d800df128 /src/qml/jsruntime/qv4engine.cpp
parent0b6bc89c61d6fc10bd09dfb7374314d993f0c3c5 (diff)
Move the C++ and JS stack frame definitions into it's own file
Change-Id: I86e89e07197aec6071809c2d32bd5c98cb7ac6f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp32
1 files changed, 1 insertions, 31 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 64d6583f60..a482d83a97 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -74,6 +74,7 @@
#include "qv4generatorobject_p.h"
#include "qv4reflect_p.h"
#include "qv4proxy_p.h"
+#include "qv4stackframe_p.h"
#if QT_CONFIG(qml_sequence_object)
#include "qv4sequenceobject_p.h"
@@ -900,37 +901,6 @@ QQmlContextData *ExecutionEngine::callingQmlContext() const
return ctx->qml()->context->contextData();
}
-QString CppStackFrame::source() const
-{
- return v4Function ? v4Function->sourceFile() : QString();
-}
-
-QString CppStackFrame::function() const
-{
- return v4Function ? v4Function->name()->toQString() : QString();
-}
-
-int CppStackFrame::lineNumber() const
-{
- if (!v4Function)
- return -1;
-
- auto findLine = [](const CompiledData::CodeOffsetToLine &entry, uint offset) {
- return entry.codeOffset < offset;
- };
-
- const QV4::CompiledData::Function *cf = v4Function->compiledFunction;
- uint offset = instructionPointer;
- const CompiledData::CodeOffsetToLine *lineNumbers = cf->lineNumberTable();
- uint nLineNumbers = cf->nLineNumbers;
- const CompiledData::CodeOffsetToLine *line = std::lower_bound(lineNumbers, lineNumbers + nLineNumbers, offset, findLine) - 1;
- return line->line;
-}
-
-ReturnedValue CppStackFrame::thisObject() const {
- return jsFrame->thisObject.asReturnedValue();
-}
-
StackTrace ExecutionEngine::stackTrace(int frameLimit) const
{
Scope scope(const_cast<ExecutionEngine *>(this));