- commented out the exception handling opcodes in the VM.

They are currently not used and not planned to be used - and they are rather costly by increasing stack size per call quite significantly.
This commit is contained in:
Christoph Oelckers 2017-04-10 20:41:55 +02:00
parent 9ae97502be
commit 040c70714c

View file

@ -11,8 +11,8 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret)
#include "vmops.h" #include "vmops.h"
}; };
#endif #endif
const VMOP *exception_frames[MAX_TRY_DEPTH]; //const VMOP *exception_frames[MAX_TRY_DEPTH];
int try_depth = 0; //int try_depth = 0;
VMFrame *f = stack->TopFrame(); VMFrame *f = stack->TopFrame();
VMScriptFunction *sfunc; VMScriptFunction *sfunc;
const VMRegisters reg(f); const VMRegisters reg(f);
@ -43,7 +43,7 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret)
const double *fbp, *fcp; const double *fbp, *fcp;
int a, b, c; int a, b, c;
begin: //begin:
try try
{ {
#if !COMPGOTO #if !COMPGOTO
@ -807,6 +807,7 @@ begin:
NEXTOP; NEXTOP;
} }
#if 0
OP(TRY): OP(TRY):
assert(try_depth < MAX_TRY_DEPTH); assert(try_depth < MAX_TRY_DEPTH);
if (try_depth >= MAX_TRY_DEPTH) if (try_depth >= MAX_TRY_DEPTH)
@ -842,6 +843,7 @@ begin:
// not be executed by the normal VM code. // not be executed by the normal VM code.
assert(0); assert(0);
NEXTOP; NEXTOP;
#endif
OP(BOUND): OP(BOUND):
if (reg.d[a] >= BC) if (reg.d[a] >= BC)
@ -1660,6 +1662,7 @@ begin:
NEXTOP; NEXTOP;
} }
} }
#if 0
catch(VMException *exception) catch(VMException *exception)
{ {
// Try to find a handler for the exception. // Try to find a handler for the exception.
@ -1714,6 +1717,7 @@ begin:
// Nothing caught it. Rethrow and let somebody else deal with it. // Nothing caught it. Rethrow and let somebody else deal with it.
throw; throw;
} }
#endif
catch (CVMAbortException &err) catch (CVMAbortException &err)
{ {
err.MaybePrintMessage(); err.MaybePrintMessage();