aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4unwindhelper_arm_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-06 13:48:33 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-11 13:02:00 +0200
commite6180ecdc2144786c58d2f9d615f698ca3442382 (patch)
treea6b9f468b4ba5aeb4a99662d7a87a7353071ce52 /src/qml/jsruntime/qv4unwindhelper_arm_p.h
parentf9fda643ab7aa1a66e4816382f0e66499818f42a (diff)
Properly unwind the js stack for generated code
Surround all calls into generated code with a try {} catch {} statement that resets the jstack to the correct position. Like this we properly unwind the js stack in all cases, and can also use stricter assertions in our ScopedCallData, etc. classes to check that the stack is healthy. Change-Id: I7ca03e06ea55007be683305d9c2a6898cf5fc689 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4unwindhelper_arm_p.h')
-rw-r--r--src/qml/jsruntime/qv4unwindhelper_arm_p.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4unwindhelper_arm_p.h b/src/qml/jsruntime/qv4unwindhelper_arm_p.h
index 6cfdce0e7d..e768544e11 100644
--- a/src/qml/jsruntime/qv4unwindhelper_arm_p.h
+++ b/src/qml/jsruntime/qv4unwindhelper_arm_p.h
@@ -79,7 +79,7 @@ static Function *lookupFunction(void *pc)
if (it == allFunctions.end())
return 0;
- quintptr codeStart = reinterpret_cast<quintptr>(removeThumbBit((void*)(*it)->code));
+ quintptr codeStart = reinterpret_cast<quintptr>(removeThumbBit((void*)(*it)->codePtr));
if (key < codeStart || key >= codeStart + (*it)->codeSize)
return 0;
return *it;
@@ -137,27 +137,27 @@ static unsigned write_prel31(unsigned *addr, void *ptr)
void UnwindHelper::deregisterFunction(Function *function)
{
QMutexLocker locker(&functionProtector);
- allFunctions.remove(reinterpret_cast<quintptr>(function->code));
+ allFunctions.remove(reinterpret_cast<quintptr>(function->codePtr));
}
void UnwindHelper::deregisterFunctions(const QVector<Function *> &functions)
{
QMutexLocker locker(&functionProtector);
foreach (Function *f, functions)
- allFunctions.remove(reinterpret_cast<quintptr>(f->code));
+ allFunctions.remove(reinterpret_cast<quintptr>(f->codePtr));
}
void UnwindHelper::registerFunction(Function *function)
{
QMutexLocker locker(&functionProtector);
- allFunctions.insert(reinterpret_cast<quintptr>(function->code), function);
+ allFunctions.insert(reinterpret_cast<quintptr>(function->codePtr), function);
}
void UnwindHelper::registerFunctions(const QVector<Function *> &functions)
{
QMutexLocker locker(&functionProtector);
foreach (Function *f, functions)
- allFunctions.insert(reinterpret_cast<quintptr>(f->code), f);
+ allFunctions.insert(reinterpret_cast<quintptr>(f->codePtr), f);
}
void UnwindHelper::prepareForUnwind(ExecutionContext *)
@@ -217,7 +217,7 @@ extern "C" Q_DECL_EXPORT void *__gnu_Unwind_Find_exidx(void *pc, int *entryCount
QV4::Function *function = QT_PREPEND_NAMESPACE(QV4::lookupFunction(pc));
if (function) {
*entryCount = 1;
- void * codeStart = QT_PREPEND_NAMESPACE(QV4::removeThumbBit((void*)function->code));
+ void * codeStart = QT_PREPEND_NAMESPACE(QV4::removeThumbBit((void*)function->codePtr));
// At the end of the function we store our synthetic exception table entry.
return (char *)codeStart + function->codeSize;
}