From 2cf8be29bc31f557af47c143048b5bb70d6000cc Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 4 Mar 2013 12:12:21 +0100 Subject: Cleanup: Get rid of manual unwind stack Instead of doing the ExecutionContext unwinding at the time of throw, do it at the time of catch, conveniently through an accept() method of the Exception object. That allows us to get rid of the separate handler registration stack. The only tricky part are that some execution contexts are allocated on the stack. When exceptions are thrown through that, we have to catch, unwinding up until that point (or rather the parent of the stack allocated context that's going to be deleted) and then simply rethrow. This patch also gets rid of the __builtin_delete_exception_handler. The next patch will rename the remainder to what it really does now. Change-Id: I00bb113b3a2fe24f7054c03fdfb8fed5cc1258b1 Reviewed-by: Lars Knoll --- tools/v4/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp index d73fa480da..89a25973e8 100644 --- a/tools/v4/main.cpp +++ b/tools/v4/main.cpp @@ -388,7 +388,8 @@ int main(int argc, char *argv[]) if (! qgetenv("SHOW_EXIT_VALUE").isEmpty()) std::cout << "exit value: " << qPrintable(result.toString(ctx)->toQString()) << std::endl; } - } catch (const QQmlJS::VM::Exception&) { + } catch (QQmlJS::VM::Exception& ex) { + ex.accept(ctx); showException(ctx); return EXIT_FAILURE; } -- cgit v1.2.3