|
|
| version 1.366, 2010/10/09 23:17:26 | version 1.370, 2012/07/28 20:10:58 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: executor part of request class. | Parser: executor part of request class. |
| Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| static const char * const IDENT_EXECUTE_C="$Date$"; | |
| #include "pa_opcode.h" | #include "pa_opcode.h" |
| #include "pa_array.h" | #include "pa_array.h" |
| #include "pa_request.h" | #include "pa_request.h" |
| Line 23 static const char * const IDENT_EXECUTE_ | Line 21 static const char * const IDENT_EXECUTE_ |
| #include "pa_vimage.h" | #include "pa_vimage.h" |
| #include "pa_wwrapper.h" | #include "pa_wwrapper.h" |
| volatile const char * IDENT_EXECUTE_C="$Id$" IDENT_PA_OPCODE_H IDENT_PA_OPERATION_H IDENT_PA_VCODE_FRAME_H IDENT_PA_WWRAPPER_H; | |
| //#define DEBUG_EXECUTE | //#define DEBUG_EXECUTE |
| #ifdef DEBUG_EXECUTE | #ifdef DEBUG_EXECUTE |
| Line 639 void Request::execute(ArrayOperation& op | Line 639 void Request::execute(ArrayOperation& op |
| execute(local_ops); | execute(local_ops); |
| Value* value; | |
| // from "$a $b" part of expression taking only string value, | // from "$a $b" part of expression taking only string value, |
| // ignoring any other content of wcontext | // ignoring any other content of wcontext |
| if(const String* string=wcontext->get_string()) | const String* string=wcontext->get_string(); |
| value=new VString(*string); | Value* value=string ? new VString(*string) : new VString(); |
| else | |
| value=VVoid::get(); | |
| stack.push(*value); | stack.push(*value); |
| wcontext=saved_wcontext; | wcontext=saved_wcontext; |
| Line 723 void Request::execute(ArrayOperation& op | Line 720 void Request::execute(ArrayOperation& op |
| value.type()); | value.type()); |
| } | } |
| VMethodFrame frame(*junction->method, method_frame, junction->self); | Value *result; |
| METHOD_FRAME_ACTION(op_call(frame)); | { |
| stack.push(frame.result().as_value()); | VMethodFrame frame(*junction->method, method_frame, junction->self); |
| METHOD_FRAME_ACTION(op_call(frame)); | |
| result=&frame.result().as_value(); | |
| // VMethodFrame desctructor deletes junctions in stack params here | |
| } | |
| stack.push(*result); | |
| DEBUG_PRINT_STR("<-returned") | DEBUG_PRINT_STR("<-returned") |
| Line 836 void Request::execute(ArrayOperation& op | Line 838 void Request::execute(ArrayOperation& op |
| DEBUG_PRINT_OPS(local_ops) | DEBUG_PRINT_OPS(local_ops) |
| DEBUG_PRINT_STR("->\n") | DEBUG_PRINT_STR("->\n") |
| Value &object=construct(*class_value, *constructor_junction->method); | Value *result; |
| VConstructorFrame frame(*constructor_junction->method, method_frame, object); | { |
| METHOD_FRAME_ACTION(op_call(frame)); | Value& object=construct(*class_value, *constructor_junction->method); |
| object.enable_default_setter(); | VConstructorFrame frame(*constructor_junction->method, method_frame, object); |
| METHOD_FRAME_ACTION(op_call(frame)); | |
| object.enable_default_setter(); | |
| result=&frame.result().as_value(); | |
| // VMethodFrame desctructor deletes junctions in stack params here | |
| } | |
| if(opcode==OP::OP_CONSTRUCT_OBJECT) | if(opcode==OP::OP_CONSTRUCT_OBJECT) |
| stack.push(frame.result().as_value()); | stack.push(*result); |
| else | else |
| write_pass_lang(frame.result()); | write_pass_lang(*result); |
| DEBUG_PRINT_STR("<-returned") | DEBUG_PRINT_STR("<-returned") |
| break; | break; |