aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
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.cpp
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.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index d10d1d0413..8de733c26a 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -534,12 +534,6 @@ InternalClass *ExecutionEngine::newClass(const InternalClass &other)
return new (classPool) InternalClass(other);
}
-Heap::ExecutionContext *ExecutionEngine::pushGlobalContext()
-{
- setCurrentContext(rootContext()->d());
- return currentContext()->d();
-}
-
InternalClass *ExecutionEngine::newInternalClass(const VTable *vtable, Object *prototype)
{
return internalClasses[EngineBase::Class_Empty]->changeVTable(vtable)->changePrototype(prototype ? prototype->d() : 0);
@@ -797,23 +791,27 @@ QQmlContextData *ExecutionEngine::callingQmlContext() const
return ctx->qml()->context->contextData();
}
-QString EngineBase::StackFrame::source() const
+QString CppStackFrame::source() const
{
return v4Function->sourceFile();
}
-QString EngineBase::StackFrame::function() const
+QString CppStackFrame::function() const
{
return v4Function->name()->toQString();
}
+ReturnedValue CppStackFrame::thisObject() const {
+ return jsFrame->stack[-(int)v4Function->nFormals - 1].asReturnedValue();
+}
+
StackTrace ExecutionEngine::stackTrace(int frameLimit) const
{
Scope scope(const_cast<ExecutionEngine *>(this));
ScopedString name(scope);
StackTrace stack;
- StackFrame *f = currentStackFrame;
+ CppStackFrame *f = currentStackFrame;
while (f && frameLimit) {
QV4::StackFrame frame;
frame.source = f->source();
@@ -868,7 +866,7 @@ QUrl ExecutionEngine::resolvedUrl(const QString &file)
return src;
QUrl base;
- StackFrame *f = currentStackFrame;
+ CppStackFrame *f = currentStackFrame;
while (f) {
if (f->v4Function) {
base.setUrl(f->v4Function->sourceFile());