pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.322 2003/12/02 13:49:58 grubba Exp $ + || $Id: las.c,v 1.323 2003/12/03 09:35:24 grubba Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.322 2003/12/02 13:49:58 grubba Exp $"); + RCSID("$Id: las.c,v 1.323 2003/12/03 09:35:24 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:515: Inside #if defined(SHARED_NODES)
   scan = scan->next;    }    } else {    /* FIXME: sub_node() recalculates the hash index.    * We might get better performance by using the one we already have.    */    sub_node(orig);    }    /* Propagate the line-number information. */    n->line_number = orig->line_number; - #ifdef PIKE_DEBUG +     if (orig->current_file) {    if (n->current_file) {    free_string(n->current_file);    }    n->current_file = orig->current_file;    orig->current_file = NULL;    } - #endif /* PIKE_DEBUG */ +     free_node(dmalloc_touch(node *, orig));    n->refs++;    return check_node_hash(dmalloc_touch(node *, n));    }    n = n->next;    }    orig->node_info &= ~OPT_DEFROSTED;    if (!found) {    add_node(dmalloc_touch(node *, orig));    }
pike.git/src/las.c:761: Inside #if defined(SHARED_NODES) && defined(PIKE_DEBUG)
  #if defined(SHARED_NODES) && defined(PIKE_DEBUG)    if (dead->refs) {    Pike_fatal("Killed node %p still has refs: %d\n", dead, dead->refs);    }   #endif /* SHARED_NODES && PIKE_DEBUG */       n = n->parent;       if(dead->type) free_type(dead->type);    if(dead->name) free_string(dead->name); - #ifdef PIKE_DEBUG +     if(dead->current_file) free_string(dead->current_file); - #endif +     dead->token=USHRT_MAX;    really_free_node_s(dead);    }    if (n->parent && cdr_is_node(n->parent)) {    /* Kill node and jump to the sibling. */    node *dead = n;      #if defined(SHARED_NODES) && defined(PIKE_DEBUG)    if (dead->refs) {    Pike_fatal("Killed node %p still has refs: %d\n", dead, dead->refs);    }   #endif /* SHARED_NODES && PIKE_DEBUG */       n = n->parent;    if(dead->type) free_type(dead->type);    if(dead->name) free_string(dead->name); - #ifdef PIKE_DEBUG +     if(dead->current_file) free_string(dead->current_file); - #endif +     dead->token=USHRT_MAX;    really_free_node_s(dead);      #ifdef SHARED_NODES    if (--_CDR(n)->refs) {    _CDR(n) = NULL;    goto backtrack;    } else {   #endif /* SHARED_NODES */    _CDR(n)->parent = n;
pike.git/src/las.c:811:    /* Kill root node. */      #if defined(SHARED_NODES) && defined(PIKE_DEBUG)    if (n->refs) {    Pike_fatal("Killed node %p still has refs: %d\n", n, n->refs);    }   #endif /* SHARE_NODES && PIKE_DEBUG */       if(n->type) free_type(n->type);    if(n->name) free_string(n->name); - #ifdef PIKE_DEBUG +     if(n->current_file) free_string(n->current_file); - #endif +        n->token=USHRT_MAX;    really_free_node_s(n);    break;    } while (n->parent);   }         node *debug_check_node_hash(node *n)   {
pike.git/src/las.c:850:    node *res=alloc_node_s();      #ifdef SHARED_NODES    MEMSET(res, 0, sizeof(node));    res->hash = 0;    res->refs = 1;   #endif /* SHARED_NODES */       res->token=0;    res->line_number=lex.current_line; - #ifdef PIKE_DEBUG +     copy_shared_string(res->current_file, lex.current_file); - #endif +     res->type=0;    res->name=0;    res->node_info=0;    res->tree_info=0;    res->parent=0;    return res;   }      #define mkemptynode() dmalloc_touch(node *, debug_mkemptynode())   
pike.git/src/las.c:5118: Inside #if defined(SHARED_NODES)
   n->node_info &= ~OPT_DEFROSTED;    if (n->node_info & OPT_OPTIMIZED) {    /* No need to check this node any more. */    n = n->parent;    continue;    }    }   #endif /* SHARED_NODES && !IN_TPIKE */       lex.current_line = n->line_number; - #ifdef PIKE_DEBUG +     lex.current_file = n->current_file; - #endif /* PIKE_DEBUG */ +       #ifdef SHARED_NODES    if (n->tree_info & OPT_NOT_SHARED) {    n->tree_info = n->node_info;    if(car_is_node(n)) n->tree_info |= CAR(n)->tree_info;    if(cdr_is_node(n)) n->tree_info |= CDR(n)->tree_info;    if(!(n->tree_info & OPT_NOT_SHARED)) {    /* We need to fix the hash for this node. */    n->hash = hash_node(n);    /* FIXME: Should probably add the node to the hashtable here. */