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.338 2003/08/03 00:58:06 mast Exp $ + || $Id: las.c,v 1.339 2003/08/03 02:42:03 mast Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.338 2003/08/03 00:58:06 mast Exp $"); + RCSID("$Id: las.c,v 1.339 2003/08/03 02:42:03 mast 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:5395:    pike_throw();    }   }      ptrdiff_t eval_low(node *n,int print_error)   {    unsigned INT16 num_strings, num_constants;    size_t jump;    struct svalue *save_sp = Pike_sp;    ptrdiff_t ret; +  struct program *prog = Pike_compiler->new_program;   #ifdef PIKE_USE_MACHINE_CODE    size_t num_relocations;   #endif /* PIKE_USE_MACHINE_CODE */      #ifdef PIKE_DEBUG    if(l_flag > 3 && n)    {    fprintf(stderr,"Evaluating (tree info=%x):",n->tree_info);    print_tree(n);    }   #endif       if(Pike_compiler->num_parse_error) return -1;    -  num_strings=Pike_compiler->new_program->num_strings; -  num_constants=Pike_compiler->new_program->num_constants; +  num_strings=prog->num_strings; +  num_constants=prog->num_constants;   #ifdef PIKE_USE_MACHINE_CODE -  num_relocations = Pike_compiler->new_program->num_relocations; +  num_relocations = prog->num_relocations;   #endif /* PIKE_USE_MACHINE_CODE */       jump = PIKE_PC;      #ifdef INS_ENTRY    INS_ENTRY();   #endif /* INS_ENTRY */       store_linenumbers=0;    docode(dmalloc_touch(node *, n));
pike.git/src/las.c:5436:    ret=-1;    if(!Pike_compiler->num_parse_error)    {    struct callback *tmp_callback;    struct timer_oflo foo;       /* This is how long we try to optimize before giving up... */    foo.counter=10000;    foo.yes=0;    -  make_program_executable(Pike_compiler->new_program); +  make_program_executable(prog);       tmp_callback=add_to_callback(&evaluator_callbacks,    check_evaluation_time,    (void *)&foo,0);       if(apply_low_safe_and_stupid(Pike_compiler->fake_object, jump))    {    if(print_error)    /* Generate error message */    if(!Pike_compiler->catch_level)
pike.git/src/las.c:5479:    }else{    if(foo.yes)    pop_n_elems(Pike_sp-save_sp);    else    ret=Pike_sp-save_sp;    }       remove_callback(tmp_callback);    }    -  while(Pike_compiler->new_program->num_strings > num_strings) +  while(prog->num_strings > num_strings)    { -  Pike_compiler->new_program->num_strings--; -  free_string(Pike_compiler->new_program->strings[Pike_compiler->new_program->num_strings]); +  prog->num_strings--; +  free_string(prog->strings[prog->num_strings]);    }    -  while(Pike_compiler->new_program->num_constants > num_constants) +  while(prog->num_constants > num_constants)    {    struct program_constant *p_const;    -  Pike_compiler->new_program->num_constants--; +  prog->num_constants--;    -  p_const = Pike_compiler->new_program->constants + Pike_compiler->new_program->num_constants; +  p_const = prog->constants + prog->num_constants;       free_svalue(&p_const->sval);    if (p_const->name) {    free_string(p_const->name);    p_const->name = NULL;    }    }      #ifdef PIKE_USE_MACHINE_CODE -  Pike_compiler->new_program->num_relocations = num_relocations; +  prog->num_relocations = num_relocations;      #ifdef VALGRIND_DISCARD_TRANSLATIONS    /* We won't use this machine code any more... */ -  VALGRIND_DISCARD_TRANSLATIONS(Pike_compiler->new_program->program + jump, -  (Pike_compiler->new_program-> -  num_program - jump)*sizeof(PIKE_OPCODE_T)); +  VALGRIND_DISCARD_TRANSLATIONS(prog->program + jump, +  (prog->num_program - jump)*sizeof(PIKE_OPCODE_T));   #endif /* VALGRIND_DISCARD_TRANSLATIONS */   #endif /* PIKE_USE_MACHINE_CODE */    -  Pike_compiler->new_program->num_program=jump; +  prog->num_program=jump;       return ret;   }      static node *eval(node *n)   {    node *new;    ptrdiff_t args;    if(!is_const(n) || n->token==':')    return n;