--- parser3/src/main/execute.C 2016/10/04 13:23:46 1.388 +++ parser3/src/main/execute.C 2016/10/11 19:58:39 1.391 @@ -21,7 +21,7 @@ #include "pa_vimage.h" #include "pa_wwrapper.h" -volatile const char * IDENT_EXECUTE_C="$Id: execute.C,v 1.388 2016/10/04 13:23:46 moko Exp $" IDENT_PA_OPCODE_H IDENT_PA_OPERATION_H IDENT_PA_VCODE_FRAME_H IDENT_PA_WWRAPPER_H; +volatile const char * IDENT_EXECUTE_C="$Id: execute.C,v 1.391 2016/10/11 19:58:39 moko Exp $" IDENT_PA_OPCODE_H IDENT_PA_OPERATION_H IDENT_PA_VCODE_FRAME_H IDENT_PA_WWRAPPER_H; //#define DEBUG_EXECUTE @@ -825,8 +825,8 @@ void Request::execute(ArrayOperation& op throw Exception(PARSER_RUNTIME, 0, "is '%s', not a method or junction, can not call it", value.type()); } -#ifdef OPTIMIZE_CALL const Method& method=*junction->method; +#ifdef OPTIMIZE_CALL if(method.call_optimization==Method::CO_WITHOUT_FRAME){ if(local_ops){ // store param code goes here size_t first = stack.top_index(); @@ -1370,23 +1370,11 @@ Value& Request::process_getter(Junction& return frame.result(); } -/** @param intercept_string - - true: - they want result=string value, - possible object result goes to wcontext - - false: - they want any result[string|object] - nothing goes to wcontext. - used in @c (expression) params evaluation - - using the fact it's either string_ or value_ result requested to speed up checkes -*/ - -Value& Request::process(Value& input_value, bool intercept_string) { +Value& Request::process(Value& input_value) { Junction* junction=input_value.get_junction(); if(junction) { if(junction->is_getter) { // is it a getter-junction? - return process(process_getter(*junction), intercept_string); + return process(process_getter(*junction)); } if(junction->code) { // is it a code-junction? @@ -1403,23 +1391,20 @@ Value& Request::process(Value& input_val method_frame=junction->method_frame; rcontext=junction->rcontext; - // for expression method params - // wcontext is set 0 - // using the fact in decision "which wwrapper to use" - bool using_code_frame=intercept_string && junction->wcontext; + // for code in [] and () wcontext is set 0 + // using the fact in decision "which wrapper to use" + bool using_code_frame=junction->wcontext; if(using_code_frame) { - // almost plain wwrapper about junction wcontext - + // {} code wrapper VCodeFrame local(*junction->wcontext); wcontext=&local; // execute it recoursion_checked_execute(*junction->code); - // CodeFrame soul: result=wcontext->result(); } else { - // plain wwrapper + // [] or () code wrapper WWrapper local(wcontext); wcontext=&local; @@ -1450,7 +1435,7 @@ void Request::process_write(Value& input // to process method arguments, not from get_element if(junction->code) { // is it a code-junction? - // process it + // process it DEBUG_PRINT_STR("ja->\n") @@ -1462,8 +1447,7 @@ void Request::process_write(Value& input method_frame=junction->method_frame; rcontext=junction->rcontext; - // for expression method params - // wcontext is set 0 + // for code in [] and () wcontext is set 0 // using the fact in decision "which wwrapper to use" #ifdef OPTIMIZE_CALL if(wcontext==junction->wcontext){ @@ -1474,7 +1458,7 @@ void Request::process_write(Value& input } else #endif if(junction->wcontext) { - // almost plain wwrapper about junction wcontext + // {} code wrapper VCodeFrame local(*junction->wcontext); wcontext=&local; @@ -1483,7 +1467,7 @@ void Request::process_write(Value& input RESTORE_CONTEXT write_pass_lang(local.result()); } else { - // plain wwrapper + // [] or () code wrapper WWrapper local(wcontext); wcontext=&local;