pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.106 1999/11/12 19:03:32 grubba Exp $"); + RCSID("$Id: las.c,v 1.107 1999/11/14 19:20:31 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:501: Inside #if defined(SHARED_NODES)
   if (res2 != res) {    return dmalloc_touch(node *, res2);    }    }   #endif /* SHARED_NODES */       switch(token)    {    case F_CATCH:    res->node_info |= OPT_SIDE_EFFECT; +  if (a) { +  res->tree_info |= a->tree_info & ~OPT_BREAK; +  }    break;       case F_APPLY:    if(a && a->token == F_CONSTANT &&    a->u.sval.type == T_FUNCTION &&    a->u.sval.subtype == FUNCTION_BUILTIN)    {    res->node_info |= a->u.sval.u.efun->flags;    }else{    res->node_info |= OPT_SIDE_EFFECT | OPT_EXTERNAL_DEPEND; /* for now */    }    break;    -  case F_MAGIC_INDEX: +     case F_MAGIC_SET_INDEX: -  +  res->node_info |= OPT_ASSIGNMENT; +  /* FALL_THROUGH */ +  case F_MAGIC_INDEX:    res->node_info |= OPT_EXTERNAL_DEPEND;    break;       case F_UNDEFINED:    res->node_info |= OPT_EXTERNAL_DEPEND | OPT_SIDE_EFFECT;    break;       case F_RETURN:    res->node_info |= OPT_RETURN;    break;
pike.git/src/las.c:540:       case F_CONTINUE:    res->node_info |= OPT_CONTINUE;    break;       case F_DEFAULT:    case F_CASE:    res->node_info |= OPT_CASE;    break;    +  case F_INC_LOOP: +  case F_INC_NEQ_LOOP: +  case F_DEC_LOOP: +  case F_DEC_NEQ_LOOP: +  res->node_info |= OPT_ASSIGNMENT; +  if (a) { +  res->tree_info |= a->tree_info; +  } +  if (b) { +  res->tree_info |= (b->tree_info & ~(OPT_BREAK|OPT_CONTINUE)); +  } +  break; +     case F_SSCANF:    if(!b || count_args(b) == 0) break; -  /* fall through */ +  res->node_info |= OPT_ASSIGNMENT; +  break;       case F_ASSIGN: -  +  case F_MOD_EQ: +  case F_AND_EQ: +  case F_MULT_EQ: +  case F_ADD_EQ: +  case F_SUB_EQ: +  case F_DIV_EQ: +  case F_LSH_EQ: +  case F_RSH_EQ: +  case F_XOR_EQ: +  case F_OR_EQ: +  res->node_info |= OPT_ASSIGNMENT; +  if (a) { +  res->tree_info |= a->tree_info; +  } +  if (b) { +  res->tree_info |= b->tree_info; +  } +  break; +     case F_INC:    case F_DEC:    case F_POST_INC:    case F_POST_DEC:    res->node_info |= OPT_ASSIGNMENT; -  +  if (a) { +  res->tree_info |= a->tree_info; +  }    break;       default:    /* We try to optimize most things, but argument lists are hard... */    if(token != F_ARG_LIST && (a || b))    res->node_info |= OPT_TRY_OPTIMIZE;    -  res->tree_info = res->node_info; +     if(a) res->tree_info |= a->tree_info;    if(b) res->tree_info |= b->tree_info;    }    -  +  res->tree_info |= res->node_info; +    #ifdef PIKE_DEBUG    if(d_flag > 3)    verify_shared_strings_tables();   #endif       if(!num_parse_error && compiler_pass==2)    {    check_tree(res,0);    optimize(res);    check_tree(res,0);
pike.git/src/las.c:2220:    zapp_try_optimize(CDR(n)); /* avoid infinite loops */    continue;    }    }    fix_type_field(n);    debug_malloc_touch(n->type);      #ifdef PIKE_DEBUG    if(l_flag > 3 && n)    { -  fprintf(stderr,"Optimizing (tree info=%x):",n->tree_info); +  fprintf(stderr,"Optimizing (tree info=%04x):",n->tree_info);    print_tree(n);    }   #endif      #ifndef IN_TPIKE    switch(n->token)    {   #include "treeopt.h"    use_car:    ADD_NODE_REF2(CAR(n), tmp1 = CAR(n));