--- parser3/src/main/compile.y 2009/04/28 11:11:10 1.233 +++ parser3/src/main/compile.y 2009/04/29 06:48:46 1.235 @@ -5,7 +5,7 @@ Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.233 2009/04/28 11:11:10 misha Exp $ + $Id: compile.y,v 1.235 2009/04/29 06:48:46 misha Exp $ */ /** @@ -317,7 +317,9 @@ action: get | put | call; get: get_value { $$=$1; /* stack: resulting value */ +#ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(!replace_top_opcode(*$$, OP::OP_VALUE__GET_ELEMENT, OP::OP_VALUE__GET_ELEMENT__WRITE)) +#endif changetail_or_append(*$$, OP::OP_GET_ELEMENT, false, /*->*/OP::OP_GET_ELEMENT__WRITE, /*or */OP::OP_WRITE_VALUE @@ -464,7 +466,7 @@ call_value: '^' { $$=$3; /* with_xxx,diving code; stack: context,method_junction */ YYSTYPE params_code=$5; - if(params_code->count()==4) { // probably [] case. [OP::OP_VALUE+origin+Void+STORE_PARAM] + if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? if(value->is_void()) // value is VVoid? params_code=0; // ^zzz[] case. don't append lone empty param. @@ -503,14 +505,12 @@ store_curly_param_parts: ; store_code_param_part: code_param_value { $$=$1; - O(*$$, OP::OP_STORE_PARAM); }; store_expr_param_part: expr_value { YYSTYPE expr_code=$1; if(expr_code->count()==3 - && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double] + && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating $$=expr_code; - O(*$$, OP::OP_STORE_PARAM); // no evaluating } else { ArrayOperation* code=N(); O(*code, OP::OP_PREPARE_TO_EXPRESSION);