--- parser3/src/main/compile.y 2009/06/13 07:05:22 1.249 +++ parser3/src/main/compile.y 2009/08/11 10:19:02 1.251 @@ -5,7 +5,7 @@ Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.249 2009/06/13 07:05:22 misha Exp $ + $Id: compile.y,v 1.251 2009/08/11 10:19:02 misha Exp $ */ /** @@ -130,11 +130,11 @@ static const VVoid vvoid; %% all: one_big_piece { - Method& method=*new Method(Method::CT_ANY, + Method* method=new Method(Method::CT_ANY, 0, 0, /*min, max numbered_params_count*/ 0/*param_names*/, 0/*local_names*/, $1/*parser_code*/, 0/*native_code*/); - PC.cclass->add_method(PC.alias_method(main_method_name), method); + PC.cclass->set_method(PC.alias_method(main_method_name), method); } | methods; @@ -290,13 +290,13 @@ code_method: '@' STRING bracketed_maybe_ // todo: check [][;result;] } maybe_codes { - Method& method=*reinterpret_cast($7); + Method* method=reinterpret_cast($7); // fill in the code - method.parser_code=$8; + method->parser_code=$8; // register in class const String& name=*LA2S(*$2); - PC.cclass->add_method(PC.alias_method(name), method); + PC.cclass->set_method(PC.alias_method(name), method); }; maybe_bracketed_strings: empty | bracketed_maybe_strings; @@ -522,9 +522,7 @@ call: call_value { #endif { $$=$1; /* stack: value */ -#ifdef OPTIMIZE_BYTECODE_CONSTRUCT_OBJECT if(!maybe_change_first_opcode(*$$, OP::OP_CONSTRUCT_OBJECT, /*=>*/OP::OP_CONSTRUCT_OBJECT__WRITE)) -#endif changetail_or_append(*$$, OP::OP_CALL, true, /*=>*/ OP::OP_CALL__WRITE, /*or */OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ @@ -557,7 +555,6 @@ call_value: '^' { /* stack: context, method_junction */ YYSTYPE var_code=$3; -#ifdef OPTIMIZE_BYTECODE_CONSTRUCT_OBJECT if( var_code->count()==8 && (*var_code)[0].code==OP::OP_VALUE__GET_CLASS @@ -571,7 +568,6 @@ call_value: '^' { P(*$$, *var_code, 5/*offset*/, 2/*limit*/); // constructor name OA(*$$, params_code); } else -#endif { $$=var_code; /* with_xxx,diving code; stack: context,method_junction */ OA(*$$, OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value