From 4f8df70107d17922303bb21db5a2cf92aa1aff99 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 23 Oct 2013 14:03:09 +0200 Subject: Implement new exception handling for moth Add the required instructions and check for exceptions in the engine before storing any results. Change-Id: Ibfaf904d659859e8012920270825211ba202c63d Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4instr_moth_p.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/qml/compiler/qv4instr_moth_p.h') diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index b9163b38d3..f9a46a06d7 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -68,7 +68,10 @@ QT_BEGIN_NAMESPACE F(CallProperty, callProperty) \ F(CallElement, callElement) \ F(CallActivationProperty, callActivationProperty) \ + F(SetExceptionHandler, setExceptionHandler) \ F(CallBuiltinThrow, callBuiltinThrow) \ + F(CallBuiltinUnwindException, callBuiltinUnwindException) \ + F(CallBuiltinPushCatchScope, callBuiltinPushCatchScope) \ F(CallBuiltinPushScope, callBuiltinPushScope) \ F(CallBuiltinPopScope, callBuiltinPopScope) \ F(CallBuiltinForeachIteratorObject, callBuiltinForeachIteratorObject) \ @@ -302,10 +305,22 @@ union Instr quint32 callData; Param result; }; + struct instr_setExceptionHandler { + MOTH_INSTR_HEADER + qptrdiff offset; + }; struct instr_callBuiltinThrow { MOTH_INSTR_HEADER Param arg; }; + struct instr_callBuiltinUnwindException { + MOTH_INSTR_HEADER + Param result; + }; + struct instr_callBuiltinPushCatchScope { + MOTH_INSTR_HEADER + int name; + }; struct instr_callBuiltinPushScope { MOTH_INSTR_HEADER Param arg; @@ -491,6 +506,9 @@ union Instr instr_callElement callElement; instr_callActivationProperty callActivationProperty; instr_callBuiltinThrow callBuiltinThrow; + instr_setExceptionHandler setExceptionHandler; + instr_callBuiltinUnwindException callBuiltinUnwindException; + instr_callBuiltinPushCatchScope callBuiltinPushCatchScope; instr_callBuiltinPushScope callBuiltinPushScope; instr_callBuiltinPopScope callBuiltinPopScope; instr_callBuiltinForeachIteratorObject callBuiltinForeachIteratorObject; -- cgit v1.2.3