--- parser3/src/main/compile_tools.h 2009/06/07 13:15:54 1.96 +++ parser3/src/main/compile_tools.h 2009/08/14 23:36:55 1.99 @@ -8,7 +8,7 @@ #ifndef COMPILE_TOOLS #define COMPILE_TOOLS -static const char * const IDENT_COMPILE_TOOLS_H="$Date: 2009/06/07 13:15:54 $"; +static const char * const IDENT_COMPILE_TOOLS_H="$Date: 2009/08/14 23:36:55 $"; #include "pa_opcode.h" #include "pa_types.h" @@ -131,11 +131,9 @@ public: } VStateless_class* get_existed_class(VStateless_class* aclass){ - if(aclass){ - if(Value* class_value=request.classes().get(aclass->name())){ + if(aclass) + if(Value* class_value=request.get_class(aclass->name())) return class_value->get_class(); - } - } return 0; } @@ -207,6 +205,10 @@ inline void P(ArrayOperation& result, Ar } /// append cOde Array +inline void OA(ArrayOperation& result, ArrayOperation* code_array) { + result+=Operation(code_array); // append 'code_array' +} + inline void OA(ArrayOperation& result, OP::OPCODE code, ArrayOperation* code_array) { result+=Operation(code); // append OP_CODE result+=Operation(code_array); // append 'code_array' @@ -280,7 +282,7 @@ inline bool maybe_make_get_object_elemen #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT // OP_VALUE+origin+value+OP_GET_ELEMENT+OP_WITH_READ+OP_VALUE+origin+value+OP_GET_ELEMENT+OP_GET_ELEMENT => OP_GET_OBJECT_VAR_ELEMENT+origin+value+origin+value inline bool maybe_make_get_object_var_element(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t divine_count){ - if(divine_count<10) + if(divine_count!=10) return false; assert(diving_code[0].code==OP::OP_VALUE); @@ -294,8 +296,6 @@ inline bool maybe_make_get_object_var_el O(opcodes, OP::OP_GET_OBJECT_VAR_ELEMENT); P(opcodes, diving_code, 1/*offset*/, 2/*limit*/); // copy first origin+value P(opcodes, diving_code, 6, 2); // second origin+value - if(divine_count>10) - P(opcodes, diving_code, 10/*offset*/); // tail return true; } return false;