From 267513e6d955cb93abb879c495dd079c254d3493 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 1 Jun 2018 12:21:08 +0200 Subject: Rework unwind handling The old code was rather convoluted and expanded to quite a bit of bytecode. It was also very hard to fix some of the remaining issues with unwinding in there. The new code handles unwinding a bit differently. Basically, we now have three instructions to do what the spec requires. SetUnwindHandler is the same as the old SetExceptionHandler instruction. It basically tells the runtime where to jump to to handle any abrupt completion (ie. throw/break/continue/return) that requires unwinding. UnwindToLabel is a new instruction that is used for unwinding break/continue/return statements. It takes two arguments, one telling the runtime how many levels to unwind and the second a target label to jump to when unwinding is done. UnwindDispatch is the third instruction and is invoked at the end of each unwind block to dispatch the the parent unwind handler if required and thus implement the support for the levelled unwinding. Change-Id: I079a39d0d897b3ecc2f0dc631ca29b25eae05250 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine_p.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4engine_p.h') diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index ecc110a16f..b007e65c4b 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -97,7 +97,9 @@ struct Q_QML_EXPORT CppStackFrame { int originalArgumentsCount; int instructionPointer; const char *yield; - const char *exceptionHandler; + const char *unwindHandler; + const char *unwindLabel; + int unwindLevel; QString source() const; QString function() const; -- cgit v1.2.3