[Oorexx-devel] ExpressionOperator.cpp : is it possible to catch an exception during the evaluation of operator ?
ExpressionOperator.cpp Is it possible to catch an exception during the evaluation of operator, and try something else with the same arguments ? According to my tests, surrounding by catch/try is not enough. The evaluation stack is probably in a bad state in the catch{}, I don't know how to bring it back to a good state. I tried to do like the catch in RexxActivation::run, but without success (unwindToFrame and stack.clear). The something else is an alternate way to find a candidate implementation, where the dispatching is not limited to the first argument. Thanks. Jean-Louis RexxObject *RexxBinaryOperator::evaluate( RexxActivation *context, /* current activation context */ RexxExpressionStack *stack ) /* evaluation stack */ /**/ /* Function: Execute a REXX binary operator */ /**/ { /* evaluate the target */ RexxObject *left = this-left_term-evaluate(context, stack); /* evaluate the right term */ RexxObject *right = this-right_term-evaluate(context, stack); *try { */* evaluate the message */ RexxObject *result = callOperatorMethod(left, this-oper, right); /* replace top two stack elements*/ stack-operatorResult(result); /* with this one */ /* trace if necessary*/ context-traceOperator(operatorName(), result); return result; /* return the result */ *} catch (RexxActivation *t) { // try something else with the same arguments left and right } *} -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] ExpressionOperator.cpp : is it possible to catch an exception during the evaluation of operator ?
This is seriously not going to work. The code that handles the raising of the exception changes an awful lot of the internal state of the interpreter. Rick On Fri, Oct 4, 2013 at 7:59 AM, Jean-Louis Faucher jfaucher...@gmail.comwrote: ExpressionOperator.cpp Is it possible to catch an exception during the evaluation of operator, and try something else with the same arguments ? According to my tests, surrounding by catch/try is not enough. The evaluation stack is probably in a bad state in the catch{}, I don't know how to bring it back to a good state. I tried to do like the catch in RexxActivation::run, but without success (unwindToFrame and stack.clear). The something else is an alternate way to find a candidate implementation, where the dispatching is not limited to the first argument. Thanks. Jean-Louis RexxObject *RexxBinaryOperator::evaluate( RexxActivation *context, /* current activation context*/ RexxExpressionStack *stack ) /* evaluation stack */ /**/ /* Function: Execute a REXX binary operator */ /**/ { /* evaluate the target */ RexxObject *left = this-left_term-evaluate(context, stack); /* evaluate the right term */ RexxObject *right = this-right_term-evaluate(context, stack); *try { */* evaluate the message */ RexxObject *result = callOperatorMethod(left, this-oper, right); /* replace top two stack elements*/ stack-operatorResult(result); /* with this one */ /* trace if necessary*/ context-traceOperator(operatorName(), result); return result; /* return the result */ *} catch (RexxActivation *t) { // try something else with the same arguments left and right } *} -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] ExpressionOperator.cpp : is it possible to catch an exception during the evaluation of operator ?
ok, thanks. 2013/10/4 Rick McGuire object.r...@gmail.com This is seriously not going to work. The code that handles the raising of the exception changes an awful lot of the internal state of the interpreter. Rick On Fri, Oct 4, 2013 at 7:59 AM, Jean-Louis Faucher jfaucher...@gmail.comwrote: ExpressionOperator.cpp Is it possible to catch an exception during the evaluation of operator, and try something else with the same arguments ? According to my tests, surrounding by catch/try is not enough. The evaluation stack is probably in a bad state in the catch{}, I don't know how to bring it back to a good state. I tried to do like the catch in RexxActivation::run, but without success (unwindToFrame and stack.clear). The something else is an alternate way to find a candidate implementation, where the dispatching is not limited to the first argument. Thanks. Jean-Louis RexxObject *RexxBinaryOperator::evaluate( RexxActivation *context, /* current activation context*/ RexxExpressionStack *stack ) /* evaluation stack */ /**/ /* Function: Execute a REXX binary operator */ /**/ { /* evaluate the target */ RexxObject *left = this-left_term-evaluate(context, stack); /* evaluate the right term */ RexxObject *right = this-right_term-evaluate(context, stack); *try { */* evaluate the message */ RexxObject *result = callOperatorMethod(left, this-oper, right); /* replace top two stack elements*/ stack-operatorResult(result); /* with this one */ /* trace if necessary*/ context-traceOperator(operatorName(), result); return result; /* return the result */ *} catch (RexxActivation *t) { // try something else with the same arguments left and right } *} -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel