Diff for /parser3/src/main/compile_tools.h between versions 1.90 and 1.91

version 1.90, 2009/05/23 05:55:04 version 1.91, 2009/05/23 06:41:11
Line 300  inline bool maybe_make_get_object_var_el Line 300  inline bool maybe_make_get_object_var_el
 }  }
   
 inline bool maybe_make_root_or_write_construct(ArrayOperation& opcodes, ArrayOperation& var_ops, ArrayOperation& expr_ops){  inline bool maybe_make_root_or_write_construct(ArrayOperation& opcodes, ArrayOperation& var_ops, ArrayOperation& expr_ops){
 #ifdef OPTIMIZE_BYTECODE_CONSTRUCT  #if defined(OPTIMIZE_BYTECODE_CONSTRUCT) || defined(OPTIMIZE_BYTECODE_CALL_CONSTRUCT)
         if(          if(
                 var_ops.count()==4                  var_ops.count()==4
                 && (var_ops[0].code==OP::OP_WITH_ROOT || var_ops[0].code==OP::OP_WITH_WRITE)                  && (var_ops[0].code==OP::OP_WITH_ROOT || var_ops[0].code==OP::OP_WITH_WRITE)
Line 321  inline bool maybe_make_root_or_write_con Line 321  inline bool maybe_make_root_or_write_con
                         && expr_ops[count-1].code==OP::OP_CONSTRUCT_EXPR                          && expr_ops[count-1].code==OP::OP_CONSTRUCT_EXPR
                 ){                  ){
                         if(count==5){                          if(count==5){
   #ifdef OPTIMIZE_BYTECODE_CONSTRUCT
                                 if(expr_ops[1].code==OP::OP_VALUE){                                  if(expr_ops[1].code==OP::OP_VALUE){
                                         //      $a(1) $.a(2)                                          //      $a(1) $.a(2)
                                         //      OP_PREPARE_TO_EXPRESSION                                          //      OP_PREPARE_TO_EXPRESSION
Line 331  inline bool maybe_make_root_or_write_con Line 332  inline bool maybe_make_root_or_write_con
                                         O(opcodes, (with_root) ? OP::OP_ROOT_CONSTRUCT_EXPR : OP::OP_WRITE_CONSTRUCT_EXPR);                                          O(opcodes, (with_root) ? OP::OP_ROOT_CONSTRUCT_EXPR : OP::OP_WRITE_CONSTRUCT_EXPR);
                                         source=&expr_ops;                                          source=&expr_ops;
                                         offset=2;                                          offset=2;
 #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT  
                                 } else if(expr_ops[1].code==OP::OP_VALUE__GET_ELEMENT){                                  } else if(expr_ops[1].code==OP::OP_VALUE__GET_ELEMENT){
                                         //      $a($b) or $.a($b)                                          //      $a($b) or $.a($b)
                                         //      OP_PREPARE_TO_EXPRESSION                                          //      OP_PREPARE_TO_EXPRESSION
Line 342  inline bool maybe_make_root_or_write_con Line 342  inline bool maybe_make_root_or_write_con
                                         O(opcodes, (with_root) ? OP::OP_ROOT_ELEMENT_CONSTRUCT_EXPR : OP::OP_WRITE_ELEMENT_CONSTRUCT_EXPR);                                          O(opcodes, (with_root) ? OP::OP_ROOT_ELEMENT_CONSTRUCT_EXPR : OP::OP_WRITE_ELEMENT_CONSTRUCT_EXPR);
                                         source=&expr_ops;                                          source=&expr_ops;
                                         offset=2;                                          offset=2;
 #endif // OPTIMIZE_BYTECODE_GET_ELEMENT  #endif // OPTIMIZE_BYTECODE_CONSTRUCT
                                 }                                  }
 #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT  #ifdef OPTIMIZE_BYTECODE_CALL_CONSTRUCT
                         } else if(count==7){                          } else if(count==7){
                                 if(                                  if(
                                         expr_ops[1].code==OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR                                          expr_ops[1].code==OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR
Line 363  inline bool maybe_make_root_or_write_con Line 363  inline bool maybe_make_root_or_write_con
                                         offset=2;                                          offset=2;
                                         limit=4;                                          limit=4;
                                 }                                  }
 #endif // OPTIMIZE_BYTECODE_GET_ELEMENT  #endif // OPTIMIZE_BYTECODE_CALL_CONSTRUCT
                         }                          }
                 } else if(expr_ops[count-1].code==OP::OP_CONSTRUCT_VALUE){                  } else if(expr_ops[count-1].code==OP::OP_CONSTRUCT_VALUE){
   #ifdef OPTIMIZE_BYTECODE_CONSTRUCT
                         if(                          if(
                                 count==4                                  count==4
                                 && expr_ops[0].code==OP::OP_VALUE                                  && expr_ops[0].code==OP::OP_VALUE
Line 378  inline bool maybe_make_root_or_write_con Line 379  inline bool maybe_make_root_or_write_con
                                 O(opcodes, (with_root) ? OP::OP_ROOT_CONSTRUCT_VALUE : OP::OP_WRITE_CONSTRUCT_VALUE);                                  O(opcodes, (with_root) ? OP::OP_ROOT_CONSTRUCT_VALUE : OP::OP_WRITE_CONSTRUCT_VALUE);
                                 source=&expr_ops;                                  source=&expr_ops;
                                 offset=1;                                  offset=1;
                         } else if(                          }
   #endif
                           if(
                                 count==3                                  count==3
                                 && expr_ops[0].code==OP::OP_OBJECT_POOL                                  && expr_ops[0].code==OP::OP_OBJECT_POOL
                         ){                          ){
 #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT  
                                 ArrayOperation& pool_ops=*expr_ops[1].ops;                                  ArrayOperation& pool_ops=*expr_ops[1].ops;
   
   #ifdef OPTIMIZE_BYTECODE_CONSTRUCT
                                 if(                                  if(
                                         pool_ops.count()==3                                          pool_ops.count()==3
                                         && pool_ops[0].code==OP::OP_VALUE__GET_ELEMENT__WRITE                                          && pool_ops[0].code==OP::OP_VALUE__GET_ELEMENT__WRITE
Line 398  inline bool maybe_make_root_or_write_con Line 401  inline bool maybe_make_root_or_write_con
                                         O(opcodes, (with_root) ? OP::OP_ROOT_ELEMENT_CONSTRUCT_VALUE : OP::OP_WRITE_ELEMENT_CONSTRUCT_VALUE);                                          O(opcodes, (with_root) ? OP::OP_ROOT_ELEMENT_CONSTRUCT_VALUE : OP::OP_WRITE_ELEMENT_CONSTRUCT_VALUE);
                                         source=&pool_ops;                                          source=&pool_ops;
                                         offset=1;                                          offset=1;
                                 } else if(                                  }
   #endif // OPTIMIZE_BYTECODE_CONSTRUCT
   #ifdef OPTIMIZE_BYTECODE_CALL_CONSTRUCT
                                   if(
                                         pool_ops.count()==5                                          pool_ops.count()==5
                                         && pool_ops[0].code==OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR                                          && pool_ops[0].code==OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR
                                         && pool_ops[3].code==OP::OP_CALL__WRITE                                          && pool_ops[3].code==OP::OP_CALL__WRITE
Line 416  inline bool maybe_make_root_or_write_con Line 422  inline bool maybe_make_root_or_write_con
                                         offset=1;                                          offset=1;
                                         limit=4;                                          limit=4;
                                 }                                  }
 #endif // OPTIMIZE_BYTECODE_GET_ELEMENT  #endif // OPTIMIZE_BYTECODE_CALL_CONSTRUCT
                         }                          }
                 }                  }
   
Line 426  inline bool maybe_make_root_or_write_con Line 432  inline bool maybe_make_root_or_write_con
                         return true;                          return true;
                 }                  }
         }          }
 #endif // OPTIMIZE_BYTECODE_CONSTRUCT  #endif
         return false;          return false;
 }  }
   

Removed from v.1.90  
changed lines
  Added in v.1.91


E-mail: